Version 1
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _assocSet.js
diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/_assocSet.js b/node_modules/grunt-legacy-util/node_modules/lodash/_assocSet.js
new file mode 100644 (file)
index 0000000..524f341
--- /dev/null
@@ -0,0 +1,20 @@
+var assocIndexOf = require('./_assocIndexOf');
+
+/**
+ * Sets the associative array `key` to `value`.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ */
+function assocSet(array, key, value) {
+  var index = assocIndexOf(array, key);
+  if (index < 0) {
+    array.push([key, value]);
+  } else {
+    array[index][1] = value;
+  }
+}
+
+module.exports = assocSet;