Version 1
[yaffs-website] / node_modules / grunt-legacy-log-utils / node_modules / lodash / _parent.js
diff --git a/node_modules/grunt-legacy-log-utils/node_modules/lodash/_parent.js b/node_modules/grunt-legacy-log-utils/node_modules/lodash/_parent.js
new file mode 100644 (file)
index 0000000..e04ff6e
--- /dev/null
@@ -0,0 +1,16 @@
+var baseSlice = require('./_baseSlice'),
+    get = require('./get');
+
+/**
+ * Gets the parent value at `path` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path to get the parent value of.
+ * @returns {*} Returns the parent value.
+ */
+function parent(object, path) {
+  return path.length == 1 ? object : get(object, baseSlice(path, 0, -1));
+}
+
+module.exports = parent;