Socket
Socket
Sign inDemoInstall

getsetdeep

Package Overview
Dependencies
1
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    getsetdeep

Get and set nested variables of an object, includes support for Backbone Models


Version published
Weekly downloads
1.8K
increased by6.73%
Maintainers
1
Install size
38.5 kB
Created
Weekly downloads
 

Changelog

Source

v2.0.0 2013 March 27

  • Split away from bal-util

Readme

Source

Get Set Deep Build Status

Get and set nested variables of an object, includes support for Backbone Models

Install

Backend

  1. Install Node.js
  2. npm install --save getsetdeep

Frontend

  1. See Browserify

Usage

Example

// Import
var getsetdeep = require('getsetdeep')

// Prepare
var obj = {
	a: {
		b: {
			c: 3
		}
	}
}

// Get
getsetdeep.getDeep(obj, 'a.b.c')     // returns 3
getsetdeep.setDeep(obj, 'a.b.c', 4)  // returns 4
getsetdeep.getDeep(obj, 'a.b.c')     // returns 4

Notes

  • setDeep also has a fourth argument called setOnlyIfEmpty which defaults to false, if specified to true then setDeep will only set the value if the current value is null or undefined
  • We also work with Backbone Models (or rather any model that utilizes an attributes object)

History

You can discover the history inside the History.md file

License

Licensed under the incredibly permissive MIT License
Copyright © 2013+ Bevry Pty Ltd
Copyright © 2011-2012 Benjamin Arthur Lupton

Keywords

FAQs

Last updated on 28 Mar 2013

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