Skip to content

Commit

Permalink
Convert to .map
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellgerber committed Oct 15, 2018
1 parent 91fc696 commit 19027b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<img height="80" width="80" alt="goat" src="https://d1j8pt39hxlh3d.cloudfront.net/development/emojione/4.0/833/14168.svg?1533081835" />

Exception-free nested nullable attribute accessor.
An alternative to [facebookincubator/idx](https://github.com/facebookincubator/idx) in 44 bytes.
An alternative to [facebookincubator/idx](https://github.com/facebookincubator/idx) in 43 bytes.
</div/>

<hr />

## Install
Just copy/paste this function into your project:
``` javascript
var mb=(...p)=>o=>p.reduce((a={},c)=>a[c],o)
var mb=(...p)=>o=>p.map(c=>o=(o||{})[c])&&o
```
Alternatively, you can download [mb.js](https://raw.githubusercontent.com/burakcan/mb/master/mb.js).
Expand Down
2 changes: 1 addition & 1 deletion mb.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var mb=(...p)=>o=>p.reduce((a={},c)=>a[c],o)
var mb=(...p)=>o=>p.map(c=>o=(o||{})[c])&&o

0 comments on commit 19027b0

Please sign in to comment.