New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

maps

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maps

Some special Map implementations for ES6+

latest
Source
npmnpm
Version
0.3.3
Version published
Weekly downloads
212
7.61%
Maintainers
1
Weekly downloads
 
Created
Source

NPM Version Build Status Coverage Status Downloads

maps

Some special Map implementations for ES6+

Install

npm install maps

Usage

import {HashMap} from 'maps'

class Entity {
	constructor(id) {
		this.id = id
	}
	[Symbol.for('hashCode')]() {
		return this.id
	}
	[Symbol.for('equals')](x) {
		return x instanceof Entity && x.id === this.id
	}
}

const m = new HashMap
const e1 = new Entity(42)
const e2 = new Entity(42)
const test = {}
assert(e1 !== e2)
m.set(e1, test)
assert(m.get(e2) === test)

API

Same as standard Map.

Keywords

HashMap

FAQs

Package last updated on 17 Aug 2015

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