Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
lodash.set
Advanced tools
The lodash.set package is a method from the Lodash library that allows users to set the value at a given path of an object. It can create nested objects if the path does not exist and can handle array indexes within the path.
Set property value on object
Sets the value of property 'c' to 4 in the object at the path 'a.b.c'.
{"object": {"a": {"b": {"c": 3}}}, "path": "a.b.c", "value": 4}
Create nested objects
Creates a nested structure within the object if it does not exist and sets the value at the specified path.
{"object": {}, "path": "a[0].b.c", "value": 4}
Handle array indexes
Sets the value at a path that includes an array index, modifying the existing array element.
{"object": {"a": [{"b": {"c": 3}}]}, "path": "a[0].b.c", "value": 4}
The dot-prop package allows users to get, set, or delete properties from a nested object using a dot path. Unlike lodash.set, dot-prop does not depend on the full Lodash library and is a smaller package focused on property manipulation.
Deepdash is an extension for Lodash that adds deep object manipulation capabilities. It offers similar functionality to lodash.set but with additional methods for deep traversal and manipulation of objects and arrays.
Object-path is another utility that provides a simple way to get and set deep values in an object using a string path. It is similar to lodash.set but is a standalone package that does not rely on Lodash.
The lodash method _.set
exported as a Node.js module.
Using npm:
$ {sudo -H} npm i -g npm
$ npm i --save lodash.set
In Node.js:
var set = require('lodash.set');
See the documentation or package source for more details.
FAQs
The lodash method `_.set` exported as a module.
The npm package lodash.set receives a total of 1,511,659 weekly downloads. As such, lodash.set popularity was classified as popular.
We found that lodash.set demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.