source:
frontend/node_modules/dlv/index.js
| Last change on this file was 9af201e, checked in by , 11 days ago | |
|---|---|
|
|
| File size: 207 bytes | |
| Line | |
|---|---|
| 1 | export default function dlv(obj, key, def, p, undef) { |
| 2 | key = key.split ? key.split('.') : key; |
| 3 | for (p = 0; p < key.length; p++) { |
| 4 | obj = obj ? obj[key[p]] : undef; |
| 5 | } |
| 6 | return obj === undef ? def : obj; |
| 7 | } |
Note:
See TracBrowser
for help on using the repository browser.
