xmap
v1.0.1
Published
Extended Map, Set, WeakMap, WeakSet JavaScript functions
Downloads
7
Readme
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)