Socket
Socket
Sign inDemoInstall

mini-map

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mini-map

A very small subset of ES6 Map that is good enough for small collections


Version published
Weekly downloads
1.8K
increased by36.49%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

MiniMap

The mini map implements a subset of the ECMAScript 6 Map that performs well enough for very small collections. This implementation exists for a good-enough approximation of a Map that doesn't waste much space even if an alternative is almost always used in practice. Keys may be objects. Supports has, get, set, delete, and clear. The MiniMap constructor supports no arguments.

var map = new Map();
var key = {};
expect(map.has(key)).toBe(false);
map.set(key, 10);
expect(map.get(key)).toBe(10);
expect(map.has(key)).toBe(true);
map.delete(key);
expect(map.has(key)).toBe(false);
map.clear();

Copyright (c) 2015 Kristopher Michael Kowal and contributors. All rights reserved. MIT License.

FAQs

Last updated on 28 Jan 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc