524f3418d8f463234109cd4224a80c1b781682ed
[yaffs-website] / node_modules / grunt-legacy-log-utils / node_modules / lodash / _assocSet.js
1 var assocIndexOf = require('./_assocIndexOf');
2
3 /**
4  * Sets the associative array `key` to `value`.
5  *
6  * @private
7  * @param {Array} array The array to modify.
8  * @param {string} key The key of the value to set.
9  * @param {*} value The value to set.
10  */
11 function assocSet(array, key, value) {
12   var index = assocIndexOf(array, key);
13   if (index < 0) {
14     array.push([key, value]);
15   } else {
16     array[index][1] = value;
17   }
18 }
19
20 module.exports = assocSet;