Socket
Socket
Sign inDemoInstall

lodash.set

Package Overview
Dependencies
0
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lodash.set

The lodash method `_.set` exported as a module.


Version published
Weekly downloads
1.9M
increased by0.79%
Maintainers
3
Install size
28.7 kB
Created
Weekly downloads
 

Package description

What is lodash.set?

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.

What are lodash.set's main functionalities?

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}

Other packages similar to lodash.set

Readme

Source

lodash.set v4.3.2

The lodash method _.set exported as a Node.js module.

Installation

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.

Keywords

FAQs

Last updated on 13 Aug 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc