deep-weak-map
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

deep-weak-map

WeakMap with an array of keys

npm Coverage Status

Example

import DeepWeakMap from 'deep-weak-map';

const [ a, b, c, d ] = [
	randomObject(),
	randomObject(),
	randomObject(),
	randomObject(),
];

const value = randomObject();

const map = new DeepWeakMap();

map.set([ a, b, c ], value);

map.has([ a, b, c ]); // → true
map.has([ a, b, d ]); // → false

map.get([ a, b, c ]); // → value
map.get([ a, b, d ]); // → undefined

map.delete([ a, b, c ]);
map.has([ a, b, c ]); // → false

Install

yarn add deep-weak-map

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    17
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    17
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i deep-weak-map

Weekly Downloads

17

Version

1.1.0

License

MIT

Unpacked Size

50.6 kB

Total Files

17

Last publish

Collaborators

  • futpib