Comparing version 1.0.17 to 1.0.18
# Change Log | ||
All notable changes to this project will be documented in this file (keepachangelog.com). | ||
## 1.0.18 - 2016-05-02 | ||
### Added | ||
- Add API usage example for case where value at path is a function and is automatically invoked. | ||
- This is an old feature but I've finally gotten around to adding a usage example. | ||
## 1.0.17 - 2016-05-02 | ||
@@ -5,0 +10,0 @@ ### Fixed |
{ | ||
"name": "selectn", | ||
"description": "Curried property accessor function that resolves deeply-nested object properties via dot/bracket-notation string path while mitigating TypeErrors via friendly and composable API.", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"author": "Wil Moore III <wil.moore@wilmoore.com>", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/wilmoore/selectn.js/issues", |
@@ -137,2 +137,14 @@ # selectn | ||
#### value at path is a function | ||
> Avoid `var fn = data.may.be.a.fn; if (typeof fn === 'function') fn()`. | ||
```js | ||
var selectn = require('selectn') | ||
function hi () { return 'hi' } | ||
var data = { may: { be: { a: { fn: hi } } } } | ||
selectn('may.be.a.fn', data) | ||
//=> 'hi' | ||
``` | ||
## API (partial application) | ||
@@ -139,0 +151,0 @@ |
35703
253