1.0.0 • Published 10 months ago

@esfx/indexed-object v1.0.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
10 months ago

@esfx/indexed-object

The @esfx/indexed-object package provides a A base class for custom integer-indexed collections.

The underlying implementation uses a Proxy to trap integer indexes in a fashion similar to the Integer-Indexed Exotic Object in the ECMAScript specification.

Overview

Installation

npm i @esfx/indexed-object

Usage

import { IntegerIndexedObject } from "indexed-object";

class BooleansCollection extends IntegerIndexedObject {
    getLength() {
        return 2;
    }
    getIndex(index) {
        switch (index) {
            case 0: return false;
            case 1: return true;
            default: return undefined;
        }
    }
    // hasIndex(index): boolean
    // setIndex(index, value): boolean
    // deleteIndex(index): boolean
}

const booleans = new BooleansCollection();
console.log(booleans[0]); // false
console.log(booleans[1]); // true

API

You can read more about the API here.

1.0.0

2 years ago

1.0.0-dev.7

2 years ago

1.0.0-pre.42

2 years ago

1.0.0-dev.8

2 years ago

1.0.0-pre.41

2 years ago

1.0.0-dev.5

2 years ago

1.0.0-pre.44

2 years ago

1.0.0-dev.6

2 years ago

1.0.0-pre.43

2 years ago

1.0.0-dev.4

2 years ago

1.0.0-dev.0

2 years ago

1.0.0-pre.40

2 years ago

1.0.0-pre.31

2 years ago

1.0.0-pre.33

2 years ago

1.0.0-pre.35

2 years ago

1.0.0-pre.34

2 years ago

1.0.0-pre.37

2 years ago

1.0.0-pre.36

2 years ago

1.0.0-pre.39

2 years ago

1.0.0-pre.38

2 years ago

1.0.0-pre.19

3 years ago

1.0.0-pre.17

3 years ago

1.0.0-pre.16

3 years ago

1.0.0-pre.9

5 years ago

1.0.0-pre.8

5 years ago

1.0.0-pre.6

5 years ago

1.0.0-pre.5

5 years ago

1.0.0-pre.4

5 years ago

1.0.0-pre.3

5 years ago

1.0.0-pre.2

5 years ago

1.0.0-pre.1

5 years ago

1.0.0-pre.0

5 years ago