Socket
Book a DemoInstallSign in
Socket

deepmap

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deepmap

Maps with variadic key input

0.2.1
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

deepmap

Maps with multiple keys per value

Supports the following Map methods:

  • clear
  • delete
  • has
  • get
  • set

All other Map methods & properties, including well-known symbols and coercion logic, are not catered for at present.

Signature for all methods is the same as for Map, except that in place of a key, it instead accepts an array of keys.

map[ method ]( key, value? )

...DeepMaps instead provide:

map[ method ]( [ ...keys ], value? )

Ergo:

const sums = new DeepMap()

sums.set( [ 1, 2 ], 3 )

sums.has( 1 )           // false

sums.has( [ 1 ] )       // false

sums.has( [ 1, 2 ] )    // true

sums.get( [ 1, 2 ] )    // 3

sums.delete( [ 1, 2 ] ) // true

sums.has( [ 1, 2 ] )    // false

Keywords

map

FAQs

Package last updated on 03 Jan 2016

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.