0.1.4 • Published 6 years ago

object-findindex v0.1.4

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

object-findindex

NOTE: object-findindex was renamed to @extra-object/find-key. NPM

Get index of first value in object that satisfies the test, like Array.findIndex().

const findIndex = require('object-findindex');
// findIndex(<object>, <test function>, [this])

findIndex({tesla: 'semi-truck', spacex: 'falcon 9'}, (v) => v.startsWith('falcon'));
// 'spacex'
findIndex({spacex: 'falcon 9', blueorigin: 'new shepard'}, (v, k) => k.indexOf('new')<0);
// 'spacex'
findIndex({pa1: 'LHC', pa2: 'KEKB', pa3: 'RHIC', pa4: 'Tevatron'}, (v, k, obj) => k==='pa'+Object.keys(obj).length);
// 'pa4'
0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago