get-key-range
Gets value from object whose key is in a certain range. For range format, see example below or the README for is-in-range. Only positive ranges are allowed.
If the ranges overlap, it will return the first satisfying range in the order given by Object.keys()
.
Installing
npm install get-key-range
Example usage
const get = ; const obj = 5: 'a' '1-10': 'b' '99,100-102': 'c' '200.5': 'd'; // returns 'b' // returns 'a' // returns 'c' // returns 'd' // returns undefined