
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@blakek/make-lookup
Advanced tools
📒 Make a lookup object from an array of objects
Takes a list of items in an array an changes it to an object for fast access.
Using Yarn:
$ yarn add @blakek/make-lookup
…or using npm:
$ npm i --save @blakek/make-lookup
import { makeLookup } from '@blakek/make-lookup';
const users = [
{ sites: { github: { username: 'blakek' } } },
{ sites: { github: { username: 'gsandf' } } },
{ sites: { github: { username: 'google' } } }
];
const usersByUsername = makeLookup(users, 'sites.github.username');
console.log(usersByUsername.blakek);
// => { sites: { github: { username: 'blakek' } } }
makeLookup
function makeLookup<T>(
inputArray: any[],
lookupProperty: Array<number | string> | string;
): Record<string, T>;
Creates a lookup object for a given array.
lookupProperty
is a path to the property in either dot notation or an array of
path parts. See blakek/deep for details on this path.
Node.js and Yarn are required to work with this project.
To install all dependencies, run:
yarn
yarn build | Builds the project to ./dist |
yarn format | Format the source following the Prettier styles |
yarn test | Run project tests |
yarn test --watch | Run project tests, watching for file changes |
MIT
FAQs
📒 Make a lookup object from an array of objects
We found that @blakek/make-lookup demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.