@nfi/tuplemap
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@nfi/tuplemap

npm version pipeline status coverage status

Map implementation using N-tuples as multi-dimensional keys; matches the interface and behaviour of the ES2015 Map wherever possible.

Installation

npm install @nfi/tuplemap

Documentation

API documentation is available here.

Iteration Order

TupleMaps do not guarantee iteration over keys in insertion order like Maps do; iteration order is consistent for any given set of keys, but not easily predictable.

Deletion Strategy

By default, TupleMaps clean up empty/unneeded internal structures on every key deletion. The delete method has an optional parameter, prune, that can be used to disable this behaviour. This strategy can increase performance for collections with high turnover on a consistent set of keys, but must be supplemented with periodic calls to prune or clear to manually clean up unused structures or they will leak memory over time.

/@nfi/tuplemap/

    Package Sidebar

    Install

    npm i @nfi/tuplemap

    Weekly Downloads

    49

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    26.7 kB

    Total Files

    15

    Last publish

    Collaborators

    • cptpackrat