es6-map

WebJar for es6-map

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

es6-map
Last Version

Last Version

0.1.5
Release Date

Release Date

Type

Type

jar
Description

Description

es6-map
WebJar for es6-map
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/medikoo/es6-map

Download es6-map

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/es6-map/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>es6-map</artifactId>
    <version>0.1.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/es6-map/
implementation 'org.webjars.npm:es6-map:0.1.5'
// https://jarcasting.com/artifacts/org.webjars.npm/es6-map/
implementation ("org.webjars.npm:es6-map:0.1.5")
'org.webjars.npm:es6-map:jar:0.1.5'
<dependency org="org.webjars.npm" name="es6-map" rev="0.1.5">
  <artifact name="es6-map" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='es6-map', version='0.1.5')
)
libraryDependencies += "org.webjars.npm" % "es6-map" % "0.1.5"
[org.webjars.npm/es6-map "0.1.5"]

Dependencies

compile (6)

Group / Artifact Type Version
org.webjars.npm : d jar [1,2)
org.webjars.npm : es6-set jar [0.1.5,0.2)
org.webjars.npm : es5-ext jar [0.10.14,0.11)
org.webjars.npm : es6-iterator jar [2.0.1,2.1)
org.webjars.npm : es6-symbol jar [3.1.1,3.2)
org.webjars.npm : event-emitter jar [0.3.5,0.4)

Project Modules

There are no modules declared in this project.

es6-map

Map collection as specified in ECMAScript6

Warning:
v0.1 version does not ensure O(1) algorithm complexity (but O(n)). This shortcoming will be addressed in v1.0

Usage

It’s safest to use es6-map as a ponyfill – a polyfill which doesn’t touch global objects:

var Map = require('es6-map');

If you want to make sure your environment implements Map globally, do:

require('es6-map/implement');

If you strictly want to use the polyfill even if the native Map exists, do:

var Map = require('es6-map/polyfill');

Installation

$ npm install es6-map

To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: Browserify, Webmake or Webpack

API

Best is to refer to specification. Still if you want quick look, follow examples:

var Map = require('es6-map');

var x = {}, y = {}, map = new Map([['raz', 'one'], ['dwa', 'two'], [x, y]]);

map.size;                 // 3
map.get('raz');           // 'one'
map.get(x);               // y
map.has('raz');           // true
map.has(x);               // true
map.has('foo');           // false
map.set('trzy', 'three'); // map
map.size                  // 4
map.get('trzy');          // 'three'
map.has('trzy');          // true
map.has('dwa');           // true
map.delete('dwa');        // true
map.size;                 // 3

map.forEach(function (value, key) {
  // { 'raz', 'one' }, { x, y }, { 'trzy', 'three' } iterated
});

// FF nightly only:
for (value of map) {
 // ['raz', 'one'], [x, y], ['trzy', 'three'] iterated
}

var iterator = map.values();

iterator.next(); // { done: false, value: 'one' }
iterator.next(); // { done: false, value: y }
iterator.next(); // { done: false, value: 'three' }
iterator.next(); // { done: true, value: undefined }

map.clear(); // undefined
map.size; // 0

Tests Build Status

$ npm test

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.


Get professional support for d with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Version
0.1.5
0.1.4