Socket
Socket
Sign inDemoInstall

dotnot

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dotnot

Access object properties using dot notation.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
4.72 kB
Created
Weekly downloads
 

Readme

Source

dotnot

dotnot on Travis dotnot on NPM dotnot Downloads on NPM Standard JavaScript Style

Access object properties using dot notation.

Install

$ npm install dotnot --save

Use

import {
  get,
  set
} from 'dotnot'

const data = {
  a: {
    b: {
      c: {
        d: 1
      }
    }
  },
  e: 1
}

// get (object, path) -> value
get(data, 'a.b')             // returns { c: { d: 1 } }
get(data, 'a.b.c')           // returns { d: 1 }
get(data, 'a.b.c.d')         // returns 1
get(data, 'a.c')             // returns undefined
get(data, 'a.b.d')           // returns undefined
get(data, 'a.b.c.e')         // returns undefined

// set (object, path, value) -> value
set(data, 'a.c', 1)             // returns 1
set(data, 'a.b.d', 1)           // returns 1
set(data, 'a.b.c.e', 1)         // returns 1

License

MIT. © 2018 Michael Cavalea

FAQs

Last updated on 24 Feb 2018

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