sortedmap

0.0.2 • Public • Published

SYNOPSIS

NPM Package Build Status Coverage Status

js-standard-style

INSTALL

npm install sortedmap

USAGE

const SortedMap = require('sortedmap')
 
const map = new SortedMap([
  ['a', 7],
  ['b', 1],
  ['c', 3]
], (a, b) => {
  return a - b
})
 
map.get('a') // 7
 
map.set('z', 6)
[...map] // [['b', 1], ['c', 3], ['z', 6], ['a', 7]]

API

constructor

index.js:11-27

Creates a sorted map with all the method and properties of a regular JS Map

Parameters

  • values Array<Array>? the intial values for the Map
  • compare Function A comparator function that takes two arguments and returns a number. The first argument will be a member of sortedArray, the second argument will be item. If item < member, return value < 0 If item > member, return value > 0

LICENSE

MPL-2.0

Readme

Keywords

Package Sidebar

Install

npm i sortedmap

Weekly Downloads

0

Version

0.0.2

License

MPL-2.0

Unpacked Size

68.3 kB

Total Files

17

Last publish

Collaborators

  • null_radix