
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
object-resolve-path
Advanced tools
a simple utility function for getting a value at a path from an object with all the usecases properly covered
a simple utility function for getting a value at a path from an object with all the usecases properly covered. Based on Path pseodoclass from https://github.com/Polymer/observe-js/blob/7e94bb14d7c44b221af7bcc874cf9898f26747d8/src/observe.js#L305
npm i object-resolve-path
var resolvePath = require('object-resolve-path');
resolvePath(someObject, 'a.b[0]'); //returns first property from b from a from someObject
resolvePath(someObject, 'a["b-a"][0]'); //this works as well, thanks to the parser/statemachine
Most other libraries for accessing deeply nested properties of an object don't work with bracket syntax. This one does work with bracket syntax.
For thorough description, check the tests.
https://www.npmjs.com/package/lodash.get (works for both but much much slower, doesn't throw when path is not valid, object-resolve-path does)
https://github.com/deoxxa/dotty (works only for dots)
https://github.com/Ntran013/dot-access (works only for dots)
https://github.com/substack/js-traverse (much more complex and useful)
node benchmark.js
lodash.get x 2,088,580 ops/sec ±3.42% (74 runs sampled)
object-resolve-path x 26,260,596 ops/sec ±3.39% (85 runs sampled)
Fastest is object-resolve-path
FAQs
a simple utility function for getting a value at a path from an object with all the usecases properly covered
The npm package object-resolve-path receives a total of 10,633 weekly downloads. As such, object-resolve-path popularity was classified as popular.
We found that object-resolve-path 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.