This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Because JS isn't cursed enough :) | |
| import util from 'node:util'; | |
| class IrrationalArray extends Array { | |
| constructor(...args: any[]) { | |
| super(...args); | |
| const indexes = Object.keys(this).filter(key => !Number.isNaN(Number(key))).map(key => Number(key)).sort((a, b) => a - b); | |
| for (const index of indexes) this._data.set(index, this[index]); | |
| super.length = 0; | |
| return new Proxy(this, { |
OlderNewer