xmap

1.0.1 • Public • Published

xmap

Extended Map, Set, WeakMap, WeakSet JavaScript functions

npm install xmap --save

Features

  • No dependencies as used native functions
  • Reverse compatibility with Map, Set, WeakMap, WeakSet as native functions are used
  • Improvements in get function in cases when you use objects
// Initiate
const map = new xMap()
 
// Set
map.set({ a: 1, b: 1 }, "#1")
map.set({ a: 1, b: 2 }, "#2")
 
// Get
map.get({ a: 1 }) // [ "#1", "#2" ]
map.get({ b: 2 }) // "#2"

API

  • xMap (currently this only)
  • xSet
  • xWeakMap
  • xWeakSet

Requirements for using

  • Currently native support for Map, Set, WeakSet, WeakMap
  • Nodejs or browser (latest versions)

Readme

Keywords

Package Sidebar

Install

npm i xmap

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • viktor.konsta