
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
expand-value
Advanced tools
Expand deeply nested values from an object, with support for advanced features.
Expand deeply nested values from an object, with support for advanced features.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install with npm (requires Node.js >=14):
$ npm install --save expand-value
Similar to get-value and dot-prop (and passes all of the get-value unit tests), but supports more complex expressions for accessing deeply nested properties. For example, this library is used by Dry for resolving values in expressions in user-defined templates.
const expand = require('expand-value');
const data = { user: { name: 'Brian' }, key: 'name' };
console.log(expand(data, 'user.name')) //=> 'Brian'
console.log(expand(data, 'user["name"]')) //=> 'Brian'
console.log(expand(data, 'user[key]')) //=> 'Brian'
console.log(expand({ foo: { bar: { baz: 'correct' } } }, 'foo["bar"].baz')); //=> 'correct'
const { parse } = require('expand-value);
const { ast } = parse('a.b.c');
console.log(ast);
// results in
{
type: 'root',
nodes: [
{ type: 'ident', value: 'a' },
{ type: 'separator', value: '.' },
{ type: 'ident', value: 'b' },
{ type: 'separator', value: '.' },
{ type: 'ident', value: 'c' }
]
}
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Jon Schlinkert
Copyright © 2021, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.8.0, on July 20, 2021.
FAQs
Get deeply nested values from an object, like dot-prop and get-value, but with support for advanced features like bracket-notation and more.
The npm package expand-value receives a total of 9 weekly downloads. As such, expand-value popularity was classified as not popular.
We found that expand-value demonstrated a healthy version release cadence and project activity because the last version was released less than 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
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.