Socket
Socket
Sign inDemoInstall

lodash.set

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.set

The modern build of lodash’s `_.set` as a module.


Version published
Maintainers
4
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 01 May 2015

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