diff --git a/dist/bundle.js b/dist/bundle.js index 2ccdf4b3b1..2812fa36ed 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -17941,6 +17941,21 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) { return baseRandom(lower, upper); } + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + function object (list, values) { + var result = {}; + for (var i = 0, length = list && list.length; i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + } + /*------------------------------------------------------------------------*/ /** @@ -18484,6 +18499,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) { lodash.size = size; lodash.some = some; lodash.uniqueId = uniqueId; + lodash.object = object; // Add aliases. lodash.each = forEach; diff --git a/dist/core.js b/dist/core.js index efbd02986f..09e23aaf52 100644 --- a/dist/core.js +++ b/dist/core.js @@ -17941,6 +17941,21 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) { return baseRandom(lower, upper); } + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + function object (list, values) { + var result = {}; + for (var i = 0, length = list && list.length; i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + } + /*------------------------------------------------------------------------*/ /** @@ -18484,6 +18499,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) { lodash.size = size; lodash.some = some; lodash.uniqueId = uniqueId; + lodash.object = object; // Add aliases. lodash.each = forEach; diff --git a/dist/fineui.js b/dist/fineui.js index 0944c9c3fe..83c3d2b1d2 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -18142,6 +18142,21 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) { return baseRandom(lower, upper); } + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + function object (list, values) { + var result = {}; + for (var i = 0, length = list && list.length; i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + } + /*------------------------------------------------------------------------*/ /** @@ -18685,6 +18700,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) { lodash.size = size; lodash.some = some; lodash.uniqueId = uniqueId; + lodash.object = object; // Add aliases. lodash.each = forEach; diff --git a/lodash.md b/lodash.md index 39afdfc6ac..84bbccfff9 100644 --- a/lodash.md +++ b/lodash.md @@ -1 +1 @@ -lodash core plus=debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random \ No newline at end of file +lodash core plus=debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,object \ No newline at end of file diff --git a/src/core/lodash.js b/src/core/lodash.js index 33ba0bcee5..435bfb4146 100644 --- a/src/core/lodash.js +++ b/src/core/lodash.js @@ -8343,6 +8343,21 @@ return baseRandom(lower, upper); } + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + function object (list, values) { + var result = {}; + for (var i = 0, length = list && list.length; i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + } + /*------------------------------------------------------------------------*/ /** @@ -8886,6 +8901,7 @@ lodash.size = size; lodash.some = some; lodash.uniqueId = uniqueId; + lodash.object = object; // Add aliases. lodash.each = forEach; diff --git a/utils/utils.js b/utils/utils.js index 2f623cbf9e..633713ac3c 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -8343,6 +8343,21 @@ return baseRandom(lower, upper); } + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + function object (list, values) { + var result = {}; + for (var i = 0, length = list && list.length; i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + } + /*------------------------------------------------------------------------*/ /** @@ -8886,6 +8901,7 @@ lodash.size = size; lodash.some = some; lodash.uniqueId = uniqueId; + lodash.object = object; // Add aliases. lodash.each = forEach;