Get unlimited public & private packages + team-based management with npm Teams.Learn more »

just-index

2.1.0 • Public • Published

just-index

Part of a library of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.

Try it now

import index from 'just-index';
 
index([{id: 'first', val: 1}, {id: 'second', val: 2}], 'id');
// {first: {id: 'first', val: 1}, second: {id: 'second', val: 2}}
index([{id: 'first', val: 1}, null], 'id'); // {first: {id: 'first', val: 1}}
index([], 'id'); // {}
index([], null); // undefined
index({}, 'id'); // undefined

Install

npm i just-index

DownloadsWeekly Downloads

5

Version

2.1.0

License

MIT

Unpacked Size

2.84 kB

Total Files

4

Last publish

Collaborators

  • avatar