package
Utilities that make getting prev/next values in a map easier
npm install map-utilGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Simple set of utilities that make getting the previous or next value in a map easier.
$ npm install [--save] map-util'use strict'
const utils = require('map-util')
const nextVal = utils.nextVal
const prevVal = utils.prevVal
const map = new Map()
map.set('1', '1')
map.set('2', '2')
nextVal('1', map) // => '2'
nextVal('2', map) // => null
// If we want to wrap around:
nextVal('2', map, true) // => '1'
prevVal(
$ npm testEvan Lucas
MIT (See LICENSE for more info)