|
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:
436 bytes
|
| Line | |
|---|
| 1 | var baseGet = require('./_baseGet'),
|
|---|
| 2 | baseSlice = require('./_baseSlice');
|
|---|
| 3 |
|
|---|
| 4 | /**
|
|---|
| 5 | * Gets the parent value at `path` of `object`.
|
|---|
| 6 | *
|
|---|
| 7 | * @private
|
|---|
| 8 | * @param {Object} object The object to query.
|
|---|
| 9 | * @param {Array} path The path to get the parent value of.
|
|---|
| 10 | * @returns {*} Returns the parent value.
|
|---|
| 11 | */
|
|---|
| 12 | function parent(object, path) {
|
|---|
| 13 | return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | module.exports = parent;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.