Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash.set

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.set

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

  • 4.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9M
decreased by-26.93%
Maintainers
3
Weekly downloads
 
Created

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

Keywords

FAQs

Package last updated on 13 Aug 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc