Socket
Socket
Sign inDemoInstall

libnested

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libnested

basic functions (map, each, get, set, keys) for nested objects.


Version published
Weekly downloads
553
decreased by-7.06%
Maintainers
1
Weekly downloads
 
Created
Source

libnested

basic functions (map, each, get, set, keys) for nested objects.

api

each (object, iter(value, path)) => boolean

iterate over an object (depth first) and call iter with each value. path is an array with one or more items, which is the path to value. value will be any item which is not a {} object. Arrays are treated as values.

if iter returns false then each will stop traversing the object and return false also.

map (object, iter(value, path) => _value) => _object

map over a nested object (depth first). A new object is returned, containing values returned by iter.

paths (object) => [path...]

return an array of paths into an object.

get(object, path) => value

get the value at path within object. if path does not exist in the object, return null.

set(object, path, value)

set value at location path within object. If path is deeper than object goes, intermediate {}'s are added.

License

MIT

FAQs

Package last updated on 22 Nov 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