1.0.16 • Published 17 days ago

abstract-list v1.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
17 days ago

abstract-list

npm version

Abstract list for working with arrays that aren't really arrays.

icon

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

https://bun.sh/

curl -fsSL https://bun.sh/install | bash
1.0.16

17 days ago

1.0.15

3 months ago

1.0.14

3 months ago

1.0.13

4 months ago

1.0.11

4 months ago

1.0.10

4 months ago

1.0.12

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.1

5 months ago