🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

deep-weak-map

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-weak-map

WeakMap with an array of keys

1.1.0
latest
npm
Version published
Weekly downloads
27
2600%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

map

FAQs

Package last updated on 26 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts