lodash-rails 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/lib/lodash/rails/version.rb +1 -1
- data/vendor/assets/javascripts/lodash.js +158 -76
- data/vendor/assets/javascripts/lodash.min.js +37 -36
- metadata +2 -2
data/README.md
CHANGED
data/lib/lodash/rails/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Lo-Dash v0.9.
|
2
|
+
* Lo-Dash v0.9.2 <http://lodash.com>
|
3
3
|
* (c) 2012 John-David Dalton <http://allyoucanleet.com/>
|
4
4
|
* Based on Underscore.js 1.4.2 <http://underscorejs.org>
|
5
5
|
* (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
@@ -18,13 +18,14 @@
|
|
18
18
|
|
19
19
|
/** Used for array and object method references */
|
20
20
|
var arrayRef = [],
|
21
|
-
|
21
|
+
// avoid a Closure Compiler bug by creatively creating an object
|
22
|
+
objectRef = new function(){};
|
22
23
|
|
23
24
|
/** Used to generate unique IDs */
|
24
25
|
var idCounter = 0;
|
25
26
|
|
26
27
|
/** Used internally to indicate various things */
|
27
|
-
var indicatorObject =
|
28
|
+
var indicatorObject = objectRef;
|
28
29
|
|
29
30
|
/** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */
|
30
31
|
var largeArraySize = 30;
|
@@ -32,7 +33,7 @@
|
|
32
33
|
/** Used to restore the original `_` reference in `noConflict` */
|
33
34
|
var oldDash = window._;
|
34
35
|
|
35
|
-
/** Used to detect delimiter values that
|
36
|
+
/** Used to detect template delimiter values that require a with-statement */
|
36
37
|
var reComplexDelimiter = /[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/;
|
37
38
|
|
38
39
|
/** Used to match HTML entities */
|
@@ -56,7 +57,16 @@
|
|
56
57
|
.replace(/valueOf|for [^\]]+/g, '.+?') + '$'
|
57
58
|
);
|
58
59
|
|
59
|
-
/**
|
60
|
+
/**
|
61
|
+
* Used to match ES6 template delimiters
|
62
|
+
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
|
63
|
+
*/
|
64
|
+
var reEsTemplate = /\$\{((?:(?=\\?)\\?[\s\S])*?)}/g;
|
65
|
+
|
66
|
+
/** Used to match "interpolate" template delimiters */
|
67
|
+
var reInterpolate = /<%=([\s\S]+?)%>/g;
|
68
|
+
|
69
|
+
/** Used to ensure capturing order of template delimiters */
|
60
70
|
var reNoMatch = /($^)/;
|
61
71
|
|
62
72
|
/** Used to match HTML characters */
|
@@ -277,7 +287,7 @@
|
|
277
287
|
* @memberOf _.templateSettings
|
278
288
|
* @type RegExp
|
279
289
|
*/
|
280
|
-
'interpolate':
|
290
|
+
'interpolate': reInterpolate,
|
281
291
|
|
282
292
|
/**
|
283
293
|
* Used to reference the data object in the template text.
|
@@ -318,7 +328,7 @@
|
|
318
328
|
|
319
329
|
// add support for accessing string characters by index if needed
|
320
330
|
' <% if (noCharByIndex) { %>\n' +
|
321
|
-
' if (
|
331
|
+
' if (isString(iteratee)) {\n' +
|
322
332
|
' iteratee = iteratee.split(\'\')\n' +
|
323
333
|
' }' +
|
324
334
|
' <% } %>\n' +
|
@@ -436,13 +446,13 @@
|
|
436
446
|
/*--------------------------------------------------------------------------*/
|
437
447
|
|
438
448
|
/**
|
439
|
-
* Creates a function optimized
|
449
|
+
* Creates a function optimized to search large arrays for a given `value`,
|
440
450
|
* starting at `fromIndex`, using strict equality for comparisons, i.e. `===`.
|
441
451
|
*
|
442
452
|
* @private
|
443
453
|
* @param {Array} array The array to search.
|
444
454
|
* @param {Mixed} value The value to search for.
|
445
|
-
* @param {Number} [fromIndex=0] The index to
|
455
|
+
* @param {Number} [fromIndex=0] The index to search from.
|
446
456
|
* @param {Number} [largeSize=30] The length at which an array is considered large.
|
447
457
|
* @returns {Boolean} Returns `true` if `value` is found, else `false`.
|
448
458
|
*/
|
@@ -450,14 +460,14 @@
|
|
450
460
|
fromIndex || (fromIndex = 0);
|
451
461
|
|
452
462
|
var length = array.length,
|
453
|
-
isLarge = (length - fromIndex) >= (largeSize || largeArraySize)
|
454
|
-
cache = isLarge ? {} : array;
|
463
|
+
isLarge = (length - fromIndex) >= (largeSize || largeArraySize);
|
455
464
|
|
456
465
|
if (isLarge) {
|
457
|
-
|
458
|
-
|
466
|
+
var cache = {},
|
467
|
+
index = fromIndex - 1;
|
468
|
+
|
459
469
|
while (++index < length) {
|
460
|
-
// manually coerce `value` to string because `hasOwnProperty`, in some
|
470
|
+
// manually coerce `value` to a string because `hasOwnProperty`, in some
|
461
471
|
// older versions of Firefox, coerces objects incorrectly
|
462
472
|
var key = array[index] + '';
|
463
473
|
(hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
|
@@ -468,10 +478,22 @@
|
|
468
478
|
var key = value + '';
|
469
479
|
return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1;
|
470
480
|
}
|
471
|
-
return indexOf(
|
481
|
+
return indexOf(array, value, fromIndex) > -1;
|
472
482
|
}
|
473
483
|
}
|
474
484
|
|
485
|
+
/**
|
486
|
+
* Used by `_.max` and `_.min` as the default `callback` when a given
|
487
|
+
* `collection` is a string value.
|
488
|
+
*
|
489
|
+
* @private
|
490
|
+
* @param {String} value The character to inspect.
|
491
|
+
* @returns {Number} Returns the code unit of given character.
|
492
|
+
*/
|
493
|
+
function charAtCallback(value) {
|
494
|
+
return value.charCodeAt(0);
|
495
|
+
}
|
496
|
+
|
475
497
|
/**
|
476
498
|
* Used by `sortBy` to compare transformed `collection` values, stable sorting
|
477
499
|
* them in ascending order.
|
@@ -544,7 +566,7 @@
|
|
544
566
|
// mimic the constructor's `return` behavior
|
545
567
|
// http://es5.github.com/#x13.2.2
|
546
568
|
var result = func.apply(thisBinding, args);
|
547
|
-
return result
|
569
|
+
return isObject(result)
|
548
570
|
? result
|
549
571
|
: thisBinding
|
550
572
|
}
|
@@ -619,14 +641,14 @@
|
|
619
641
|
|
620
642
|
// create the function factory
|
621
643
|
var factory = Function(
|
622
|
-
'createCallback, hasOwnProperty, isArguments,
|
623
|
-
'
|
644
|
+
'createCallback, hasOwnProperty, isArguments, isString, objectTypes, ' +
|
645
|
+
'nativeKeys, propertyIsEnumerable',
|
624
646
|
'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}'
|
625
647
|
);
|
626
648
|
// return the compiled function
|
627
649
|
return factory(
|
628
|
-
createCallback, hasOwnProperty, isArguments,
|
629
|
-
|
650
|
+
createCallback, hasOwnProperty, isArguments, isString, objectTypes,
|
651
|
+
nativeKeys, propertyIsEnumerable
|
630
652
|
);
|
631
653
|
}
|
632
654
|
|
@@ -879,7 +901,7 @@
|
|
879
901
|
deep = false;
|
880
902
|
}
|
881
903
|
// inspect [[Class]]
|
882
|
-
var isObj =
|
904
|
+
var isObj = isObject(value);
|
883
905
|
if (isObj) {
|
884
906
|
// don't clone `arguments` objects, functions, or non-object Objects
|
885
907
|
var className = toString.call(value);
|
@@ -1564,15 +1586,10 @@
|
|
1564
1586
|
* // => ['one', 'two', 'three'] (order is not guaranteed)
|
1565
1587
|
*/
|
1566
1588
|
var keys = !nativeKeys ? shimKeys : function(object) {
|
1567
|
-
var type = typeof object;
|
1568
|
-
|
1569
1589
|
// avoid iterating over the `prototype` property
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
return object && objectTypes[type]
|
1574
|
-
? nativeKeys(object)
|
1575
|
-
: [];
|
1590
|
+
return typeof object == 'function' && propertyIsEnumerable.call(object, 'prototype')
|
1591
|
+
? shimKeys(object)
|
1592
|
+
: (isObject(object) ? nativeKeys(object) : []);
|
1576
1593
|
};
|
1577
1594
|
|
1578
1595
|
/**
|
@@ -1613,7 +1630,7 @@
|
|
1613
1630
|
stackA = args[3],
|
1614
1631
|
stackB = args[4];
|
1615
1632
|
|
1616
|
-
if (indicator !==
|
1633
|
+
if (indicator !== objectRef) {
|
1617
1634
|
stackA = [];
|
1618
1635
|
stackB = [];
|
1619
1636
|
length = args.length;
|
@@ -1641,7 +1658,7 @@
|
|
1641
1658
|
: (isPlainObject(value) ? value : {})
|
1642
1659
|
);
|
1643
1660
|
// recursively merge objects and arrays (susceptible to call stack limits)
|
1644
|
-
object[key] = merge(value, source,
|
1661
|
+
object[key] = merge(value, source, objectRef, stackA, stackB);
|
1645
1662
|
}
|
1646
1663
|
} else if (source != null) {
|
1647
1664
|
object[key] = source;
|
@@ -1792,7 +1809,8 @@
|
|
1792
1809
|
|
1793
1810
|
/**
|
1794
1811
|
* Checks if a given `target` element is present in a `collection` using strict
|
1795
|
-
* equality for comparisons, i.e. `===`.
|
1812
|
+
* equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used
|
1813
|
+
* as the offset from the end of the collection.
|
1796
1814
|
*
|
1797
1815
|
* @static
|
1798
1816
|
* @memberOf _
|
@@ -1800,28 +1818,35 @@
|
|
1800
1818
|
* @category Collections
|
1801
1819
|
* @param {Array|Object|String} collection The collection to iterate over.
|
1802
1820
|
* @param {Mixed} target The value to check for.
|
1821
|
+
* @param {Number} [fromIndex=0] The index to search from.
|
1803
1822
|
* @returns {Boolean} Returns `true` if the `target` element is found, else `false`.
|
1804
1823
|
* @example
|
1805
1824
|
*
|
1806
|
-
* _.contains([1, 2, 3],
|
1825
|
+
* _.contains([1, 2, 3], 1);
|
1807
1826
|
* // => true
|
1808
1827
|
*
|
1828
|
+
* _.contains([1, 2, 3], 1, 2);
|
1829
|
+
* // => false
|
1830
|
+
*
|
1809
1831
|
* _.contains({ 'name': 'moe', 'age': 40 }, 'moe');
|
1810
1832
|
* // => true
|
1811
1833
|
*
|
1812
1834
|
* _.contains('curly', 'ur');
|
1813
1835
|
* // => true
|
1814
1836
|
*/
|
1815
|
-
function contains(collection, target) {
|
1816
|
-
var
|
1837
|
+
function contains(collection, target, fromIndex) {
|
1838
|
+
var index = -1,
|
1839
|
+
length = collection ? collection.length : 0;
|
1840
|
+
|
1841
|
+
fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0;
|
1817
1842
|
if (typeof length == 'number') {
|
1818
|
-
return (
|
1819
|
-
? collection.indexOf(target)
|
1820
|
-
: indexOf(collection, target)
|
1843
|
+
return (isString(collection)
|
1844
|
+
? collection.indexOf(target, fromIndex)
|
1845
|
+
: indexOf(collection, target, fromIndex)
|
1821
1846
|
) > -1;
|
1822
1847
|
}
|
1823
1848
|
return some(collection, function(value) {
|
1824
|
-
return value === target;
|
1849
|
+
return ++index >= fromIndex && value === target;
|
1825
1850
|
});
|
1826
1851
|
}
|
1827
1852
|
|
@@ -1883,9 +1908,21 @@
|
|
1883
1908
|
function every(collection, callback, thisArg) {
|
1884
1909
|
var result = true;
|
1885
1910
|
callback = createCallback(callback, thisArg);
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1911
|
+
|
1912
|
+
if (isArray(collection)) {
|
1913
|
+
var index = -1,
|
1914
|
+
length = collection.length;
|
1915
|
+
|
1916
|
+
while (++index < length) {
|
1917
|
+
if (!(result = !!callback(collection[index], index, collection))) {
|
1918
|
+
break;
|
1919
|
+
}
|
1920
|
+
}
|
1921
|
+
} else {
|
1922
|
+
forEach(collection, function(value, index, collection) {
|
1923
|
+
return (result = !!callback(value, index, collection));
|
1924
|
+
});
|
1925
|
+
}
|
1889
1926
|
return result;
|
1890
1927
|
}
|
1891
1928
|
|
@@ -1941,8 +1978,11 @@
|
|
1941
1978
|
function find(collection, callback, thisArg) {
|
1942
1979
|
var result;
|
1943
1980
|
callback = createCallback(callback, thisArg);
|
1944
|
-
|
1945
|
-
|
1981
|
+
forEach(collection, function(value, index, collection) {
|
1982
|
+
if (callback(value, index, collection)) {
|
1983
|
+
result = value;
|
1984
|
+
return false;
|
1985
|
+
}
|
1946
1986
|
});
|
1947
1987
|
return result;
|
1948
1988
|
}
|
@@ -2109,8 +2149,11 @@
|
|
2109
2149
|
length = collection ? collection.length : 0,
|
2110
2150
|
result = computed;
|
2111
2151
|
|
2112
|
-
if (callback ||
|
2113
|
-
callback =
|
2152
|
+
if (callback || !isArray(collection)) {
|
2153
|
+
callback = !callback && isString(collection)
|
2154
|
+
? charAtCallback
|
2155
|
+
: createCallback(callback, thisArg);
|
2156
|
+
|
2114
2157
|
forEach(collection, function(value, index, collection) {
|
2115
2158
|
var current = callback(value, index, collection);
|
2116
2159
|
if (current > computed) {
|
@@ -2152,8 +2195,11 @@
|
|
2152
2195
|
length = collection ? collection.length : 0,
|
2153
2196
|
result = computed;
|
2154
2197
|
|
2155
|
-
if (callback ||
|
2156
|
-
callback =
|
2198
|
+
if (callback || !isArray(collection)) {
|
2199
|
+
callback = !callback && isString(collection)
|
2200
|
+
? charAtCallback
|
2201
|
+
: createCallback(callback, thisArg);
|
2202
|
+
|
2157
2203
|
forEach(collection, function(value, index, collection) {
|
2158
2204
|
var current = callback(value, index, collection);
|
2159
2205
|
if (current < computed) {
|
@@ -2257,7 +2303,7 @@
|
|
2257
2303
|
if (typeof length != 'number') {
|
2258
2304
|
var props = keys(collection);
|
2259
2305
|
length = props.length;
|
2260
|
-
} else if (noCharByIndex &&
|
2306
|
+
} else if (noCharByIndex && isString(collection)) {
|
2261
2307
|
iteratee = collection.split('');
|
2262
2308
|
}
|
2263
2309
|
forEach(collection, function(value, index, collection) {
|
@@ -2367,9 +2413,21 @@
|
|
2367
2413
|
function some(collection, callback, thisArg) {
|
2368
2414
|
var result;
|
2369
2415
|
callback = createCallback(callback, thisArg);
|
2370
|
-
|
2371
|
-
|
2372
|
-
|
2416
|
+
|
2417
|
+
if (isArray(collection)) {
|
2418
|
+
var index = -1,
|
2419
|
+
length = collection.length;
|
2420
|
+
|
2421
|
+
while (++index < length) {
|
2422
|
+
if (result = callback(collection[index], index, collection)) {
|
2423
|
+
break;
|
2424
|
+
}
|
2425
|
+
}
|
2426
|
+
} else {
|
2427
|
+
forEach(collection, function(value, index, collection) {
|
2428
|
+
return !(result = callback(value, index, collection));
|
2429
|
+
});
|
2430
|
+
}
|
2373
2431
|
return !!result;
|
2374
2432
|
}
|
2375
2433
|
|
@@ -2432,7 +2490,7 @@
|
|
2432
2490
|
*/
|
2433
2491
|
function toArray(collection) {
|
2434
2492
|
if (collection && typeof collection.length == 'number') {
|
2435
|
-
return (noArraySliceOnStrings ?
|
2493
|
+
return (noArraySliceOnStrings ? isString(collection) : typeof collection == 'string')
|
2436
2494
|
? collection.split('')
|
2437
2495
|
: slice.call(collection);
|
2438
2496
|
}
|
@@ -2610,8 +2668,8 @@
|
|
2610
2668
|
* @category Arrays
|
2611
2669
|
* @param {Array} array The array to search.
|
2612
2670
|
* @param {Mixed} value The value to search for.
|
2613
|
-
* @param {Boolean|Number} [fromIndex=0] The index to
|
2614
|
-
*
|
2671
|
+
* @param {Boolean|Number} [fromIndex=0] The index to search from or `true` to
|
2672
|
+
* perform a binary search on a sorted `array`.
|
2615
2673
|
* @returns {Number} Returns the index of the matched value or `-1`.
|
2616
2674
|
* @example
|
2617
2675
|
*
|
@@ -2650,7 +2708,7 @@
|
|
2650
2708
|
* @memberOf _
|
2651
2709
|
* @category Arrays
|
2652
2710
|
* @param {Array} array The array to query.
|
2653
|
-
* @param {Number} [n] The number of elements to
|
2711
|
+
* @param {Number} [n=1] The number of elements to exclude.
|
2654
2712
|
* @param- {Object} [guard] Internally used to allow this method to work with
|
2655
2713
|
* others like `_.map` without using their callback `index` argument for `n`.
|
2656
2714
|
* @returns {Array} Returns all but the last element or `n` elements of `array`.
|
@@ -2726,15 +2784,16 @@
|
|
2726
2784
|
}
|
2727
2785
|
|
2728
2786
|
/**
|
2729
|
-
* Gets the index at which the last occurrence of `value` is found using
|
2730
|
-
*
|
2787
|
+
* Gets the index at which the last occurrence of `value` is found using strict
|
2788
|
+
* equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used
|
2789
|
+
* as the offset from the end of the collection.
|
2731
2790
|
*
|
2732
2791
|
* @static
|
2733
2792
|
* @memberOf _
|
2734
2793
|
* @category Arrays
|
2735
2794
|
* @param {Array} array The array to search.
|
2736
2795
|
* @param {Mixed} value The value to search for.
|
2737
|
-
* @param {Number} [fromIndex=array.length-1] The index to
|
2796
|
+
* @param {Number} [fromIndex=array.length-1] The index to search from.
|
2738
2797
|
* @returns {Number} Returns the index of the matched value or `-1`.
|
2739
2798
|
* @example
|
2740
2799
|
*
|
@@ -2849,7 +2908,7 @@
|
|
2849
2908
|
* @alias drop, tail
|
2850
2909
|
* @category Arrays
|
2851
2910
|
* @param {Array} array The array to query.
|
2852
|
-
* @param {Number} [n] The number of elements to
|
2911
|
+
* @param {Number} [n=1] The number of elements to exclude.
|
2853
2912
|
* @param- {Object} [guard] Internally used to allow this method to work with
|
2854
2913
|
* others like `_.map` without using their callback `index` argument for `n`.
|
2855
2914
|
* @returns {Array} Returns all but the first value or `n` values of `array`.
|
@@ -2981,6 +3040,11 @@
|
|
2981
3040
|
callback = isSorted;
|
2982
3041
|
isSorted = false;
|
2983
3042
|
}
|
3043
|
+
// init value cache for large arrays
|
3044
|
+
var isLarge = !isSorted && length > 74;
|
3045
|
+
if (isLarge) {
|
3046
|
+
var cache = {};
|
3047
|
+
}
|
2984
3048
|
if (callback) {
|
2985
3049
|
seen = [];
|
2986
3050
|
callback = createCallback(callback, thisArg);
|
@@ -2989,11 +3053,16 @@
|
|
2989
3053
|
var value = array[index],
|
2990
3054
|
computed = callback ? callback(value, index, array) : value;
|
2991
3055
|
|
3056
|
+
if (isLarge) {
|
3057
|
+
// manually coerce `computed` to a string because `hasOwnProperty`, in
|
3058
|
+
// some older versions of Firefox, coerces objects incorrectly
|
3059
|
+
seen = hasOwnProperty.call(cache, computed + '') ? cache[computed] : (cache[computed] = []);
|
3060
|
+
}
|
2992
3061
|
if (isSorted
|
2993
3062
|
? !index || seen[seen.length - 1] !== computed
|
2994
3063
|
: indexOf(seen, computed) < 0
|
2995
3064
|
) {
|
2996
|
-
if (callback) {
|
3065
|
+
if (callback || isLarge) {
|
2997
3066
|
seen.push(computed);
|
2998
3067
|
}
|
2999
3068
|
result.push(value);
|
@@ -3062,8 +3131,9 @@
|
|
3062
3131
|
/*--------------------------------------------------------------------------*/
|
3063
3132
|
|
3064
3133
|
/**
|
3065
|
-
* Creates a function that is restricted to executing only after it is
|
3066
|
-
* called `n` times.
|
3134
|
+
* Creates a function that is restricted to executing `func` only after it is
|
3135
|
+
* called `n` times. The `func` is executed with the `this` binding of the
|
3136
|
+
* created function.
|
3067
3137
|
*
|
3068
3138
|
* @static
|
3069
3139
|
* @memberOf _
|
@@ -3159,6 +3229,7 @@
|
|
3159
3229
|
* Creates a function that is the composition of the passed functions,
|
3160
3230
|
* where each function consumes the return value of the function that follows.
|
3161
3231
|
* In math terms, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`.
|
3232
|
+
* Each function is executed with the `this` binding of the composed function.
|
3162
3233
|
*
|
3163
3234
|
* @static
|
3164
3235
|
* @memberOf _
|
@@ -3316,7 +3387,8 @@
|
|
3316
3387
|
* Creates a function that memoizes the result of `func`. If `resolver` is
|
3317
3388
|
* passed, it will be used to determine the cache key for storing the result
|
3318
3389
|
* based on the arguments passed to the memoized function. By default, the first
|
3319
|
-
* argument passed to the memoized function is used as the cache key.
|
3390
|
+
* argument passed to the memoized function is used as the cache key. The `func`
|
3391
|
+
* is executed with the `this` binding of the memoized function.
|
3320
3392
|
*
|
3321
3393
|
* @static
|
3322
3394
|
* @memberOf _
|
@@ -3341,8 +3413,9 @@
|
|
3341
3413
|
}
|
3342
3414
|
|
3343
3415
|
/**
|
3344
|
-
* Creates a function that is restricted to
|
3345
|
-
* the function will return the value of the first call.
|
3416
|
+
* Creates a function that is restricted to execute `func` once. Repeat calls to
|
3417
|
+
* the function will return the value of the first call. The `func` is executed
|
3418
|
+
* with the `this` binding of the created function.
|
3346
3419
|
*
|
3347
3420
|
* @static
|
3348
3421
|
* @memberOf _
|
@@ -3375,8 +3448,8 @@
|
|
3375
3448
|
|
3376
3449
|
/**
|
3377
3450
|
* Creates a function that, when called, invokes `func` with any additional
|
3378
|
-
* `partial` arguments prepended to those passed to the new function. This
|
3379
|
-
* is similar to `bind`, except it does **not** alter the `this` binding.
|
3451
|
+
* `partial` arguments prepended to those passed to the new function. This
|
3452
|
+
* method is similar to `bind`, except it does **not** alter the `this` binding.
|
3380
3453
|
*
|
3381
3454
|
* @static
|
3382
3455
|
* @memberOf _
|
@@ -3446,8 +3519,9 @@
|
|
3446
3519
|
|
3447
3520
|
/**
|
3448
3521
|
* Creates a function that passes `value` to the `wrapper` function as its
|
3449
|
-
* first argument. Additional arguments passed to the
|
3450
|
-
* to those passed to the `wrapper` function.
|
3522
|
+
* first argument. Additional arguments passed to the function are appended
|
3523
|
+
* to those passed to the `wrapper` function. The `wrapper` is executed with
|
3524
|
+
* the `this` binding of the created function.
|
3451
3525
|
*
|
3452
3526
|
* @static
|
3453
3527
|
* @memberOf _
|
@@ -3671,7 +3745,11 @@
|
|
3671
3745
|
*
|
3672
3746
|
* // using the "escape" delimiter to escape HTML in data property values
|
3673
3747
|
* _.template('<b><%- value %></b>', { 'value': '<script>' });
|
3674
|
-
* // => '<b><script
|
3748
|
+
* // => '<b><script></b>'
|
3749
|
+
*
|
3750
|
+
* // using the ES6 delimiter as an alternative to the default "interpolate" delimiter
|
3751
|
+
* _.template('hello ${ name }', { 'name': 'curly' });
|
3752
|
+
* // => 'hello curly'
|
3675
3753
|
*
|
3676
3754
|
* // using the internal `print` function in "evaluate" delimiters
|
3677
3755
|
* _.template('<% print("hello " + epithet); %>!', { 'epithet': 'stooge' });
|
@@ -3679,7 +3757,7 @@
|
|
3679
3757
|
*
|
3680
3758
|
* // using custom template delimiters
|
3681
3759
|
* _.templateSettings = {
|
3682
|
-
* 'interpolate':
|
3760
|
+
* 'interpolate': /{{([\s\S]+?)}}/g
|
3683
3761
|
* };
|
3684
3762
|
*
|
3685
3763
|
* _.template('hello {{ name }}!', { 'name': 'mustache' });
|
@@ -3717,8 +3795,9 @@
|
|
3717
3795
|
|
3718
3796
|
var isEvaluating,
|
3719
3797
|
result,
|
3720
|
-
index = 0,
|
3721
3798
|
settings = lodash.templateSettings,
|
3799
|
+
index = 0,
|
3800
|
+
interpolate = options.interpolate || settings.interpolate || reNoMatch,
|
3722
3801
|
source = "__p += '",
|
3723
3802
|
variable = options.variable || settings.variable,
|
3724
3803
|
hasVariable = variable;
|
@@ -3726,11 +3805,14 @@
|
|
3726
3805
|
// compile regexp to match each delimiter
|
3727
3806
|
var reDelimiters = RegExp(
|
3728
3807
|
(options.escape || settings.escape || reNoMatch).source + '|' +
|
3729
|
-
|
3808
|
+
interpolate.source + '|' +
|
3809
|
+
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
|
3730
3810
|
(options.evaluate || settings.evaluate || reNoMatch).source + '|$'
|
3731
3811
|
, 'g');
|
3732
3812
|
|
3733
|
-
text.replace(reDelimiters, function(match, escapeValue, interpolateValue, evaluateValue, offset) {
|
3813
|
+
text.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
|
3814
|
+
interpolateValue || (interpolateValue = esTemplateValue);
|
3815
|
+
|
3734
3816
|
// escape characters that cannot be included in string literals
|
3735
3817
|
source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);
|
3736
3818
|
|
@@ -3975,7 +4057,7 @@
|
|
3975
4057
|
* @memberOf _
|
3976
4058
|
* @type String
|
3977
4059
|
*/
|
3978
|
-
lodash.VERSION = '0.9.
|
4060
|
+
lodash.VERSION = '0.9.2';
|
3979
4061
|
|
3980
4062
|
// assign static methods
|
3981
4063
|
lodash.after = after;
|
@@ -1,39 +1,40 @@
|
|
1
1
|
/*!
|
2
|
-
Lo-Dash 0.9.
|
2
|
+
Lo-Dash 0.9.2 lodash.com/license
|
3
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||
|
6
|
-
,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(
|
7
|
-
e.d+",
|
8
|
-
;if(!e.e||e.l)r+="if(",e.e||(r+="!(
|
9
|
-
[e]}function
|
10
|
-
|
11
|
-
{};return
|
12
|
-
t.toString&&"string"==typeof (t+"")))return i;var u=e.constructor,f=t.constructor;if(u!=f&&(!
|
13
|
-
(t,c)||!
|
14
|
-
e?e.length:0)?-1<(
|
15
|
-
]=t(e,n,i)});return s}function
|
16
|
-
.
|
17
|
-
for(;++r<i;)if(e[r]===t)return r;return-1}function
|
18
|
-
e,t,
|
19
|
-
,tt=/\b(__p\+=)''\+/g,
|
20
|
-
,
|
21
|
-
)
|
22
|
-
:"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,
|
23
|
-
,
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
{var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return
|
31
|
-
e,t,n){var r="function"==typeof t,i={};if(r)t=
|
32
|
-
;u in e&&(r[u]=e[u])}else t=
|
33
|
-
|
34
|
-
n
|
35
|
-
.
|
36
|
-
(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(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){return e&&"number"==typeof
|
37
|
-
t){n.push(t)}),
|
38
|
-
|
39
|
-
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(
|
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||Y);if(i)for(var s={},n=t-1;++n<r;){var o=e[n]+"";(yt.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(n){if(i){var r=n+"";return yt.call(s,r)&&-1<q(s[r],n)}return-1<q(e,n,t)}}function u(e){return e.charCodeAt(0)}function a(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 f
|
6
|
+
(e,t,n){function r(){var u=arguments,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(Et.call(u)):n),this instanceof r?(d.prototype=e.prototype,a=new d,u=e.apply(a,u),T(u)?u:a):e.apply(a,u)}var i=x(e),s=!n,o=e;return s&&(n=t),r}function l(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:X}function c(){for(var e={b:"",c:"",e:It,f:Kt,g:"",h:Ut,i:Xt,j:pt,k:"",l:n},t,r=0;t=arguments[r];r++)for(var i in t)e[i]=t[i];t=e.a,e.d=/^[^,]+/
|
7
|
+
.exec(t)[0],r="var h,v,k="+e.d+",s="+e.d+";if(!"+e.d+")return s;"+e.k+";",e.b?(r+="var l=k.length;h=-1;if(typeof l=='number'){",e.i&&(r+="if(j(k)){k=k.split('')}"),r+="while(++h<l){v=k[h];"+e.b+"}}else {"):e.h&&(r+="var l=k.length;h=-1;if(l&&i(k)){while(++h<l){v=k[h+=''];"+e.g+"}}else {"),e.e||(r+="var t=typeof k=='function'&&r.call(k,'prototype');");if(e.f&&e.l)r+="var p=-1,q=o[typeof k]?m(k):[],l=q.length;while(++p<l){h=q[p];",e.e||(r+="if(!(t&&h=='prototype')){"),r+="v=k[h];"+e.g+"",e.e||(r+="}"
|
8
|
+
);else{r+="for(h in k){";if(!e.e||e.l)r+="if(",e.e||(r+="!(t&&h=='prototype')"),!e.e&&e.l&&(r+="&&"),e.l&&(r+="g.call(k,h)"),r+="){";r+="v=k[h];"+e.g+";";if(!e.e||e.l)r+="}"}r+="}";if(e.e){r+="var f=k.constructor;";for(i=0;7>i;i++)r+="h='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===k)&&"),r+="g.call(k,h)){v=k[h];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return s",Function("e,g,i,j,o,m,r","return function("+t+"){"+r+"}")(l,yt,m,N,Gt,kt,wt)}function h(e){return"\\"+Yt[e]}function p
|
9
|
+
(e){return sn[e]}function d(){}function v(e){return on[e]}function m(e){return St.call(e)==Mt}function g(e){var t=i;if(!e||"object"!=typeof e||m(e))return t;var n=e.constructor;return(!Vt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!x(n)||n instanceof n)?qt?(nn(e,function(e,n,r){return t=!yt.call(r,n),i}),t===i):(nn(e,function(e,n){t=n}),t===i||yt.call(e,t)):t}function y(e){var t=[];return rn(e,function(e,n){t.push(n)}),t}function b(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=T(e)){var u=
|
10
|
+
St.call(e);if(!Qt[u]||zt&&m(e))return e;var a=u==_t,n=a||(u==Bt?ln(e):n)}if(!n||!t)return n?a?Et.call(e):an({},e):e;n=e.constructor;switch(u){case Dt:case Pt:return new n(+e);case Ht:case Ft:return new n(e);case jt:return n(e.source,st.exec(e))}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?hn:rn)(e,function(e,n){f[n]=b(e,t,r,s,o)}),f}function w(e){var t=[];return nn(e,function(e,n){x(e)&&t.push(n)}),t.sort()}function E(e){var t=
|
11
|
+
{};return rn(e,function(e,n){t[e]=n}),t}function S(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=St.call(e);if(u!=St.call(t))return i;switch(u){case Dt:case Pt:return+e==+t;case Ht:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case jt:case Ft:return e==t+""}var a=u==_t||u==Mt;if(zt&&!a&&(a=m(e))&&!m(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return S(e.__wrapped__||e,t.__wrapped__||t);if(u!=Bt||Vt&&("function"!=typeof e.toString&&"string"==typeof (e+"")||"function"!=typeof
|
12
|
+
t.toString&&"string"==typeof (t+"")))return i;var u=e.constructor,f=t.constructor;if(u!=f&&(!x(u)||!(u instanceof u&&x(f)&&f instanceof f)))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=S(e[l],t[l],s,o)););return f}for(var c in e)if(yt.call(e,c)&&(l++,!yt.call(t,c)||!S(e[c],t[c],s,o)))return i;for(c in t)if(yt.call(t,c)&&!(l--))return i;if(It)for(;7>++u;)if(c=pt[u],yt.call(e,c)&&(!yt.call
|
13
|
+
(t,c)||!S(e[c],t[c],s,o)))return i;return n}function x(e){return"function"==typeof e}function T(e){return e?Gt[typeof e]:i}function N(e){return St.call(e)==Ft}function C(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==Q&&(u=[],a=[],o=i.length);for(;++s<o;)rn(i[s],function(t,n){var i,s,o;if(t&&((s=fn(t))||ln(t))){for(var f=u.length;f--;)if(i=u[f]==t)break;i?e[n]=a[f]:(u.push(t),a.push(o=(o=e[n],s)?fn(o)?o:[]:ln(o)?o:{}),e[n]=C(o,t,Q,u,a))}else t!=r&&(e[n]=t)});return e}function k(e){var t=[];return rn
|
14
|
+
(e,function(e){t.push(e)}),t}function L(e,t,n){var r=-1,i=e?e.length:0,n=(0>n?Lt(0,i+n):n)||0;return"number"==typeof i?-1<(N(e)?e.indexOf(t,n):q(e,t,n)):j(e,function(e){return++r>=n&&e===t})}function A(e,t,r){var i=n,t=l(t,r);if(fn(e))for(var r=-1,s=e.length;++r<s&&(i=!!t(e[r],r,e)););else hn(e,function(e,n,r){return i=!!t(e,n,r)});return i}function O(e,t,n){var r=[],t=l(t,n);return hn(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function M(e,t,n){var r,t=l(t,n);return hn(e,function(e,n,s){if(t(e,n,
|
15
|
+
s))return r=e,i}),r}function _(e,t,n){var r=-1,i=e?e.length:0,s=Array("number"==typeof i?i:0),t=l(t,n);if(fn(e))for(;++r<i;)s[r]=t(e[r],r,e);else hn(e,function(e,n,i){s[++r]=t(e,n,i)});return s}function D(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||!fn(e))t=!t&&N(e)?u:l(t,n),hn(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 P(e,t){var n=[];return hn(e,function(e){n.push(e[t])}),n}function H(e,t,n,r){var s=3>arguments.length,t=l(t,r);return hn
|
16
|
+
(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function B(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=cn(e),o=a.length;else Xt&&N(e)&&(s=e.split(""));return hn(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 j(e,t,n){var r,t=l(t,n);if(fn(e))for(var n=-1,i=e.length;++n<i&&!(r=t(e[n],n,e)););else hn(e,function(e,n,i){return!(r=t(e,n,i))});return!!r}function F(e,t,n){if(e)return t==r||n?e[0]:Et.call(e,0,t)}function I(e,t){for(var n=-1
|
17
|
+
,r=e?e.length:0,i=[];++n<r;){var s=e[n];fn(s)?bt.apply(i,t?s:I(s)):i.push(s)}return i}function q(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?Lt(0,i+n):n||0)-1;else if(n)return r=U(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function R(e,t,n){return e?Et.call(e,t==r||n?1:t):[]}function U(e,t,n,r){for(var i=0,s=e?e.length:i,n=n?l(n,r):X,t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function z(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=u;"function"==typeof t&&(r=n,
|
18
|
+
n=t,t=i);var f=!t&&74<o;if(f)var c={};n&&(a=[],n=l(n,r));for(;++s<o;){var r=e[s],h=n?n(r,s,e):r;f&&(a=yt.call(c,h+"")?c[h]:c[h]=[]);if(t?!s||a[a.length-1]!==h:0>q(a,h))(n||f)&&a.push(h),u.push(r)}return u}function W(e,t){return Jt||xt&&2<arguments.length?xt.call.apply(xt,arguments):f(e,t,Et.call(arguments,2))}function X(e){return e}function V(e){hn(w(e),function(t){var r=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return bt.apply(e,arguments),e=r.apply(s,e),this.__chain__&&(e=new
|
19
|
+
s(e),e.__chain__=n),e}})}var n=!0,r=null,i=!1,$="object"==typeof exports&&exports,J="object"==typeof global&&global;J.global===J&&(e=J);var K=[],Q=new function(){},G=0,Y=30,Z=e._,et=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,tt=/&(?:amp|lt|gt|quot|#x27);/g,nt=/\b__p\+='';/g,rt=/\b(__p\+=)''\+/g,it=/(__e\(.*?\)|\b__t\))\+'';/g,st=/\w*$/,ot=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,ut=RegExp("^"+(Q.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g
|
20
|
+
,".+?")+"$"),at=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,ft=/<%=([\s\S]+?)%>/g,lt=/($^)/,ct=/[&<>"']/g,ht=/['\n\r\t\u2028\u2029\\]/g,pt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),dt=Math.ceil,vt=K.concat,mt=Math.floor,gt=ut.test(gt=Object.getPrototypeOf)&>,yt=Q.hasOwnProperty,bt=K.push,wt=Q.propertyIsEnumerable,Et=K.slice,St=Q.toString,xt=ut.test(xt=Et.bind)&&xt,Tt=ut.test(Tt=Array.isArray)&&Tt,Nt=e.isFinite,Ct=e.isNaN,kt=ut.test(kt=Object
|
21
|
+
.keys)&&kt,Lt=Math.max,At=Math.min,Ot=Math.random,Mt="[object Arguments]",_t="[object Array]",Dt="[object Boolean]",Pt="[object Date]",Ht="[object Number]",Bt="[object Object]",jt="[object RegExp]",Ft="[object String]",It,qt,Rt=(Rt={0:1,length:1},K.splice.call(Rt,0,1),Rt[0]),Ut=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments)Ut=!n;It=!/valueOf/.test(t),qt="x"!=t[0]})(1);var zt=!m(arguments),Wt="x"!=Et.call("x")[0],Xt="xx"!="x"
|
22
|
+
[0]+Object("x")[0];try{var Vt=("[object Object]",St.call(e.document||0)==Bt)}catch($t){}var Jt=xt&&/\n|Opera/.test(xt+St.call(e.opera)),Kt=kt&&/^.+$|true/.test(kt+!!e.attachEvent),Qt={};Qt[Mt]=Qt["[object Function]"]=i,Qt[_t]=Qt[Dt]=Qt[Pt]=Qt[Ht]=Qt[Bt]=Qt[jt]=Qt[Ft]=n;var Gt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Yt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,
|
23
|
+
interpolate:ft,variable:""};var Zt={a:"d,c,u",k:"c=e(c,u)",b:"if(c(v,h,d)===false)return s",g:"if(c(v,h,d)===false)return s"},en={l:i,a:"n",k:"for(var a=1,b=arguments.length;a<b;a++){if(k=arguments[a]){",g:"s[h]=v",c:"}}"},tn={b:r};zt&&(m=function(e){return e?yt.call(e,"callee"):i});var nn=c(Zt,tn,{l:i}),rn=c(Zt,tn),sn={"&":"&","<":"<",">":">",'"':""","'":"'"},on=E(sn),un=c(en,{g:"if(s[h]==null)"+en.g}),an=c(en),fn=Tt||function(e){return St.call(e)==_t};x(/x/)&&(x=function(e){
|
24
|
+
return"[object Function]"==St.call(e)});var ln=gt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=gt(t))&>(n);return n?e==n||gt(e)==n&&!m(e):g(e)}:g,cn=kt?function(e){return"function"==typeof e&&wt.call(e,"prototype")?y(e):T(e)?kt(e):[]}:y,hn=c(Zt);s.VERSION="0.9.2",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=W,s.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=w(e),-1),r=t.length;++n<r;){var i=
|
25
|
+
t[n];e[i]=W(e[i],e)}return e},s.chain=function(e){return e=new s(e),e.__chain__=n,e},s.clone=b,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=L,s.countBy=function(e,t,n){var r={},t=l(t,n);return hn(e,function(e,n,i){n=t(e,n,i),yt.call(r,n)?r[n]++:r[n]=1}),r},s.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply
|
26
|
+
(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,clearTimeout(a),a=setTimeout(i,t),r&&(o=e.apply(u,s)),o}},s.defaults=un,s.defer=function(e){var n=Et.call(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},s.delay=function(e,n){var r=Et.call(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},s.difference=function(e){for(var t=-1,n=e?e.length:0,r=vt.apply(K,arguments),r=o(r,n),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.escape=function(e){return e==
|
27
|
+
r?"":(e+"").replace(ct,p)},s.every=A,s.extend=an,s.filter=O,s.find=M,s.first=F,s.flatten=I,s.forEach=hn,s.forIn=nn,s.forOwn=rn,s.functions=w,s.groupBy=function(e,t,n){var r={},t=l(t,n);return hn(e,function(e,n,i){n=t(e,n,i),(yt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},s.has=function(e,t){return e?yt.call(e,t):i},s.identity=X,s.indexOf=q,s.initial=function(e,t,n){return e?Et.call(e,0,-(t==r||n?1:t)):[]},s.intersection=function(e){var t=arguments,n=t.length,r={},i=[];return hn(e,function(e){if(0>q(i,e)
|
28
|
+
){for(var s=n;--s;)if(!(r[s]||(r[s]=o(t[s])))(e))return;i.push(e)}}),i},s.invert=E,s.invoke=function(e,t){var n=Et.call(arguments,2),r="function"==typeof t,i=[];return hn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.isArguments=m,s.isArray=fn,s.isBoolean=function(e){return e===n||e===i||St.call(e)==Dt},s.isDate=function(e){return St.call(e)==Pt},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=St.call(e),s=e.length;return r==_t||r==Ft||r==
|
29
|
+
Mt||zt&&m(e)||r==Bt&&"number"==typeof s&&x(e.splice)?!s:(rn(e,function(){return t=i}),t)},s.isEqual=S,s.isFinite=function(e){return Nt(e)&&!Ct(parseFloat(e))},s.isFunction=x,s.isNaN=function(e){return St.call(e)==Ht&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return St.call(e)==Ht},s.isObject=T,s.isPlainObject=ln,s.isRegExp=function(e){return St.call(e)==jt},s.isString=N,s.isUndefined=function(e){return e===t},s.keys=cn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||
|
30
|
+
n?e[i-1]:Et.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?Lt(0,r+n):At(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return f(t,e,Et.call(arguments,2))},s.map=_,s.max=D,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return yt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=C,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!fn(e))t=!t&&N(e)?u:l(t,n)
|
31
|
+
,hn(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=V,s.noConflict=function(){return e._=Z,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=function(e,t,n){var r="function"==typeof t,i={};if(r)t=l(t,n);else var s=vt.apply(K,arguments);return nn(e,function(e,n,o){if(r?!t(e,n,o):0>q(s,n,1))i[n]=e}),i},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this
|
32
|
+
,arguments),e=r,t)}},s.pairs=function(e){var t=[];return rn(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return f(e,Et.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=vt.apply(K,arguments),o=s.length;++i<o;){var u=s[i];u in e&&(r[u]=e[u])}else t=l(t,n),nn(e,function(e,n,i){t(e,n,i)&&(r[n]=e)});return r},s.pluck=P,s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+mt(Ot()*((+t||0)-e+1))},s.range=function(e,t,n){e=+e||0,n=+
|
33
|
+
n||1,t==r&&(t=e,e=0);for(var i=-1,t=Lt(0,dt((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=H,s.reduceRight=B,s.reject=function(e,t,n){return t=l(t,n),O(e,function(e,n,r){return!t(e,n,r)})},s.rest=R,s.result=function(e,t){var n=e?e[t]:r;return x(n)?e[t]():n},s.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return hn(e,function(e){var r=mt(Ot()*(++t+1));n[t]=n[r],n[r]=e}),n},s.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:cn(e).length},s.some=j,s.sortBy=function(e,t
|
34
|
+
,n){var r=[],t=l(t,n);hn(e,function(e,n,i){r.push({a:t(e,n,i),b:n,c:e})}),e=r.length;for(r.sort(a);e--;)r[e]=r[e].c;return r},s.sortedIndex=U,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){e||(e=""),n||(n={});var r,i,o=s.templateSettings,u=0,a=n.interpolate||o.interpolate||lt,f="__p += '",l=n.variable||o.variable,c=l;e.replace(RegExp((n.escape||o.escape||lt).source+"|"+a.source+"|"+(a===ft?at:lt).source+"|"+(n.evaluate||o.evaluate||lt).source+"|$","g"),function(t,n,i,s,o,a){i||(i=s
|
35
|
+
),f+=e.slice(u,a).replace(ht,h),f+=n?"'+__e("+n+")+'":o?"';"+o+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=o||et.test(n||i)),u=a+t.length}),f+="';",c||(l="obj",r?f="with("+l+"){"+f+"}":(n=RegExp("(\\(\\s*)"+l+"\\."+l+"\\b","g"),f=f.replace(ot,"$&"+l+".").replace(n,"$1__d"))),f=(r?f.replace(nt,""):f).replace(rt,"$1").replace(it,"$1;"),f="function("+l+"){"+(c?"":l+"||("+l+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":
|
36
|
+
(c?"":",__d="+l+"."+l+"||"+l)+";")+f+"return __p}";try{i=Function("_","return "+f)(s)}catch(p){throw p.source=f,p}return t?i(t):(i.source=f,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?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(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){return e&&"number"==typeof
|
37
|
+
e.length?(Wt?N(e):"string"==typeof e)?e.split(""):Et.call(e):k(e)},s.unescape=function(e){return e==r?"":(e+"").replace(tt,v)},s.union=function(){return z(vt.apply(K,arguments))},s.uniq=z,s.uniqueId=function(e){var t=G++;return e?e+t:t},s.values=k,s.where=function(e,t){var n=[];return nn(t,function(e,t){n.push(t)}),O(e,function(e){for(var r=n.length;r--;){var i=e[n[r]]===t[n[r]];if(!i)break}return!!i})},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];
|
38
|
+
r(s)||i.push(s)}return i},s.wrap=function(e,t){return function(){var n=[e];return bt.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){for(var t=-1,n=e?D(P(arguments,"length")):0,r=Array(n);++t<n;)r[t]=P(arguments,t);return r},s.all=A,s.any=j,s.collect=_,s.detect=M,s.drop=R,s.each=hn,s.foldl=H,s.foldr=B,s.head=F,s.include=L,s.inject=H,s.methods=w,s.select=O,s.tail=R,s.take=F,s.unique=z,V(s),s.prototype.chain=function(){return this.__chain__=n,this},s.prototype.value=function(){return this.__wrapped__
|
39
|
+
},hn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=K[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Rt&&e.length===0&&delete e[0],this.__chain__&&(e=new s(e),e.__chain__=n),e}}),hn(["concat","join","slice"],function(e){var t=K[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(
|
40
|
+
){return s})):$?"object"==typeof module&&module&&module.exports==$?(module.exports=s)._=s:$._=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.9.
|
4
|
+
version: 0.9.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-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|