|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
518 bytes
|
| Line | |
|---|
| 1 | var _toPath = require('./_toPath.js');
|
|---|
| 2 | var _deepGet = require('./_deepGet.js');
|
|---|
| 3 | var isUndefined = require('./isUndefined.js');
|
|---|
| 4 |
|
|---|
| 5 | // Get the value of the (deep) property on `path` from `object`.
|
|---|
| 6 | // If any property in `path` does not exist or if the value is
|
|---|
| 7 | // `undefined`, return `defaultValue` instead.
|
|---|
| 8 | // The `path` is normalized through `_.toPath`.
|
|---|
| 9 | function get(object, path, defaultValue) {
|
|---|
| 10 | var value = _deepGet(object, _toPath(path));
|
|---|
| 11 | return isUndefined(value) ? defaultValue : value;
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | module.exports = get;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.