lodash-rails 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/lodash/rails/version.rb +1 -1
- data/vendor/assets/javascripts/lodash.js +191 -189
- data/vendor/assets/javascripts/lodash.min.js +37 -37
- metadata +2 -2
data/README.md
CHANGED
data/lib/lodash/rails/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* Lo-Dash v0.8.
|
2
|
+
* Lo-Dash v0.8.2 <http://lodash.com>
|
3
3
|
* (c) 2012 John-David Dalton <http://allyoucanleet.com/>
|
4
|
-
* Based on Underscore.js 1.4.
|
4
|
+
* Based on Underscore.js 1.4.2 <http://underscorejs.org>
|
5
5
|
* (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
6
6
|
* Available under MIT license <http://lodash.com/license>
|
7
7
|
*/
|
@@ -71,7 +71,10 @@
|
|
71
71
|
var templateCounter = 0;
|
72
72
|
|
73
73
|
/** Native method shortcuts */
|
74
|
-
var
|
74
|
+
var ceil = Math.ceil,
|
75
|
+
concat = ArrayProto.concat,
|
76
|
+
floor = Math.floor,
|
77
|
+
getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf,
|
75
78
|
hasOwnProperty = ObjectProto.hasOwnProperty,
|
76
79
|
push = ArrayProto.push,
|
77
80
|
propertyIsEnumerable = ObjectProto.propertyIsEnumerable,
|
@@ -80,8 +83,6 @@
|
|
80
83
|
|
81
84
|
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
82
85
|
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
|
83
|
-
nativeFloor = Math.floor,
|
84
|
-
nativeGetPrototypeOf = reNative.test(nativeGetPrototypeOf = Object.getPrototypeOf) && nativeGetPrototypeOf,
|
85
86
|
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
|
86
87
|
nativeIsFinite = window.isFinite,
|
87
88
|
nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys,
|
@@ -235,6 +236,7 @@
|
|
235
236
|
*
|
236
237
|
* @name _
|
237
238
|
* @constructor
|
239
|
+
* @category Chaining
|
238
240
|
* @param {Mixed} value The value to wrap in a `lodash` instance.
|
239
241
|
* @returns {Object} Returns a `lodash` instance.
|
240
242
|
*/
|
@@ -314,7 +316,7 @@
|
|
314
316
|
// the `iteratee` may be reassigned by the `top` snippet
|
315
317
|
'var index, value, iteratee = <%= firstArg %>, ' +
|
316
318
|
// assign the `result` variable an initial value
|
317
|
-
'result
|
319
|
+
'result = <%= init || firstArg %>;\n' +
|
318
320
|
// exit early if the first argument is falsey
|
319
321
|
'if (!<%= firstArg %>) return result;\n' +
|
320
322
|
// add code before the iteration branches
|
@@ -429,7 +431,6 @@
|
|
429
431
|
*/
|
430
432
|
var baseIteratorOptions = {
|
431
433
|
'args': 'collection, callback, thisArg',
|
432
|
-
'init': 'collection',
|
433
434
|
'top': 'callback = createCallback(callback, thisArg)',
|
434
435
|
'inLoop': 'if (callback(value, index, collection) === false) return result'
|
435
436
|
};
|
@@ -454,7 +455,6 @@
|
|
454
455
|
'useHas': false,
|
455
456
|
'useStrict': false,
|
456
457
|
'args': 'object',
|
457
|
-
'init': 'object',
|
458
458
|
'top':
|
459
459
|
'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' +
|
460
460
|
' if (iteratee = arguments[argsIndex]) {',
|
@@ -482,7 +482,7 @@
|
|
482
482
|
|
483
483
|
/** Reusable iterator options for `invoke`, `map`, `pluck`, and `sortBy` */
|
484
484
|
var mapIteratorOptions = {
|
485
|
-
'init':
|
485
|
+
'init': 'collection || []',
|
486
486
|
'beforeLoop': {
|
487
487
|
'array': 'result = Array(length)',
|
488
488
|
'object': 'result = ' + (isKeysFast ? 'Array(length)' : '[]')
|
@@ -531,13 +531,11 @@
|
|
531
531
|
|
532
532
|
if (isLarge) {
|
533
533
|
// init value cache
|
534
|
-
var
|
535
|
-
index = fromIndex - 1;
|
536
|
-
|
534
|
+
var index = fromIndex - 1;
|
537
535
|
while (++index < length) {
|
538
536
|
// manually coerce `value` to string because `hasOwnProperty`, in some
|
539
537
|
// older versions of Firefox, coerces objects incorrectly
|
540
|
-
key = array[index] + '';
|
538
|
+
var key = array[index] + '';
|
541
539
|
(hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
|
542
540
|
}
|
543
541
|
}
|
@@ -666,11 +664,9 @@
|
|
666
664
|
* @private
|
667
665
|
* @param {Object} [options1, options2, ...] The compile options objects.
|
668
666
|
*
|
669
|
-
* useHas - A boolean to specify
|
670
|
-
* in the object loop.
|
667
|
+
* useHas - A boolean to specify using `hasOwnProperty` checks in the object loop.
|
671
668
|
*
|
672
|
-
* useStrict - A boolean to specify
|
673
|
-
* "use strict" directive.
|
669
|
+
* useStrict - A boolean to specify including the "use strict" directive.
|
674
670
|
*
|
675
671
|
* args - A string of comma separated arguments the iteration function will accept.
|
676
672
|
*
|
@@ -690,13 +686,10 @@
|
|
690
686
|
* @returns {Function} Returns the compiled function.
|
691
687
|
*/
|
692
688
|
function createIterator() {
|
693
|
-
var index = -1,
|
694
|
-
length = arguments.length;
|
695
|
-
|
696
|
-
// merge options into a template data object
|
697
689
|
var data = {
|
698
690
|
'bottom': '',
|
699
691
|
'hasDontEnumBug': hasDontEnumBug,
|
692
|
+
'init': '',
|
700
693
|
'isKeysFast': isKeysFast,
|
701
694
|
'noArgsEnum': noArgsEnum,
|
702
695
|
'noCharByIndex': noCharByIndex,
|
@@ -704,12 +697,15 @@
|
|
704
697
|
'top': '',
|
705
698
|
'useHas': true,
|
706
699
|
'useStrict': isStrictFast,
|
707
|
-
'arrayBranch': {},
|
708
|
-
'objectBranch': {}
|
700
|
+
'arrayBranch': { 'beforeLoop': '' },
|
701
|
+
'objectBranch': { 'beforeLoop': '' }
|
709
702
|
};
|
710
703
|
|
711
|
-
|
712
|
-
|
704
|
+
var object,
|
705
|
+
index = -1;
|
706
|
+
|
707
|
+
// merge options into a template data object
|
708
|
+
while (object = arguments[++index]) {
|
713
709
|
for (var prop in object) {
|
714
710
|
var value = object[prop];
|
715
711
|
// keep this regexp explicit for the build pre-process
|
@@ -724,15 +720,9 @@
|
|
724
720
|
}
|
725
721
|
}
|
726
722
|
}
|
727
|
-
// set additional template `data`
|
728
|
-
var args = data.args
|
729
|
-
|
730
|
-
init = data.init;
|
731
|
-
|
732
|
-
data.firstArg = firstArg;
|
733
|
-
data.init = init == null ? firstArg : init;
|
734
|
-
|
735
|
-
if (firstArg != 'collection' || !data.arrayBranch.inLoop) {
|
723
|
+
// set additional template `data` properties
|
724
|
+
var args = data.args;
|
725
|
+
if ((data.firstArg = /^[^,]+/.exec(args)[0]) != 'collection' || !data.arrayBranch.inLoop) {
|
736
726
|
data.arrayBranch = null;
|
737
727
|
}
|
738
728
|
// create the function factory
|
@@ -910,15 +900,15 @@
|
|
910
900
|
* _.isPlainObject({ 'name': 'moe', 'age': 40 });
|
911
901
|
* // => true
|
912
902
|
*/
|
913
|
-
var isPlainObject = !
|
903
|
+
var isPlainObject = !getPrototypeOf ? isPlainFallback : function(value) {
|
914
904
|
if (!(value && typeof value == 'object')) {
|
915
905
|
return false;
|
916
906
|
}
|
917
907
|
var valueOf = value.valueOf,
|
918
|
-
objProto = typeof valueOf == 'function' && (objProto =
|
908
|
+
objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
|
919
909
|
|
920
910
|
return objProto
|
921
|
-
? value == objProto || (
|
911
|
+
? value == objProto || (getPrototypeOf(value) == objProto && !isArguments(value))
|
922
912
|
: isPlainFallback(value);
|
923
913
|
};
|
924
914
|
|
@@ -1065,8 +1055,6 @@
|
|
1065
1055
|
var ctor = value.constructor;
|
1066
1056
|
switch (className) {
|
1067
1057
|
case boolClass:
|
1068
|
-
return new ctor(value == true);
|
1069
|
-
|
1070
1058
|
case dateClass:
|
1071
1059
|
return new ctor(+value);
|
1072
1060
|
|
@@ -1077,7 +1065,6 @@
|
|
1077
1065
|
case regexpClass:
|
1078
1066
|
return ctor(value.source, reFlags.exec(value));
|
1079
1067
|
}
|
1080
|
-
|
1081
1068
|
// check for circular references and return corresponding clone
|
1082
1069
|
stackA || (stackA = []);
|
1083
1070
|
stackB || (stackB = []);
|
@@ -1088,9 +1075,8 @@
|
|
1088
1075
|
return stackB[length];
|
1089
1076
|
}
|
1090
1077
|
}
|
1091
|
-
|
1092
1078
|
// init cloned object
|
1093
|
-
var result = isArr ? ctor(
|
1079
|
+
var result = isArr ? ctor(value.length) : {};
|
1094
1080
|
|
1095
1081
|
// add the source value to the stack of traversed objects
|
1096
1082
|
// and associate it with its clone
|
@@ -1098,16 +1084,10 @@
|
|
1098
1084
|
stackB.push(result);
|
1099
1085
|
|
1100
1086
|
// recursively populate clone (susceptible to call stack limits)
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
}
|
1106
|
-
} else {
|
1107
|
-
forOwn(value, function(objValue, key) {
|
1108
|
-
result[key] = clone(objValue, deep, null, stackA, stackB);
|
1109
|
-
});
|
1110
|
-
}
|
1087
|
+
(isArr ? forEach : forOwn)(value, function(objValue, key) {
|
1088
|
+
result[key] = clone(objValue, deep, null, stackA, stackB);
|
1089
|
+
});
|
1090
|
+
|
1111
1091
|
return result;
|
1112
1092
|
}
|
1113
1093
|
|
@@ -1224,7 +1204,7 @@
|
|
1224
1204
|
'useHas': false,
|
1225
1205
|
'args': 'object',
|
1226
1206
|
'init': '[]',
|
1227
|
-
'inLoop': '
|
1207
|
+
'inLoop': 'isFunction(value) && result.push(index)',
|
1228
1208
|
'bottom': 'result.sort()'
|
1229
1209
|
});
|
1230
1210
|
|
@@ -1691,7 +1671,7 @@
|
|
1691
1671
|
}
|
1692
1672
|
return object && objectTypes[type]
|
1693
1673
|
? nativeKeys(object)
|
1694
|
-
|
1674
|
+
: [];
|
1695
1675
|
};
|
1696
1676
|
|
1697
1677
|
/**
|
@@ -1746,7 +1726,7 @@
|
|
1746
1726
|
' result[index] = stackB[stackLength]\n' +
|
1747
1727
|
' } else {\n' +
|
1748
1728
|
' stackA.push(source);\n' +
|
1749
|
-
' stackB.push(value = (value = result[index]
|
1729
|
+
' stackB.push(value = (value = result[index], isArr)\n' +
|
1750
1730
|
' ? (isArray(value) ? value : [])\n' +
|
1751
1731
|
' : (isPlainObject(value) ? value : {})\n' +
|
1752
1732
|
' );\n' +
|
@@ -1832,11 +1812,11 @@
|
|
1832
1812
|
var pick = createIterator(omitIteratorOptions, {
|
1833
1813
|
'top':
|
1834
1814
|
'if (typeof callback != \'function\') {\n' +
|
1835
|
-
' var
|
1815
|
+
' var index = 0,\n' +
|
1836
1816
|
' props = concat.apply(ArrayProto, arguments),\n' +
|
1837
1817
|
' length = props.length;\n' +
|
1838
|
-
'
|
1839
|
-
' prop = props[index];\n' +
|
1818
|
+
' while (++index < length) {\n' +
|
1819
|
+
' var prop = props[index];\n' +
|
1840
1820
|
' if (prop in object) result[prop] = object[prop]\n' +
|
1841
1821
|
' }\n' +
|
1842
1822
|
'} else {\n' +
|
@@ -1989,7 +1969,7 @@
|
|
1989
1969
|
* // => 2
|
1990
1970
|
*/
|
1991
1971
|
var find = createIterator(baseIteratorOptions, forEachIteratorOptions, {
|
1992
|
-
'init':
|
1972
|
+
'init': 'undefined',
|
1993
1973
|
'inLoop': 'if (callback(value, index, collection)) return value'
|
1994
1974
|
});
|
1995
1975
|
|
@@ -2108,6 +2088,98 @@
|
|
2108
2088
|
*/
|
2109
2089
|
var map = createIterator(baseIteratorOptions, mapIteratorOptions);
|
2110
2090
|
|
2091
|
+
/**
|
2092
|
+
* Retrieves the maximum value of an `array`. If `callback` is passed,
|
2093
|
+
* it will be executed for each value in the `array` to generate the
|
2094
|
+
* criterion by which the value is ranked. The `callback` is bound to
|
2095
|
+
* `thisArg` and invoked with three arguments; (value, index, collection).
|
2096
|
+
*
|
2097
|
+
* @static
|
2098
|
+
* @memberOf _
|
2099
|
+
* @category Collections
|
2100
|
+
* @param {Array} collection The collection to iterate over.
|
2101
|
+
* @param {Function} [callback] The function called per iteration.
|
2102
|
+
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
2103
|
+
* @returns {Mixed} Returns the maximum value.
|
2104
|
+
* @example
|
2105
|
+
*
|
2106
|
+
* var stooges = [
|
2107
|
+
* { 'name': 'moe', 'age': 40 },
|
2108
|
+
* { 'name': 'larry', 'age': 50 },
|
2109
|
+
* { 'name': 'curly', 'age': 60 }
|
2110
|
+
* ];
|
2111
|
+
*
|
2112
|
+
* _.max(stooges, function(stooge) { return stooge.age; });
|
2113
|
+
* // => { 'name': 'curly', 'age': 60 };
|
2114
|
+
*/
|
2115
|
+
function max(collection, callback, thisArg) {
|
2116
|
+
var computed = -Infinity,
|
2117
|
+
index = -1,
|
2118
|
+
length = collection ? collection.length : 0,
|
2119
|
+
result = computed;
|
2120
|
+
|
2121
|
+
if (callback || length !== +length) {
|
2122
|
+
callback = createCallback(callback, thisArg);
|
2123
|
+
forEach(collection, function(value, index, collection) {
|
2124
|
+
var current = callback(value, index, collection);
|
2125
|
+
if (current > computed) {
|
2126
|
+
computed = current;
|
2127
|
+
result = value;
|
2128
|
+
}
|
2129
|
+
});
|
2130
|
+
} else {
|
2131
|
+
while (++index < length) {
|
2132
|
+
if (collection[index] > result) {
|
2133
|
+
result = collection[index];
|
2134
|
+
}
|
2135
|
+
}
|
2136
|
+
}
|
2137
|
+
return result;
|
2138
|
+
}
|
2139
|
+
|
2140
|
+
/**
|
2141
|
+
* Retrieves the minimum value of an `array`. If `callback` is passed,
|
2142
|
+
* it will be executed for each value in the `array` to generate the
|
2143
|
+
* criterion by which the value is ranked. The `callback` is bound to `thisArg`
|
2144
|
+
* and invoked with three arguments; (value, index, collection).
|
2145
|
+
*
|
2146
|
+
* @static
|
2147
|
+
* @memberOf _
|
2148
|
+
* @category Collections
|
2149
|
+
* @param {Array} collection The collection to iterate over.
|
2150
|
+
* @param {Function} [callback] The function called per iteration.
|
2151
|
+
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
2152
|
+
* @returns {Mixed} Returns the minimum value.
|
2153
|
+
* @example
|
2154
|
+
*
|
2155
|
+
* _.min([10, 5, 100, 2, 1000]);
|
2156
|
+
* // => 2
|
2157
|
+
*/
|
2158
|
+
function min(collection, callback, thisArg) {
|
2159
|
+
var computed = Infinity,
|
2160
|
+
index = -1,
|
2161
|
+
length = collection ? collection.length : 0,
|
2162
|
+
result = computed;
|
2163
|
+
|
2164
|
+
if (callback || length !== +length) {
|
2165
|
+
callback = createCallback(callback, thisArg);
|
2166
|
+
forEach(collection, function(value, index, collection) {
|
2167
|
+
var current = callback(value, index, collection);
|
2168
|
+
if (current < computed) {
|
2169
|
+
computed = current;
|
2170
|
+
result = value;
|
2171
|
+
}
|
2172
|
+
});
|
2173
|
+
} else {
|
2174
|
+
while (++index < length) {
|
2175
|
+
if (collection[index] < result) {
|
2176
|
+
result = collection[index];
|
2177
|
+
}
|
2178
|
+
}
|
2179
|
+
}
|
2180
|
+
return result;
|
2181
|
+
}
|
2182
|
+
|
2111
2183
|
/**
|
2112
2184
|
* Retrieves the value of a specified property from all elements in
|
2113
2185
|
* the `collection`.
|
@@ -2235,6 +2307,32 @@
|
|
2235
2307
|
'inLoop': '!' + filterIteratorOptions.inLoop
|
2236
2308
|
});
|
2237
2309
|
|
2310
|
+
/**
|
2311
|
+
* Creates an array of shuffled `array` values, using a version of the
|
2312
|
+
* Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
|
2313
|
+
*
|
2314
|
+
* @static
|
2315
|
+
* @memberOf _
|
2316
|
+
* @category Collections
|
2317
|
+
* @param {Array} collection The collection to shuffle.
|
2318
|
+
* @returns {Array} Returns a new shuffled collection.
|
2319
|
+
* @example
|
2320
|
+
*
|
2321
|
+
* _.shuffle([1, 2, 3, 4, 5, 6]);
|
2322
|
+
* // => [4, 1, 6, 3, 5, 2]
|
2323
|
+
*/
|
2324
|
+
function shuffle(collection) {
|
2325
|
+
var index = -1,
|
2326
|
+
result = Array(collection ? collection.length : 0);
|
2327
|
+
|
2328
|
+
forEach(collection, function(value) {
|
2329
|
+
var rand = floor(nativeRandom() * (++index + 1));
|
2330
|
+
result[index] = result[rand];
|
2331
|
+
result[rand] = value;
|
2332
|
+
});
|
2333
|
+
return result;
|
2334
|
+
}
|
2335
|
+
|
2238
2336
|
/**
|
2239
2337
|
* Gets the size of the `collection` by returning `collection.length` for arrays
|
2240
2338
|
* and array-like objects or the number of own enumerable properties for objects.
|
@@ -2387,8 +2485,8 @@
|
|
2387
2485
|
'forIn(properties, function(value, prop) { props.push(prop) });\n' +
|
2388
2486
|
'var propsLength = props.length',
|
2389
2487
|
'inLoop':
|
2390
|
-
'for (var
|
2391
|
-
' prop = props[propIndex];\n' +
|
2488
|
+
'for (var pass = true, propIndex = 0; propIndex < propsLength; propIndex++) {\n' +
|
2489
|
+
' var prop = props[propIndex];\n' +
|
2392
2490
|
' if (!(pass = value[prop] === properties[prop])) break\n' +
|
2393
2491
|
'}\n' +
|
2394
2492
|
'pass && result.push(value)'
|
@@ -2416,8 +2514,9 @@
|
|
2416
2514
|
result = [];
|
2417
2515
|
|
2418
2516
|
while (++index < length) {
|
2419
|
-
|
2420
|
-
|
2517
|
+
var value = array[index];
|
2518
|
+
if (value) {
|
2519
|
+
result.push(value);
|
2421
2520
|
}
|
2422
2521
|
}
|
2423
2522
|
return result;
|
@@ -2502,13 +2601,12 @@
|
|
2502
2601
|
* // => [1, 2, 3, [[4]]];
|
2503
2602
|
*/
|
2504
2603
|
function flatten(array, shallow) {
|
2505
|
-
var
|
2506
|
-
index = -1,
|
2604
|
+
var index = -1,
|
2507
2605
|
length = array ? array.length : 0,
|
2508
2606
|
result = [];
|
2509
2607
|
|
2510
2608
|
while (++index < length) {
|
2511
|
-
value = array[index];
|
2609
|
+
var value = array[index];
|
2512
2610
|
|
2513
2611
|
// recursively flatten arrays (susceptible to call stack limits)
|
2514
2612
|
if (isArray(value)) {
|
@@ -2523,7 +2621,7 @@
|
|
2523
2621
|
/**
|
2524
2622
|
* Gets the index at which the first occurrence of `value` is found using
|
2525
2623
|
* strict equality for comparisons, i.e. `===`. If the `array` is already
|
2526
|
-
* sorted, passing `true` for `
|
2624
|
+
* sorted, passing `true` for `fromIndex` will run a faster binary search.
|
2527
2625
|
*
|
2528
2626
|
* @static
|
2529
2627
|
* @memberOf _
|
@@ -2678,84 +2776,6 @@
|
|
2678
2776
|
return -1;
|
2679
2777
|
}
|
2680
2778
|
|
2681
|
-
/**
|
2682
|
-
* Retrieves the maximum value of an `array`. If `callback` is passed,
|
2683
|
-
* it will be executed for each value in the `array` to generate the
|
2684
|
-
* criterion by which the value is ranked. The `callback` is bound to
|
2685
|
-
* `thisArg` and invoked with three arguments; (value, index, array).
|
2686
|
-
*
|
2687
|
-
* @static
|
2688
|
-
* @memberOf _
|
2689
|
-
* @category Arrays
|
2690
|
-
* @param {Array} array The array to iterate over.
|
2691
|
-
* @param {Function} [callback] The function called per iteration.
|
2692
|
-
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
2693
|
-
* @returns {Mixed} Returns the maximum value.
|
2694
|
-
* @example
|
2695
|
-
*
|
2696
|
-
* var stooges = [
|
2697
|
-
* { 'name': 'moe', 'age': 40 },
|
2698
|
-
* { 'name': 'larry', 'age': 50 },
|
2699
|
-
* { 'name': 'curly', 'age': 60 }
|
2700
|
-
* ];
|
2701
|
-
*
|
2702
|
-
* _.max(stooges, function(stooge) { return stooge.age; });
|
2703
|
-
* // => { 'name': 'curly', 'age': 60 };
|
2704
|
-
*/
|
2705
|
-
function max(array, callback, thisArg) {
|
2706
|
-
var current,
|
2707
|
-
computed = -Infinity,
|
2708
|
-
index = -1,
|
2709
|
-
length = array ? array.length : 0,
|
2710
|
-
result = computed;
|
2711
|
-
|
2712
|
-
callback = createCallback(callback, thisArg);
|
2713
|
-
while (++index < length) {
|
2714
|
-
current = callback(array[index], index, array);
|
2715
|
-
if (current > computed) {
|
2716
|
-
computed = current;
|
2717
|
-
result = array[index];
|
2718
|
-
}
|
2719
|
-
}
|
2720
|
-
return result;
|
2721
|
-
}
|
2722
|
-
|
2723
|
-
/**
|
2724
|
-
* Retrieves the minimum value of an `array`. If `callback` is passed,
|
2725
|
-
* it will be executed for each value in the `array` to generate the
|
2726
|
-
* criterion by which the value is ranked. The `callback` is bound to `thisArg`
|
2727
|
-
* and invoked with three arguments; (value, index, array).
|
2728
|
-
*
|
2729
|
-
* @static
|
2730
|
-
* @memberOf _
|
2731
|
-
* @category Arrays
|
2732
|
-
* @param {Array} array The array to iterate over.
|
2733
|
-
* @param {Function} [callback] The function called per iteration.
|
2734
|
-
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
2735
|
-
* @returns {Mixed} Returns the minimum value.
|
2736
|
-
* @example
|
2737
|
-
*
|
2738
|
-
* _.min([10, 5, 100, 2, 1000]);
|
2739
|
-
* // => 2
|
2740
|
-
*/
|
2741
|
-
function min(array, callback, thisArg) {
|
2742
|
-
var current,
|
2743
|
-
computed = Infinity,
|
2744
|
-
index = -1,
|
2745
|
-
length = array ? array.length : 0,
|
2746
|
-
result = computed;
|
2747
|
-
|
2748
|
-
callback = createCallback(callback, thisArg);
|
2749
|
-
while (++index < length) {
|
2750
|
-
current = callback(array[index], index, array);
|
2751
|
-
if (current < computed) {
|
2752
|
-
computed = current;
|
2753
|
-
result = array[index];
|
2754
|
-
}
|
2755
|
-
}
|
2756
|
-
return result;
|
2757
|
-
}
|
2758
|
-
|
2759
2779
|
/**
|
2760
2780
|
* Creates an object composed from arrays of `keys` and `values`. Pass either
|
2761
2781
|
* a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or
|
@@ -2779,10 +2799,11 @@
|
|
2779
2799
|
result = {};
|
2780
2800
|
|
2781
2801
|
while (++index < length) {
|
2802
|
+
var key = keys[index];
|
2782
2803
|
if (values) {
|
2783
|
-
result[
|
2804
|
+
result[key] = values[index];
|
2784
2805
|
} else {
|
2785
|
-
result[
|
2806
|
+
result[key[0]] = key[1];
|
2786
2807
|
}
|
2787
2808
|
}
|
2788
2809
|
return result;
|
@@ -2828,7 +2849,7 @@
|
|
2828
2849
|
// use `Array(length)` so V8 will avoid the slower "dictionary" mode
|
2829
2850
|
// http://www.youtube.com/watch?v=XAqIpGU8ZZk#t=16m27s
|
2830
2851
|
var index = -1,
|
2831
|
-
length = nativeMax(0,
|
2852
|
+
length = nativeMax(0, ceil((end - start) / step)),
|
2832
2853
|
result = Array(length);
|
2833
2854
|
|
2834
2855
|
while (++index < length) {
|
@@ -2862,33 +2883,6 @@
|
|
2862
2883
|
: [];
|
2863
2884
|
}
|
2864
2885
|
|
2865
|
-
/**
|
2866
|
-
* Creates an array of shuffled `array` values, using a version of the
|
2867
|
-
* Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
|
2868
|
-
*
|
2869
|
-
* @static
|
2870
|
-
* @memberOf _
|
2871
|
-
* @category Arrays
|
2872
|
-
* @param {Array} array The array to shuffle.
|
2873
|
-
* @returns {Array} Returns a new shuffled array.
|
2874
|
-
* @example
|
2875
|
-
*
|
2876
|
-
* _.shuffle([1, 2, 3, 4, 5, 6]);
|
2877
|
-
* // => [4, 1, 6, 3, 5, 2]
|
2878
|
-
*/
|
2879
|
-
function shuffle(array) {
|
2880
|
-
var index = -1,
|
2881
|
-
length = array ? array.length : 0,
|
2882
|
-
result = Array(length);
|
2883
|
-
|
2884
|
-
while (++index < length) {
|
2885
|
-
var rand = nativeFloor(nativeRandom() * (index + 1));
|
2886
|
-
result[index] = result[rand];
|
2887
|
-
result[rand] = array[index];
|
2888
|
-
}
|
2889
|
-
return result;
|
2890
|
-
}
|
2891
|
-
|
2892
2886
|
/**
|
2893
2887
|
* Uses a binary search to determine the smallest index at which the `value`
|
2894
2888
|
* should be inserted into `array` in order to maintain the sort order of the
|
@@ -2933,11 +2927,18 @@
|
|
2933
2927
|
var low = 0,
|
2934
2928
|
high = array ? array.length : low;
|
2935
2929
|
|
2936
|
-
|
2937
|
-
|
2938
|
-
|
2939
|
-
|
2940
|
-
|
2930
|
+
if (callback) {
|
2931
|
+
callback = createCallback(callback, thisArg);
|
2932
|
+
value = callback(value);
|
2933
|
+
while (low < high) {
|
2934
|
+
var mid = (low + high) >>> 1;
|
2935
|
+
callback(array[mid]) < value ? low = mid + 1 : high = mid;
|
2936
|
+
}
|
2937
|
+
} else {
|
2938
|
+
while (low < high) {
|
2939
|
+
var mid = (low + high) >>> 1;
|
2940
|
+
array[mid] < value ? low = mid + 1 : high = mid;
|
2941
|
+
}
|
2941
2942
|
}
|
2942
2943
|
return low;
|
2943
2944
|
}
|
@@ -2964,8 +2965,9 @@
|
|
2964
2965
|
result = [];
|
2965
2966
|
|
2966
2967
|
while (++index < length) {
|
2967
|
-
|
2968
|
-
|
2968
|
+
var value = flattened[index];
|
2969
|
+
if (indexOf(result, value) < 0) {
|
2970
|
+
result.push(value);
|
2969
2971
|
}
|
2970
2972
|
}
|
2971
2973
|
return result;
|
@@ -3174,17 +3176,16 @@
|
|
3174
3176
|
'args': 'object',
|
3175
3177
|
'top':
|
3176
3178
|
'var funcs = arguments,\n' +
|
3179
|
+
' index = 0,\n' +
|
3177
3180
|
' length = funcs.length;\n' +
|
3178
3181
|
'if (length > 1) {\n' +
|
3179
|
-
'
|
3182
|
+
' while (++index < length) {\n' +
|
3180
3183
|
' result[funcs[index]] = bind(result[funcs[index]], result)\n' +
|
3181
3184
|
' }\n' +
|
3182
3185
|
' return result\n' +
|
3183
3186
|
'}',
|
3184
3187
|
'inLoop':
|
3185
|
-
'if (isFunction(value))
|
3186
|
-
' result[index] = bind(value, result)\n' +
|
3187
|
-
'}'
|
3188
|
+
'if (isFunction(value)) result[index] = bind(value, result)'
|
3188
3189
|
});
|
3189
3190
|
|
3190
3191
|
/**
|
@@ -3467,6 +3468,7 @@
|
|
3467
3468
|
thisArg = this;
|
3468
3469
|
|
3469
3470
|
if (remain <= 0) {
|
3471
|
+
clearTimeout(timeoutId);
|
3470
3472
|
lastCalled = now;
|
3471
3473
|
result = func.apply(thisArg, args);
|
3472
3474
|
}
|
@@ -3632,7 +3634,7 @@
|
|
3632
3634
|
max = min;
|
3633
3635
|
min = 0;
|
3634
3636
|
}
|
3635
|
-
return min +
|
3637
|
+
return min + floor(nativeRandom() * ((+max || 0) - min + 1));
|
3636
3638
|
}
|
3637
3639
|
|
3638
3640
|
/**
|
@@ -3737,7 +3739,7 @@
|
|
3737
3739
|
// http://ejohn.org/blog/javascript-micro-templating/
|
3738
3740
|
// and Laura Doktorova's doT.js
|
3739
3741
|
// https://github.com/olado/doT
|
3740
|
-
text
|
3742
|
+
text || (text = '');
|
3741
3743
|
options || (options = {});
|
3742
3744
|
|
3743
3745
|
var isEvaluating,
|
@@ -3999,7 +4001,7 @@
|
|
3999
4001
|
* @memberOf _
|
4000
4002
|
* @type String
|
4001
4003
|
*/
|
4002
|
-
lodash.VERSION = '0.8.
|
4004
|
+
lodash.VERSION = '0.8.2';
|
4003
4005
|
|
4004
4006
|
// assign static methods
|
4005
4007
|
lodash.after = after;
|
@@ -1,39 +1,39 @@
|
|
1
1
|
/*!
|
2
|
-
Lo-Dash 0.8.
|
3
|
-
Underscore.js 1.4.
|
2
|
+
Lo-Dash 0.8.2 lodash.com/license
|
3
|
+
Underscore.js 1.4.2 underscorejs.org/LICENSE
|
4
4
|
*/
|
5
|
-
;(function(e,t){function s(e){if(e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||H),s=i?{}:e;if(i)for(
|
6
|
-
,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
r||n?e[0]:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
,"\
|
21
|
-
|
22
|
-
e)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+
|
34
|
-
,s.
|
35
|
-
(f="obj",r?a="with("+f+"){"+a+"}":(n=RegExp("(\\(\\s*)"+f+"\\."+f+"\\b","g"),a=a.replace(z,"$&"+f+".").replace(n,"$1__d"))),a=(r?a.replace(I,""):a).replace(q,"$1").replace(R,"$1;"),a="function("+f+"){"+(l?"":f+"||("+f+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+f+"."+f+"||"+f)+";")+a+"return __p}";try{i=Function("_","return "+a)(s)}catch(h){throw h.source=a,h}return t?i(t):(i.source=
|
36
|
-
){function n(){a=new Date,u=r,s=e.apply(o,i)}var i,s,o,u,a=0;return function(){var r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(a=r,s=e.apply(o,i)):u||(u=
|
37
|
-
,arguments),n=t.length,r=[];++e<n;)0>
|
38
|
-
|
39
|
-
.__chain__=n),e}}),
|
5
|
+
;(function(e,t){function s(e){if(e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||H),s=i?{}:e;if(i)for(n=t-1;++n<r;){var o=e[n]+"";(Z.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(e){if(i){var n=e+"";return Z.call(s,n)&&-1<T(s[n],e)}return-1<T(s,e,t)}}function u(e,n){var r=e.b,i=n.b,e=e.a,n=n.a;if(e!==n){if(e>n||e===t)return 1;if(e<n||n===t)return-1}return r<i?-1:1}function a(e,t,n){function r(){var u=arguments
|
6
|
+
,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(nt.call(u)):n),this instanceof r?(p.prototype=e.prototype,a=new p,(u=e.apply(a,u))&&Ht[typeof u]?u:a):e.apply(a,u)}var i=m(e),s=!n,o=e;return s&&(n=t),r}function f(e,n){return e?"function"!=typeof e?function(t){return t[e]}:n!==t?function(t,r,i){return e.call(n,t,r,i)}:e:A}function l(){for(var e={e:"",g:Et,i:"",j:Mt,m:Tt,n:kt,o:J,p:"",q:n,r:_t,c:{d:""},l:{d:""}},t,i=-1;t=arguments[++i];)for(var s in t){var o=t[s];/d|h/.test(s)?("string"==typeof
|
7
|
+
o&&(o={b:o,k:o}),e.c[s]=o.b,e.l[s]=o.k):e[s]=o}t=e.a;if("d"!=(e.f=/^[^,]+/.exec(t)[0])||!e.c.h)e.c=r;i="",e.r&&(i+="'use strict';"),i+="var i,A,j="+e.f+",t="+(e.i||e.f)+";if(!"+e.f+")return t;"+e.p+";",e.c&&(i+="var k=j.length;i=-1;",e.l&&(i+="if(k===+k){"),e.n&&(i+="if(y.call(j)==w){j=j.split('')}"),i+=e.c.d+";while(++i<k){A=j[i];"+e.c.h+"}",e.l&&(i+="}"));if(e.l){e.c?i+="else {":e.m&&(i+="var k=j.length;i=-1;if(k&&O(j)){while(++i<k){A=j[i+=''];"+e.l.h+"}}else {"),e.g||(i+="var u=typeof j=='function'&&q.call(j,'prototype');"
|
8
|
+
);if(e.j&&e.q)i+="var n=-1,o=Y[typeof j]?l(j):[],k=o.length;"+e.l.d+";while(++n<k){i=o[n];",e.g||(i+="if(!(u&&i=='prototype')){"),i+="A=j[i];"+e.l.h+"",e.g||(i+="}");else{i+=e.l.d+";for(i in j){";if(!e.g||e.q)i+="if(",e.g||(i+="!(u&&i=='prototype')"),!e.g&&e.q&&(i+="&&"),e.q&&(i+="h.call(j,i)"),i+="){";i+="A=j[i];"+e.l.h+";";if(!e.g||e.q)i+="}"}i+="}";if(e.g){i+="var g=j.constructor;";for(s=0;7>s;s++)i+="i='"+e.o[s]+"';if(","constructor"==e.o[s]&&(i+="!(g&&g.prototype===j)&&"),i+="h.call(j,i)){A=j[i];"+
|
9
|
+
e.l.h+"}"}if(e.c||e.m)i+="}"}return i+=e.e+";return t",Function("D,E,F,I,e,f,J,h,M,O,Q,S,T,X,Y,l,q,v,w,y,z","var G=function("+t+"){"+i+"};return G")(Dt,_,L,u,Q,f,en,Z,T,v,$t,m,Jt,mt,Ht,ut,tt,nt,yt,rt)}function c(e){return"\\"+Bt[e]}function h(e){return Qt[e]}function p(){}function d(e){return Gt[e]}function v(e){return rt.call(e)==ct}function m(e){return"function"==typeof e}function g(e){var t=i;if(!e||"object"!=typeof e||v(e))return t;var n=e.constructor;return(!Lt||"function"==typeof e.toString||"string"!=typeof
|
10
|
+
(e+""))&&(!m(n)||n instanceof n)?xt?(en(e,function(e,n,r){return t=!Z.call(r,n),i}),t===i):(en(e,function(e,n){t=n}),t===i||Z.call(e,t)):t}function y(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=Ht[typeof e]){var u=rt.call(e);if(!Pt[u]||Nt&&v(e))return e;var a=u==ht,n=a||(u==mt?Jt(e):n)}if(!n||!t)return n?a?nt.call(e):Zt({},e):e;n=e.constructor;switch(u){case pt:case dt:return new n(+e);case vt:case yt:return new n(e);case gt:return n(e.source,U.exec(e))}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[
|
11
|
+
u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?mn:tn)(e,function(e,n){f[n]=y(e,t,r,s,o)}),f}function b(e,t,s,o){if(e==r||t==r)return e===t;if(e===t)return 0!==e||1/e==1/t;if(Ht[typeof e]||Ht[typeof t])e=e.__wrapped__||e,t=t.__wrapped__||t;var u=rt.call(e);if(u!=rt.call(t))return i;switch(u){case pt:case dt:return+e==+t;case vt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case gt:case yt:return e==t+""}var a=Dt[u];if(Nt&&!a&&(a=v(e))&&!v(t)||!a&&(u!=mt||Lt&&("function"!=typeof e.
|
12
|
+
toString&&"string"==typeof (e+"")||"function"!=typeof t.toString&&"string"==typeof (t+""))))return i;s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var u=-1,f=n,l=0;s.push(e),o.push(t);if(a){l=e.length;if(f=l==t.length)for(;l--&&(f=b(e[l],t[l],s,o)););return f}a=e.constructor,f=t.constructor;if(a!=f&&(!m(a)||!(a instanceof a&&m(f)&&f instanceof f)))return i;for(var c in e)if(Z.call(e,c)&&(l++,!Z.call(t,c)||!b(e[c],t[c],s,o)))return i;for(c in t)if(Z.call(t,c)&&!(l--))return i;if(
|
13
|
+
Et)for(;7>++u;)if(c=J[u],Z.call(e,c)&&(!Z.call(t,c)||!b(e[c],t[c],s,o)))return i;return n}function w(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+s)t=f(t,n),mn(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,o=e)});else for(;++i<s;)e[i]>o&&(o=e[i]);return o}function E(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if(o!==+o)var a=sn(e),o=a.length;else kt&&rt.call(e)==yt&&(s=e.split(""));return mn(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function S(e,t,n){
|
14
|
+
if(e)return t==r||n?e[0]:nt.call(e,0,t)}function x(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];$t(s)?et.apply(i,t?s:x(s)):i.push(s)}return i}function T(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?at(0,i+n):n||0)-1;else if(n)return r=C(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function N(e,t,n){return e?nt.call(e,t==r||n?1:t):[]}function C(e,t,n,r){var i=0,s=e?e.length:i;if(n){n=f(n,r);for(t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r}else for(;i<s;)r=i+
|
15
|
+
s>>>1,e[r]<t?i=r+1:s=r;return i}function k(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n=f(n,r);++s<o;)if(r=n(e[s],s,e),t?!s||a[a.length-1]!==r:0>T(a,r))a.push(r),u.push(e[s]);return u}function L(e,t){return Ot||it&&2<arguments.length?it.call.apply(it,arguments):a(e,t,nt.call(arguments,2))}function A(e){return e}function O(e){mn(nn(e),function(t){var r=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return arguments.length&&et.apply(e,arguments)
|
16
|
+
,e=r.apply(s,e),this.__chain__&&(e=new s(e),e.__chain__=n),e}})}var n=!0,r=null,i=!1,M="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),_=Array.prototype,D=Object.prototype,P=0,H=30,B=e._,j=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,F=/&(?:amp|lt|gt|quot|#x27);/g,I=/\b__p\+='';/g,q=/\b(__p\+=)''\+/g,R=/(__e\(.*?\)|\b__t\))\+'';/g,U=/\w*$/,z=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,W=RegExp("^"+(D.valueOf+""
|
17
|
+
).replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),X=/($^)/,V=/[&<>"']/g,$=/['\n\r\t\u2028\u2029\\]/g,J="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),K=Math.ceil,Q=_.concat,G=Math.floor,Y=W.test(Y=Object.getPrototypeOf)&&Y,Z=D.hasOwnProperty,et=_.push,tt=D.propertyIsEnumerable,nt=_.slice,rt=D.toString,it=W.test(it=nt.bind)&&it,st=W.test(st=Array.isArray)&&st,ot=e.isFinite,ut=W.test(ut=Object.keys)&&ut
|
18
|
+
,at=Math.max,ft=Math.min,lt=Math.random,ct="[object Arguments]",ht="[object Array]",pt="[object Boolean]",dt="[object Date]",vt="[object Number]",mt="[object Object]",gt="[object RegExp]",yt="[object String]",bt=e.clearTimeout,wt=e.setTimeout,Et,St,xt,Tt=n;(function(){function e(){this.x=1}var t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);for(r in arguments)Tt=!r;Et=4>(n+"").length,xt="x"!=n[0],St=(n.splice.call(t,0,1),t[0])})(1);var Nt=!v(arguments),Ct="x"!=nt.call("x"
|
19
|
+
)[0],kt="xx"!="x"[0]+Object("x")[0];try{var Lt=("[object Object]",rt.call(e.document||0)==mt)}catch(At){}var Ot=it&&/\n|Opera/.test(it+rt.call(e.opera)),Mt=ut&&/^.+$|true/.test(ut+!!e.attachEvent),_t=!Ot,Dt={};Dt[pt]=Dt[dt]=Dt["[object Function]"]=Dt[vt]=Dt[mt]=Dt[gt]=i,Dt[ct]=Dt[ht]=Dt[yt]=n;var Pt={};Pt[ct]=Pt["[object Function]"]=i,Pt[ht]=Pt[pt]=Pt[dt]=Pt[vt]=Pt[mt]=Pt[gt]=Pt[yt]=n;var Ht={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Bt={"\\":"\\","'":"'","\n":"n"
|
20
|
+
,"\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var jt={a:"d,c,x",p:"c=f(c,x)",h:"if(c(A,i,d)===false)return t"},Ft={i:"{}",p:"c=f(c,x)",h:"var p=c(A,i,d);(h.call(t,p)?t[p]++:t[p]=1)"},It={i:"true",h:"if(!c(A,i,d))return!t"},qt={q:i,r:i,a:"m",p:"for(var a=1,b=arguments.length;a<b;a++){if(j=arguments[a]){",h:"t[i]=A",e:"}}"},Rt={i:"[]",h:"c(A,i,d)&&t.push(A)"},Ut={p:"c=f(c,x)"}
|
21
|
+
,zt={h:{k:jt.h}},Wt={i:"d||[]",d:{b:"t=Array(k)",k:"t="+(Mt?"Array(k)":"[]")},h:{b:"t[i]=c(A,i,d)",k:"t"+(Mt?"[n]=":".push")+"(c(A,i,d))"}},Xt={q:i,a:"m,c,x",i:"{}",p:"var R=typeof c=='function';if(R)c=f(c,x);else var s=e.apply(E,arguments)",h:"if(R?!c(A,i,m):M(s,i)<0)t[i]=A"},Vt=l({a:"m",i:"{}",h:"t[A]=i"});Nt&&(v=function(e){return e?Z.call(e,"callee"):i});var $t=st||function(e){return rt.call(e)==ht};m(/x/)&&(m=function(e){return"[object Function]"==rt.call(e)});var Jt=Y?function(e){if(!e||"object"!=typeof
|
22
|
+
e)return i;var t=e.valueOf,n="function"==typeof t&&(n=Y(t))&&Y(n);return n?e==n||Y(e)==n&&!v(e):g(e)}:g,Kt=l({a:"m",i:"[]",h:"t.push(i)"}),Qt={"&":"&","<":"<",">":">",'"':""","'":"'"},Gt=Vt(Qt),Yt=l(qt,{h:"if(t[i]==null)"+qt.h}),Zt=l(qt),en=l(jt,Ut,zt,{q:i}),tn=l(jt,Ut,zt),nn=l({q:i,a:"m",i:"[]",h:"S(A)&&t.push(i)",e:"t.sort()"}),rn=l({a:"A",i:"true",p:"var H=y.call(A),k=A.length;if(D[H]"+(Nt?"||O(A)":"")+"||(H==X&&k===+k&&S(A.splice)))return!k",h:{k:"return false"}}),sn=ut?function(
|
23
|
+
e){var t=typeof e;return"function"==t&&tt.call(e,"prototype")?Kt(e):e&&Ht[t]?ut(e):[]}:Kt,on=l(qt,{a:"m,dd,N",p:"var P,C=arguments,a=0;if(N==I){var b=2,ee=C[3],ff=C[4]}else var b=C.length,ee=[],ff=[];while(++a<b){if(j=C[a]){",h:"if((dd=A)&&((P=Q(dd))||T(dd))){var K=false,gg=ee.length;while(gg--)if(K=ee[gg]==dd)break;if(K){t[i]=ff[gg]}else {ee.push(dd);ff.push(A=(A=t[i],P)?(Q(A)?A:[]):(T(A)?A:{}));t[i]=G(A,dd,I,ee,ff)}}else if(dd!=null)t[i]=dd"}),un=l(Xt),an=l({a:"m",i:"[]",h:"t"+(Mt?"[n]=":".push"
|
24
|
+
)+"([i,A])"}),fn=l(Xt,{p:"if(typeof c!='function'){var i=0,s=e.apply(E,arguments),k=s.length;while(++i<k){var p=s[i];if(p in m)t[p]=m[p]}}else {c=f(c,x)",h:"if(c(A,i,m))t[i]=A",e:"}"}),ln=l({a:"m",i:"[]",h:"t.push(A)"}),cn=l({a:"d,hh",i:"false",n:i,d:{b:"if(y.call(d)==w)return d.indexOf(hh)>-1"},h:"if(A===hh)return true"}),hn=l(jt,Ft),pn=l(jt,It),dn=l(jt,Rt),vn=l(jt,Ut,{i:"z",h:"if(c(A,i,d))return A"}),mn=l(jt,Ut),gn=l(jt,Ft,{h:"var p=c(A,i,d);(h.call(t,p)?t[p]:t[p]=[]).push(A)"}),yn=l(Wt,{a:"d,U"
|
25
|
+
,p:"var C=v.call(arguments,2),R=typeof U=='function'",h:{b:"t[i]=(R?U:A[U]).apply(A,C)",k:"t"+(Mt?"[n]=":".push")+"((R?U:A[U]).apply(A,C))"}}),bn=l(jt,Wt),wn=l(Wt,{a:"d,bb",h:{b:"t[i]=A[bb]",k:"t"+(Mt?"[n]=":".push")+"(A[bb])"}}),En=l({a:"d,c,B,x",i:"B",p:"var V=arguments.length<3;c=f(c,x)",d:{b:"if(V)t=j[++i]"},h:{b:"t=c(t,A,i,d)",k:"t=V?(V=false,A):c(t,A,i,d)"}}),Sn=l(jt,Rt,{h:"!"+Rt.h}),xn=l(jt,It,{i:"false",h:It.h.replace("!","")}),Tn=l(jt,Ft,Wt,{h:{b:"t[i]={a:c(A,i,d),b:i,c:A}",k:"t"+(Mt?"[n]="
|
26
|
+
:".push")+"({a:c(A,i,d),b:i,c:A})"},e:"t.sort(I);k=t.length;while(k--)t[k]=t[k].c"}),Nn=l(Rt,{a:"d,aa",p:"var s=[];J(aa,function(A,p){s.push(p)});var cc=s.length",h:"for(var Z=true,r=0;r<cc;r++){var p=s[r];if(!(Z=A[p]===aa[p]))break}Z&&t.push(A)"}),Cn=l({q:i,r:i,a:"m",p:"var L=arguments,i=0,k=L.length;if(k>1){while(++i<k)t[L[i]]=F(t[L[i]],t);return t}",h:"if(S(A))t[i]=F(A,t)"});s.VERSION="0.8.2",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=L,s.bindAll=
|
27
|
+
Cn,s.chain=function(e){return e=new s(e),e.__chain__=n,e},s.clone=y,s.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},s.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},s.contains=cn,s.countBy=hn,s.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,bt(a),a=wt(i,t),r&&(o=e.apply(u,s)),o}},s.defaults=
|
28
|
+
Yt,s.defer=function(e){var n=nt.call(arguments,1);return wt(function(){return e.apply(t,n)},1)},s.delay=function(e,n){var r=nt.call(arguments,2);return wt(function(){return e.apply(t,r)},n)},s.difference=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length,i=Q.apply(_,arguments),i=o(i,r);++n<r;){var s=e[n];i(s)||t.push(s)}return t},s.escape=function(e){return e==r?"":(e+"").replace(V,h)},s.every=pn,s.extend=Zt,s.filter=dn,s.find=vn,s.first=S,s.flatten=x,s.forEach=mn,s.forIn=en,s.forOwn=tn,
|
29
|
+
s.functions=nn,s.groupBy=gn,s.has=function(e,t){return e?Z.call(e,t):i},s.identity=A,s.indexOf=T,s.initial=function(e,t,n){return e?nt.call(e,0,-(t==r||n?1:t)):[]},s.intersection=function(e){var t=arguments.length,n=[],r=-1,i=e?e.length:0,s=[];e:for(;++r<i;){var u=e[r];if(0>T(s,u)){for(var a=1;a<t;a++)if(!(n[a]||(n[a]=o(arguments[a])))(u))continue e;s.push(u)}}return s},s.invert=Vt,s.invoke=yn,s.isArguments=v,s.isArray=$t,s.isBoolean=function(e){return e===n||e===i||rt.call(e)==pt},s.isDate=function(
|
30
|
+
e){return rt.call(e)==dt},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=rn,s.isEqual=b,s.isFinite=function(e){return ot(e)&&rt.call(e)==vt},s.isFunction=m,s.isNaN=function(e){return rt.call(e)==vt&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return rt.call(e)==vt},s.isObject=function(e){return e?Ht[typeof e]:i},s.isPlainObject=Jt,s.isRegExp=function(e){return rt.call(e)==gt},s.isString=function(e){return rt.call(e)==yt},s.isUndefined=function(e){return e===t},s
|
31
|
+
.keys=sn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:nt.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?at(0,r+n):ft(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return a(t,e,nt.call(arguments,2))},s.map=bn,s.max=w,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Z.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=on,s.min=function(e,t,n){var r=
|
32
|
+
Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+s)t=f(t,n),mn(e,function(e,n,i){n=t(e,n,i),n<r&&(r=n,o=e)});else for(;++i<s;)e[i]<o&&(o=e[i]);return o},s.mixin=O,s.noConflict=function(){return e._=B,this},s.object=function(e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},s.omit=un,s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.pairs=an,s.partial=function(e){return a(e,nt.call(arguments,1))},s.pick=fn,s.pluck=
|
33
|
+
wn,s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+G(lt()*((+t||0)-e+1))},s.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=at(0,K((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=En,s.reduceRight=E,s.reject=Sn,s.rest=N,s.result=function(e,t){var n=e?e[t]:r;return m(n)?e[t]():n},s.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return mn(e,function(e){var r=G(lt()*(++t+1));n[t]=n[r],n[r]=e}),n},s.size=function(e){var t=e?e.length:0;return t===+
|
34
|
+
t?t:sn(e).length},s.some=xn,s.sortBy=Tn,s.sortedIndex=C,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){e||(e=""),n||(n={});var r,i,o=0,u=s.templateSettings,a="__p += '",f=n.variable||u.variable,l=f;e.replace(RegExp((n.escape||u.escape||X).source+"|"+(n.interpolate||u.interpolate||X).source+"|"+(n.evaluate||u.evaluate||X).source+"|$","g"),function(t,n,i,s,u){a+=e.slice(o,u).replace($,c),a+=n?"'+__e("+n+")+'":s?"';"+s+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=s||j.test(
|
35
|
+
n||i)),o=u+t.length}),a+="';",l||(f="obj",r?a="with("+f+"){"+a+"}":(n=RegExp("(\\(\\s*)"+f+"\\."+f+"\\b","g"),a=a.replace(z,"$&"+f+".").replace(n,"$1__d"))),a=(r?a.replace(I,""):a).replace(q,"$1").replace(R,"$1;"),a="function("+f+"){"+(l?"":f+"||("+f+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+f+"."+f+"||"+f)+";")+a+"return __p}";try{i=Function("_","return "+a)(s)}catch(h){throw h.source=a,h}return t?i(t):(i.source=
|
36
|
+
a,i)},s.throttle=function(e,t){function n(){a=new Date,u=r,s=e.apply(o,i)}var i,s,o,u,a=0;return function(){var r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(bt(u),a=r,s=e.apply(o,i)):u||(u=wt(n,f)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},s.toArray=function(e){if(!e)return[];var t=e.length;return t===+t?(Ct?rt.call(e)==yt:"string"==typeof e)?e.split(""):nt.call(e):ln(e)},s.unescape=function(e){return e==r?"":(e+"").replace(F,d)},s.union=
|
37
|
+
function(){for(var e=-1,t=Q.apply(_,arguments),n=t.length,r=[];++e<n;){var i=t[e];0>T(r,i)&&r.push(i)}return r},s.uniq=k,s.uniqueId=function(e){var t=P++;return e?e+t:t},s.values=ln,s.where=Nn,s.without=function(e){for(var t=-1,n=e?e.length:0,r=o(arguments,1,20),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.wrap=function(e,t){return function(){var n=[e];return arguments.length&&et.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){for(var t=-1,n=e?w(wn(arguments,"length")):0,r=Array(n);++
|
38
|
+
t<n;)r[t]=wn(arguments,t);return r},s.all=pn,s.any=xn,s.collect=bn,s.detect=vn,s.drop=N,s.each=mn,s.foldl=En,s.foldr=E,s.head=S,s.include=cn,s.inject=En,s.methods=nn,s.select=dn,s.tail=N,s.take=S,s.unique=k,O(s),s.prototype.chain=function(){return this.__chain__=n,this},s.prototype.value=function(){return this.__wrapped__},mn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=_[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),St&&e.length===0&&delete
|
39
|
+
e[0],this.__chain__&&(e=new s(e),e.__chain__=n),e}}),mn(["concat","join","slice"],function(e){var t=_[e];s.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new s(e),e.__chain__=n),e}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):M?"object"==typeof module&&module&&module.exports==M?(module.exports=s)._=s:M._=s:e._=s})(this);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lodash-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|