New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dot-util

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-util

dot('x') ~= function(obj) { return obj.x }

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

dot-util

Convenient property accessors.

Installation

$ npm install dot-util

$ component install nathan7/dot-util

Example

['the', 'quick', 'brown', 'fox'].map(dot('length')) ~= [3, 5, 5, 3]

[['the', 'quick'], ['brown', 'fox']].map(dot(0).dot('length')) ~= [3, 5]

API

dot(key)

dot('x') ~= function(obj) { return obj.x }
dot(key)(obj) === obj[key]

returns an accessor for key

accessor.dot(key)

dot('x').dot('y') ~= function(obj) { return obj.x.y }``
dot(keyOne).dot(keyTwo)(obj) === obj[keyOne][keyTwo]

returns a composed accessor for key

License

MIT

Keywords

utility

FAQs

Package last updated on 10 Feb 2013

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