|
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:
497 bytes
|
| Line | |
|---|
| 1 | import toPath from './_toPath.js';
|
|---|
| 2 | import deepGet from './_deepGet.js';
|
|---|
| 3 | import isUndefined from './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 | export default function get(object, path, defaultValue) {
|
|---|
| 10 | var value = deepGet(object, toPath(path));
|
|---|
| 11 | return isUndefined(value) ? defaultValue : value;
|
|---|
| 12 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.