1.0.16 • Published 17 days ago
abstract-list v1.0.16
abstract-list
Abstract list for working with arrays that aren't really arrays.
Usage
// This is an abstract list
const arrayList: List<number> = [1, 2, 3];
// This is also an abstract list
const aList: List<number> = {
at(index) {
return index;
},
length: Number.MAX_SAFE_INTEGER,
};
// This is a giant list for which elem.at(x) === x^2
const squareList: List<number> = {
at(index) {
return index * index;
},
length: Number.MAX_SAFE_INTEGER,
};
In bun-engine, abstract lists are used to represent a large number sprites flexibly, without storing each sprite structure.
Install bun
curl -fsSL https://bun.sh/install | bash