Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hscmap/tuple-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

@hscmap/tuple-map

<!-- TupleMapはほとんどES6のMapと同じですが、tupleをキーに持つことができます。 --> TupleMap is almost same as a ES6's Map, but it can have tuples as its keys.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

TupleMap

TupleMap is almost same as a ES6's Map, but it can have tuples as its keys.

Install

npm install --save @hscmap/tuple-map

Example

import { TupleMap } from "@hscmap/tuple-map"

const tm = new TupleMap<[number, number], string>()

console.assert(tm.get([0, 0]) == undefined)

tm.set([0, 0], '0,0')
console.assert(tm.get([0, 0]) == '0,0')
console.assert(tm.get([0, 1]) == undefined)

tm.delete([0, 0])
console.assert(tm.get([0, 0]) == undefined)

tm.set([1, 2], '1,2')
tm.set([1, 2], '1,2')
console.assert(tm.has([1, 2]))
console.assert(tm.get([1, 2]) == '1,2')

tm.delete([1, 2])
console.assert(tm.has([1, 2]) == false)
console.assert(tm._internalMapSize() == 0)


tm.set([1, 2], '1,2')
tm.clear()
console.assert(tm.get([1, 2]) == undefined)

FAQs

Package last updated on 29 Jul 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc