source: frontend/node_modules/underscore/amd/object.js

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: 581 bytes
Line 
1define(['./_getLength'], function (_getLength) {
2
3 // Converts lists into objects. Pass either a single array of `[key, value]`
4 // pairs, or two parallel arrays of the same length -- one of keys, and one of
5 // the corresponding values. Passing by pairs is the reverse of `_.pairs`.
6 function object(list, values) {
7 var result = {};
8 for (var i = 0, length = _getLength(list); i < length; i++) {
9 if (values) {
10 result[list[i]] = values[i];
11 } else {
12 result[list[i][0]] = list[i][1];
13 }
14 }
15 return result;
16 }
17
18 return object;
19
20});
Note: See TracBrowser for help on using the repository browser.