1.0.1 • Published 8 years ago

xmap v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

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)