Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
json-localizer
Advanced tools
Utility to localize a json object from another json object or a simple API
# localize-json When you need humans to localize a json object from a config file. Typical use case is for a local config file to extend an application config on the fly.
var Localizer = require('localize-json').Localizer;
var localizer = new Localizer(myobj);
localizer.where('path.to.prop').if({'prop': 'hasvalue'}.then({'addthis': 'propandvalue'}));
// `if` is optional
localizer.where('simpleprop').then('setthisvalue');
## API
rules
: path to an object; eg.: prop
, nested.prop
.
Define which object(s) to target.
rules
: object of rules to filter the targeted objects.
Eg.: `{'thisprop': 'hasthisvalue'}
Can be a single flat value instead of an object, and then the targeted key will be checked against this value.
rules
: object of rules to apply on the filtered objects.
Eg.: {sethis: 'propandvalue', {anotherprop: 'tobeset'}}
Can be a single flat value instead of an object, and then the targeted key will be replaced by this value.
Can be a function, which then should return either a flat value or an object. The function will take the current targeted object as parameter.
See tests for more examples.
FAQs
Utility to localize a json object from another json object or a simple API
The npm package json-localizer receives a total of 18 weekly downloads. As such, json-localizer popularity was classified as not popular.
We found that json-localizer 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.