mini-map
A very small subset of ES6 Map that is good enough for small collections
Last updated 11 years ago by kriskowal .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mini-map 
SYNC missed versions from official npm registry.

MiniMap

The mini map implements a subset of the ECMAScript 6 Map that performs well enough for very small collections. This implementation exists for a good-enough approximation of a Map that doesn't waste much space even if an alternative is almost always used in practice. Keys may be objects. Supports has, get, set, delete, and clear. The MiniMap constructor supports no arguments.

var map = new Map();
var key = {};
expect(map.has(key)).toBe(false);
map.set(key, 10);
expect(map.get(key)).toBe(10);
expect(map.has(key)).toBe(true);
map.delete(key);
expect(map.has(key)).toBe(false);
map.clear();

License and Copyright

Copyright (c) 2015 Kristopher Michael Kowal and contributors. All rights reserved. MIT License.

Current Tags

  • 1.0.0                                ...           latest (11 years ago)

1 Versions

  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |