mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Cleanup fix for modularize underscore and _.mixin and add tests for correct indicatorObject use in underscore builds.
Former-commit-id: 7700fb4df90cdc3eca47af037677d71a70908616
This commit is contained in:
174
build.js
174
build.js
@@ -686,9 +686,10 @@
|
||||
*
|
||||
* @private
|
||||
* @param {String} source The source to process.
|
||||
* @param {Boolean} [isModularize=false] A flag to specify a modularize build
|
||||
* @returns {String} Returns the modified source.
|
||||
*/
|
||||
function addUnderscoreChaining(source) {
|
||||
function addUnderscoreChaining(source, isModularize) {
|
||||
// remove `lodash.prototype.toString` and `lodash.prototype.valueOf` assignments
|
||||
source = source.replace(/^ *lodash\.prototype\.(?:toString|valueOf) *=.+\n/gm, '');
|
||||
|
||||
@@ -696,35 +697,57 @@
|
||||
source = source.replace(/(?:\s*\/\/.*)*\n( *)forOwn\(lodash,[\s\S]+?\n\1}.+/g, '');
|
||||
|
||||
// replace `_.mixin`
|
||||
source = replaceFunction(source, 'mixin', [
|
||||
'function mixin(object, source) {',
|
||||
' var ctor = object,',
|
||||
' isFunc = !source || isFunction(ctor);',
|
||||
'',
|
||||
' if (!source) {',
|
||||
' ctor = lodashWrapper;',
|
||||
' source = object;',
|
||||
' object = lodash;',
|
||||
' }',
|
||||
' forEach(functions(source), function(methodName) {',
|
||||
' var func = object[methodName] = source[methodName];',
|
||||
' if (isFunc) {',
|
||||
' ctor.prototype[methodName] = function() {',
|
||||
' var args = [this.__wrapped__];',
|
||||
' push.apply(args, arguments);',
|
||||
'',
|
||||
' var result = func.apply(object, args);',
|
||||
' if (this.__chain__) {',
|
||||
' result = new ctor(result);',
|
||||
' result.__chain__ = true;',
|
||||
' }',
|
||||
' return result;',
|
||||
' };',
|
||||
' }',
|
||||
' });',
|
||||
'}'
|
||||
].join('\n'));
|
||||
|
||||
if (!isModularize) {
|
||||
source = replaceFunction(source, 'mixin', [
|
||||
'function mixin(object) {',
|
||||
' forEach(functions(object), function(methodName) {',
|
||||
' var func = lodash[methodName] = object[methodName];',
|
||||
'',
|
||||
' lodash.prototype[methodName] = function() {',
|
||||
' var args = [this.__wrapped__];',
|
||||
' push.apply(args, arguments);',
|
||||
'',
|
||||
' var result = func.apply(lodash, args);',
|
||||
' if (this.__chain__) {',
|
||||
' result = new lodashWrapper(result);',
|
||||
' result.__chain__ = true;',
|
||||
' }',
|
||||
' return result;',
|
||||
' };',
|
||||
' });',
|
||||
'}'
|
||||
].join('\n'));
|
||||
}
|
||||
else {
|
||||
source = replaceFunction(source, 'mixin', [
|
||||
'function mixin(object, source) {',
|
||||
' var ctor = object,',
|
||||
' isFunc = !source || isFunction(ctor);',
|
||||
'',
|
||||
' if (!source) {',
|
||||
' ctor = lodashWrapper;',
|
||||
' source = object;',
|
||||
' object = lodash;',
|
||||
' }',
|
||||
' forEach(functions(source), function(methodName) {',
|
||||
' var func = object[methodName] = source[methodName];',
|
||||
' if (isFunc) {',
|
||||
' ctor.prototype[methodName] = function() {',
|
||||
' var args = [this.__wrapped__];',
|
||||
' push.apply(args, arguments);',
|
||||
'',
|
||||
' var result = func.apply(object, args);',
|
||||
' if (this.__chain__) {',
|
||||
' result = new ctor(result);',
|
||||
' result.__chain__ = true;',
|
||||
' }',
|
||||
' return result;',
|
||||
' };',
|
||||
' }',
|
||||
' });',
|
||||
'}'
|
||||
].join('\n'));
|
||||
}
|
||||
// replace wrapper `Array` method assignments
|
||||
source = source.replace(/^(?:(?: *\/\/.*\n)*(?: *if *\(.+\n)?( *)(baseEach|forEach)\(\['[\s\S]+?\n\1}\);(?:\n *})?\n+)+/m, function(match, indent, methodName) {
|
||||
return indent + [
|
||||
@@ -1156,7 +1179,7 @@
|
||||
'',
|
||||
' lodash backbone Build with only functions required by Backbone',
|
||||
' lodash legacy Build tailored for older environments without ES5 support',
|
||||
' lodash mobile Build without function compilation and most bug fixes for old browsers',
|
||||
' lodash mobile Build without function compilation and bug fixes for old browsers',
|
||||
' lodash modern Build tailored for newer environments with ES5 support',
|
||||
' lodash strict Build with `_.assign`, `_.bindAll`, & `_.defaults` in strict mode',
|
||||
' lodash underscore Build tailored for projects already using Underscore',
|
||||
@@ -1164,8 +1187,8 @@
|
||||
' lodash modularize Splits Lo-Dash into modules',
|
||||
'',
|
||||
' lodash include=... Comma separated function/category names to include in the build',
|
||||
' lodash minus=... Comma separated function/category names to remove from those included in the build',
|
||||
' lodash plus=... Comma separated function/category names to add to those included in the build',
|
||||
' lodash minus=... Comma separated function/category names to remove from the build',
|
||||
' lodash plus=... Comma separated function/category names to add to the build',
|
||||
' lodash category=... Comma separated categories of functions to include in the build (case-insensitive)',
|
||||
' (i.e. “arrays”, “chaining”, “collections”, “functions”, “objects”, and “utilities”)',
|
||||
' lodash exports=... Comma separated names of ways to export the `lodash` function',
|
||||
@@ -1177,9 +1200,9 @@
|
||||
' (e.g. `lodash template=./*.jst`)',
|
||||
' lodash settings=... Template settings used when precompiling templates',
|
||||
' (e.g. `lodash settings="{interpolate:/{{([\\s\\S]+?)}}/g}"`)',
|
||||
' lodash moduleId=... The AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates',
|
||||
' lodash moduleId=... The AMD module ID, which defaults to “lodash”, for precompiled templates',
|
||||
'',
|
||||
' All arguments, except `backbone`, `csp`, `legacy`, `mobile`, `modern`, and `underscore`, may be combined.',
|
||||
' All commands, except `backbone`, `csp`, `legacy`, `mobile`, `modern`, and `underscore`, may be combined.',
|
||||
' Unless specified by `-o` or `--output`, all files created are saved to the current working directory.',
|
||||
'',
|
||||
' Options:',
|
||||
@@ -2818,6 +2841,9 @@
|
||||
_.pull(funcDepMap[funcName], 'setBindData');
|
||||
});
|
||||
}
|
||||
if (!isModularize && _.contains(plusFuncs, 'chain') == !isUnderscore) {
|
||||
_.pull(funcDepMap.mixin, 'isFunction');
|
||||
}
|
||||
if (isUnderscore) {
|
||||
if (!isLodash('baseClone') && !isLodash('clone') && !isLodash('cloneDeep')) {
|
||||
_.pull(funcDepMap.clone, 'baseClone').push('assign', 'isArray', 'isObject');
|
||||
@@ -2849,12 +2875,14 @@
|
||||
if (!isLodash('toArray')) {
|
||||
funcDepMap.toArray.push('isArray', 'map');
|
||||
}
|
||||
if (!isLodash('where')) {
|
||||
if (!isLodash('findWhere') || !isLodash('where')) {
|
||||
_.pull(funcDepMap.createCallback, 'baseIsEqual');
|
||||
funcDepMap.where.push('find', 'isEmpty');
|
||||
}
|
||||
// unexpose "exit early" feature from functions
|
||||
if (!isLodash('forEach') && !isLodash('forIn') && !isLodash('forOwn') && !isLodash('forOwnRight')) {
|
||||
if (!isLodash('forEach') && !isLodash('forEachRight') &&
|
||||
!isLodash('forIn') && !isLodash('forInRight') &&
|
||||
!isLodash('forOwn') && !isLodash('forOwnRight')) {
|
||||
_.each(['baseEach', 'forEach', 'forIn', 'forInRight', 'forOwn', 'forOwnRight'], function(funcName) {
|
||||
(varDepMap[funcName] || (varDepMap[funcName] = [])).push('indicatorObject');
|
||||
});
|
||||
@@ -2870,7 +2898,7 @@
|
||||
});
|
||||
|
||||
// modify functions that use `_.forOwn` to use the private `indicatorObject`
|
||||
_.each(['contains', 'every', 'find', 'some'], function(funcName) {
|
||||
_.each(['contains', 'every', 'find', 'findKey', 'some'], function(funcName) {
|
||||
(varDepMap[funcName] || (varDepMap[funcName] = [])).push('indicatorObject');
|
||||
});
|
||||
|
||||
@@ -3650,7 +3678,7 @@
|
||||
if (!isLodash('template')) {
|
||||
source = replaceFunction(source, 'template', [
|
||||
'function template(text, data, options) {',
|
||||
' var _ = lodash.templateSettings.imports._,',
|
||||
' var _ = lodash,',
|
||||
' settings = _.templateSettings;',
|
||||
'',
|
||||
" text || (text = '');",
|
||||
@@ -3843,7 +3871,15 @@
|
||||
.replace(/\(step.*\|\|.+?\)/, 'step')
|
||||
});
|
||||
}
|
||||
if (!isModularize) {
|
||||
// remove `_.templateSettings.imports assignment
|
||||
source = source.replace(/,[^']*'imports':[^}]+}/, '');
|
||||
|
||||
// replace complex lodash wrapper checks with simpler ones
|
||||
source = source.replace(matchFunction(source, 'baseIsEqual'), function(match) {
|
||||
return match.replace(/hasOwnProperty\.call\((\w+), *'__wrapped__'\)/g, '$1 instanceof lodash')
|
||||
});
|
||||
}
|
||||
// replace `slice` with `nativeSlice.call`
|
||||
_.each(['clone', 'first', 'initial', 'last', 'rest', 'toArray'], function(funcName) {
|
||||
if (funcName == 'clone'
|
||||
@@ -3867,7 +3903,7 @@
|
||||
}
|
||||
// add Underscore's chaining functions
|
||||
if (_.contains(plusFuncs, 'chain') == !isUnderscore) {
|
||||
source = addUnderscoreChaining(source);
|
||||
source = addUnderscoreChaining(source, isModularize);
|
||||
}
|
||||
// replace `baseEach` references with `forEach` and `forOwn`
|
||||
if (isUnderscore || (isModern && !isMobile)) {
|
||||
@@ -3971,53 +4007,36 @@
|
||||
});
|
||||
|
||||
if (isUnderscore) {
|
||||
// replace complex lodash wrapper checks with simpler ones
|
||||
if (!isModularize) {
|
||||
source = source.replace(matchFunction(source, 'baseIsEqual'), function(match) {
|
||||
return match.replace(/hasOwnProperty\.call\((\w+), *'__wrapped__'\)/g, '$1 instanceof lodash')
|
||||
});
|
||||
}
|
||||
// replace `lodash.createCallback` references with `createCallback`
|
||||
if (!isLodash('createCallback')) {
|
||||
source = source.replace(/\blodash\.(createCallback\()\b/g, '$1');
|
||||
}
|
||||
// unexpose "exit early" feature from functions
|
||||
if (!isLodash('forEach') && !isLodash('forIn') && !isLodash('forOwn') && !isLodash('forOwnRight')) {
|
||||
if (!isLodash('forEach') && !isLodash('forEachRight') &&
|
||||
!isLodash('forIn') && !isLodash('forInRight') &&
|
||||
!isLodash('forOwn') && !isLodash('forOwnRight')) {
|
||||
_.each(['baseEach', 'forEach', 'forIn', 'forInRight', 'forOwn', 'forOwnRight'], function(funcName) {
|
||||
source = source.replace(matchFunction(source, funcName), function(match) {
|
||||
return match.replace(/=== *false\)/g, '=== indicatorObject)');
|
||||
});
|
||||
});
|
||||
|
||||
// modify functions that use `_.forEach` to use the private `indicatorObject`
|
||||
source = source.replace(matchFunction(source, 'findLast'), function(match) {
|
||||
return match.replace(/return false/, 'return indicatorObject');
|
||||
_.each(['forEachRight', 'transform'], function(funcName) {
|
||||
source = source.replace(matchFunction(source, funcName), function(match) {
|
||||
return match.replace(/return callback[^)]+\)/, '$& === false && indicatorObject');
|
||||
});
|
||||
});
|
||||
|
||||
source = source.replace(matchFunction(source, 'forEachRight'), function(match) {
|
||||
return match.replace(/return callback[^)]+\)/, '$& === false && indicatorObject');
|
||||
_.each(['baseIsEqual', 'every'], function(funcName) {
|
||||
source = source.replace(matchFunction(source, funcName), function(match) {
|
||||
return match.replace(/\(result *= *(.+?)\);/g, '!(result = $1) && indicatorObject;');
|
||||
});
|
||||
});
|
||||
|
||||
source = source.replace(matchFunction(source, 'transform'), function(match) {
|
||||
return match.replace(/return callback[^)]+\)/, '$& === false && indicatorObject');
|
||||
});
|
||||
|
||||
// modify functions that use `_.forIn` to use the private `indicatorObject`
|
||||
source = source.replace(matchFunction(source, 'baseIsEqual'), function(match) {
|
||||
return match.replace(/\(result *= *(.+?)\);/g, '!(result = $1) && indicatorObject;');
|
||||
});
|
||||
|
||||
source = source.replace(matchFunction(source, 'shimIsPlainObject'), function(match) {
|
||||
return match.replace(/return false/, 'return indicatorObject');
|
||||
});
|
||||
|
||||
// modify functions that use `_.forOwn` to use the private `indicatorObject`
|
||||
source = source.replace(matchFunction(source, 'every'), function(match) {
|
||||
return match.replace(/\(result *= *(.+?)\);/g, '!(result = $1) && indicatorObject;');
|
||||
});
|
||||
|
||||
source = source.replace(matchFunction(source, 'find'), function(match) {
|
||||
return match.replace(/return false/, 'return indicatorObject');
|
||||
_.each(['find', 'findKey', 'findLast', 'findLastKey', 'shimIsPlainObject'], function(funcName) {
|
||||
source = source.replace(matchFunction(source, funcName), function(match) {
|
||||
return match.replace(/return false/, 'return indicatorObject');
|
||||
});
|
||||
});
|
||||
|
||||
_.each(['contains', 'some'], function(funcName) {
|
||||
@@ -4025,11 +4044,6 @@
|
||||
return match.replace(/!\(result *= *(.+?)\);/, '(result = $1) && indicatorObject;');
|
||||
});
|
||||
});
|
||||
|
||||
// modify functions that use `_.forOwnRight` to use the private `indicatorObject`
|
||||
source = source.replace(matchFunction(source, 'findLastKey'), function(match) {
|
||||
return match.replace(/return false/, 'return indicatorObject');
|
||||
});
|
||||
}
|
||||
// remove chainability
|
||||
_.each(['baseEach', 'forEach', 'forEachRight'], function(funcName) {
|
||||
@@ -4084,8 +4098,12 @@
|
||||
});
|
||||
|
||||
source = source.replace(matchFunction(source, 'template'), function(match) {
|
||||
if (isUnderscore) {
|
||||
// assign `_` via `template.imports`
|
||||
return match.replace(/_ *= *lodash\b/, '$&.templateSettings.imports._');
|
||||
}
|
||||
return match
|
||||
// assign `settings` variable from the reassigned `templateSettings.imports`
|
||||
// assign `settings` via `template.imports`
|
||||
.replace(/= *templateSettings(?=[,;])/, '$&.imports._.templateSettings')
|
||||
// remove debug sourceURL use in `_.template`
|
||||
.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
|
||||
|
||||
25
dist/lodash.compat.js
vendored
25
dist/lodash.compat.js
vendored
@@ -1984,7 +1984,7 @@
|
||||
*/
|
||||
function findLastKey(object, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forOwnRight(object, function(value, key, object) {
|
||||
if (callback(value, key, object)) {
|
||||
result = key;
|
||||
@@ -2054,17 +2054,16 @@
|
||||
* // => logs 'name' and 'bark' assuming `_.forIn ` logs 'bark' and 'name'
|
||||
*/
|
||||
function forInRight(object, callback, thisArg) {
|
||||
var index = -1,
|
||||
pairs = [];
|
||||
var pairs = [];
|
||||
|
||||
forIn(object, function(value, key) {
|
||||
pairs.push(value, key);
|
||||
pairs.push(key, value);
|
||||
});
|
||||
|
||||
var length = pairs.length;
|
||||
callback = baseCreateCallback(callback, thisArg, 3);
|
||||
while (++index < length) {
|
||||
if (callback(pairs[index], pairs[++index], object) === false) {
|
||||
while (length--) {
|
||||
if (callback(pairs[length--], pairs[length], object) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3191,7 +3190,7 @@
|
||||
*/
|
||||
function findLast(collection, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forEachRight(collection, function(value, index, collection) {
|
||||
if (callback(value, index, collection)) {
|
||||
result = value;
|
||||
@@ -3269,7 +3268,7 @@
|
||||
callback = baseCreateCallback(callback, thisArg, 3);
|
||||
forEach(collection, function(value, index, collection) {
|
||||
index = props ? props[--length] : --length;
|
||||
callback(iterable[index], index, collection);
|
||||
return callback(iterable[index], index, collection);
|
||||
});
|
||||
return collection;
|
||||
}
|
||||
@@ -4148,13 +4147,11 @@
|
||||
* // => 2
|
||||
*/
|
||||
function findLastIndex(array, callback, thisArg) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
var length = array ? array.length : 0;
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
while (length--) {
|
||||
if (callback(array[index], index, array)) {
|
||||
return index;
|
||||
if (callback(array[length], length, array)) {
|
||||
return length;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
20
dist/lodash.compat.min.js
vendored
20
dist/lodash.compat.min.js
vendored
@@ -18,13 +18,13 @@ r+="}"}return(n.b||$e.nonEnumArgs)&&(r+="}"),r+=n.c+";return E",t=t("d,j,k,m,o,p
|
||||
}),e===y||ve.call(n,e))}function st(n){return Je[n]}function gt(n){return n&&typeof n=="object"?_e.call(n)==T:b}function vt(n,t,e){var r=Te(n),u=r.length;for(t=Y(t,e,3);u--&&(e=r[u],!(t(n[e],e,n)===false)););return n}function ht(n){var t=[];return Xe(n,function(n,e){mt(n)&&t.push(e)}),t.sort()}function yt(n){for(var t=-1,e=Te(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function mt(n){return typeof n=="function"}function dt(n){return!(!n||!X[typeof n])}function bt(n){return typeof n=="number"||_e.call(n)==M
|
||||
}function _t(n){return typeof n=="string"||_e.call(n)==V}function jt(n){for(var t=-1,e=Te(n),r=e.length,u=Ht(r);++t<r;)u[t]=n[e[t]];return u}function wt(n,t,e){var r=-1,u=lt(),o=n?n.length:0,a=b;return e=(0>e?Se(0,o+e):e)||0,o&&typeof o=="number"?a=-1<(_t(n)?n.indexOf(t,e):u(n,t,e)):Ue(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function kt(n,t,e){var r=m;if(t=_.createCallback(t,e,3),ze(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Ue(n,function(n,e,u){return r=!!t(n,e,u)});return r
|
||||
}function xt(n,t,e){var r=[];if(t=_.createCallback(t,e,3),ze(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else Ue(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Ct(n,t,e){if(t=_.createCallback(t,e,3),!ze(n)){var r;return Ue(n,function(n,e,u){return t(n,e,u)?(r=n,b):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function Et(n,t,e){if(t&&typeof e=="undefined"&&ze(n)){e=-1;for(var r=n.length;++e<r&&t(n[e],e,n)!==false;);}else Ue(n,t,e);return n
|
||||
}function Ot(n,t,e){var r=n,u=n?n.length:0;if(typeof u!="number")var o=Te(n),u=o.length;else $e.unindexedChars&&_t(n)&&(r=n.split(""));return t=Y(t,e,3),Et(n,function(n,e,a){e=o?o[--u]:--u,t(r[e],e,a)}),n}function St(n,t,e){var r=-1,u=n?n.length:0,o=Ht(typeof u=="number"?u:0);if(t=_.createCallback(t,e,3),ze(n))for(;++r<u;)o[r]=t(n[r],r,n);else Ue(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function At(n,t,e){var r=-1/0,o=r;if(!t&&ze(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=!t&&_t(n)?u:_.createCallback(t,e,3),Ue(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,o=n)
|
||||
});return o}function It(n,t,e,r){var u=3>arguments.length;if(t=Y(t,r,4),ze(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Ue(n,function(n,r,o){e=u?(u=b,n):t(e,n,r,o)});return e}function Bt(n,t,e,r){var u=3>arguments.length;return t=Y(t,r,4),Ot(n,function(n,r,o){e=u?(u=b,n):t(e,n,r,o)}),e}function Pt(n,t,e){var r;if(t=_.createCallback(t,e,3),ze(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Ue(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Nt(n){var r=-1,u=lt(),o=n?n.length:0,i=Z(arguments,m,m,1),f=[],c=o>=E&&u===t;
|
||||
if(c){var l=a(i);l?(u=e,i=l):c=b}for(;++r<o;)l=n[r],0>u(i,l)&&f.push(l);return c&&g(i),f}function Ft(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=d){var o=-1;for(t=_.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,r==d||e)return n[0];return v(n,0,Ae(Se(0,r),u))}}function Rt(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?Se(0,u+r):r||0}else if(r)return r=$t(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Dt(n,t,e){if(typeof t!="number"&&t!=d){var r=0,u=-1,o=n?n.length:0;
|
||||
for(t=_.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=t==d||e?1:Se(0,t);return v(n,r)}function $t(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?_.createCallback(e,r,1):Gt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function zt(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=r&&r[t]===n?y:t,t=b),e!=d&&(e=_.createCallback(e,r,3)),ut(n,t,e)}function Lt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?At(rr(n,"length")):0,r=Ht(0>e?0:e);++t<e;)r[t]=rr(n,t);return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];
|
||||
t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function qt(n,t){return at(n,t,Pe.call(arguments,2),[])}function Kt(n,t,e){function r(){le(s),le(g),c=0,s=g=d}function u(){var t=v&&(!h||1<c);r(),t&&(p!==false&&(l=new Vt),i=n.apply(f,a))}function o(){r(),(v||p!==t)&&(l=new Vt,i=n.apply(f,a))}var a,i,f,c=0,l=0,p=b,s=d,g=d,v=m;if(t=Se(0,t||0),e===m)var h=m,v=b;else dt(e)&&(h=e.leading,p="maxWait"in e&&Se(t,e.maxWait||0),v="trailing"in e?e.trailing:v);return function(){if(a=arguments,f=this,c++,le(g),p===false)h&&2>c&&(i=n.apply(f,a));
|
||||
else{var e=new Vt;!s&&!h&&(l=e);var r=p-(e-l);0<r?s||(s=de(o,r)):(le(s),s=d,l=e,i=n.apply(f,a))}return t!==p&&(g=de(u,t)),i}}function Wt(n){var t=Pe.call(arguments,1);return de(function(){n.apply(y,t)},1)}function Gt(n){return n}function Jt(n,t){var e=n,r=!t||mt(e);t||(e=j,t=n,n=_),Et(ht(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return he.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:new e(r)})})}function Mt(){return this.__wrapped__
|
||||
}r=r?et.defaults(n.Object(),r,et.pick(n,z)):n;var Ht=r.Array,Ut=r.Boolean,Vt=r.Date,Qt=r.Function,Xt=r.Math,Yt=r.Number,Zt=r.Object,ne=r.RegExp,te=r.String,ee=r.TypeError,re=[],ue=r.Error.prototype,oe=Zt.prototype,ae=te.prototype,ie=r._,fe=ne("^"+te(oe.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ce=Xt.ceil,le=r.clearTimeout,pe=fe.test(pe=Zt.defineProperty)&&pe,se=Xt.floor,ge=fe.test(ge=Zt.getPrototypeOf)&&ge,ve=oe.hasOwnProperty,he=re.push,ye=oe.propertyIsEnumerable,me=r.setImmediate,de=r.setTimeout,be=re.splice,_e=oe.toString,je=re.unshift,we=fe.test(we=_e.bind)&&we,ke=fe.test(ke=Zt.create)&&ke,xe=fe.test(xe=Ht.isArray)&&xe,Ce=r.isFinite,Ee=r.isNaN,Oe=fe.test(Oe=Zt.keys)&&Oe,Se=Xt.max,Ae=Xt.min,Ie=r.parseInt,Be=Xt.random,Pe=re.slice,Ne=fe.test(r.attachEvent),Fe=we&&!/\n|true/.test(we+Ne),Re={};
|
||||
}function Ot(n,t,e){var r=n,u=n?n.length:0;if(typeof u!="number")var o=Te(n),u=o.length;else $e.unindexedChars&&_t(n)&&(r=n.split(""));return t=Y(t,e,3),Et(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)}),n}function St(n,t,e){var r=-1,u=n?n.length:0,o=Ht(typeof u=="number"?u:0);if(t=_.createCallback(t,e,3),ze(n))for(;++r<u;)o[r]=t(n[r],r,n);else Ue(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function At(n,t,e){var r=-1/0,o=r;if(!t&&ze(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)
|
||||
}}else t=!t&&_t(n)?u:_.createCallback(t,e,3),Ue(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,o=n)});return o}function It(n,t,e,r){var u=3>arguments.length;if(t=Y(t,r,4),ze(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Ue(n,function(n,r,o){e=u?(u=b,n):t(e,n,r,o)});return e}function Bt(n,t,e,r){var u=3>arguments.length;return t=Y(t,r,4),Ot(n,function(n,r,o){e=u?(u=b,n):t(e,n,r,o)}),e}function Pt(n,t,e){var r;if(t=_.createCallback(t,e,3),ze(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Ue(n,function(n,e,u){return!(r=t(n,e,u))
|
||||
});return!!r}function Nt(n){var r=-1,u=lt(),o=n?n.length:0,i=Z(arguments,m,m,1),f=[],c=o>=E&&u===t;if(c){var l=a(i);l?(u=e,i=l):c=b}for(;++r<o;)l=n[r],0>u(i,l)&&f.push(l);return c&&g(i),f}function Ft(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=d){var o=-1;for(t=_.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,r==d||e)return n[0];return v(n,0,Ae(Se(0,r),u))}}function Rt(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?Se(0,u+r):r||0}else if(r)return r=$t(n,e),n[r]===e?r:-1;
|
||||
return n?t(n,e,r):-1}function Dt(n,t,e){if(typeof t!="number"&&t!=d){var r=0,u=-1,o=n?n.length:0;for(t=_.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=t==d||e?1:Se(0,t);return v(n,r)}function $t(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?_.createCallback(e,r,1):Gt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function zt(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=r&&r[t]===n?y:t,t=b),e!=d&&(e=_.createCallback(e,r,3)),ut(n,t,e)}function Lt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?At(rr(n,"length")):0,r=Ht(0>e?0:e);++t<e;)r[t]=rr(n,t);
|
||||
return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function qt(n,t){return at(n,t,Pe.call(arguments,2),[])}function Kt(n,t,e){function r(){le(s),le(g),c=0,s=g=d}function u(){var t=v&&(!h||1<c);r(),t&&(p!==false&&(l=new Vt),i=n.apply(f,a))}function o(){r(),(v||p!==t)&&(l=new Vt,i=n.apply(f,a))}var a,i,f,c=0,l=0,p=b,s=d,g=d,v=m;if(t=Se(0,t||0),e===m)var h=m,v=b;else dt(e)&&(h=e.leading,p="maxWait"in e&&Se(t,e.maxWait||0),v="trailing"in e?e.trailing:v);
|
||||
return function(){if(a=arguments,f=this,c++,le(g),p===false)h&&2>c&&(i=n.apply(f,a));else{var e=new Vt;!s&&!h&&(l=e);var r=p-(e-l);0<r?s||(s=de(o,r)):(le(s),s=d,l=e,i=n.apply(f,a))}return t!==p&&(g=de(u,t)),i}}function Wt(n){var t=Pe.call(arguments,1);return de(function(){n.apply(y,t)},1)}function Gt(n){return n}function Jt(n,t){var e=n,r=!t||mt(e);t||(e=j,t=n,n=_),Et(ht(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return he.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:new e(r)
|
||||
})})}function Mt(){return this.__wrapped__}r=r?et.defaults(n.Object(),r,et.pick(n,z)):n;var Ht=r.Array,Ut=r.Boolean,Vt=r.Date,Qt=r.Function,Xt=r.Math,Yt=r.Number,Zt=r.Object,ne=r.RegExp,te=r.String,ee=r.TypeError,re=[],ue=r.Error.prototype,oe=Zt.prototype,ae=te.prototype,ie=r._,fe=ne("^"+te(oe.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ce=Xt.ceil,le=r.clearTimeout,pe=fe.test(pe=Zt.defineProperty)&&pe,se=Xt.floor,ge=fe.test(ge=Zt.getPrototypeOf)&&ge,ve=oe.hasOwnProperty,he=re.push,ye=oe.propertyIsEnumerable,me=r.setImmediate,de=r.setTimeout,be=re.splice,_e=oe.toString,je=re.unshift,we=fe.test(we=_e.bind)&&we,ke=fe.test(ke=Zt.create)&&ke,xe=fe.test(xe=Ht.isArray)&&xe,Ce=r.isFinite,Ee=r.isNaN,Oe=fe.test(Oe=Zt.keys)&&Oe,Se=Xt.max,Ae=Xt.min,Ie=r.parseInt,Be=Xt.random,Pe=re.slice,Ne=fe.test(r.attachEvent),Fe=we&&!/\n|true/.test(we+Ne),Re={};
|
||||
Re[q]=Ht,Re[K]=Ut,Re[W]=Vt,Re[J]=Qt,Re[H]=Zt,Re[M]=Yt,Re[U]=ne,Re[V]=te;var De={};De[q]=De[W]=De[M]={constructor:m,toLocaleString:m,toString:m,valueOf:m},De[K]=De[V]={constructor:m,toString:m,valueOf:m},De[G]=De[J]=De[U]={constructor:m,toString:m},De[H]={constructor:m},function(){for(var n=L.length;n--;){var t,e=L[n];for(t in De)ve.call(De,t)&&!ve.call(De[t],e)&&(De[t][e]=b)}}(),j.prototype=_.prototype;var $e=_.support={};!function(){function n(){this.x=1}var t={0:1,length:1},e=[];n.prototype={valueOf:1};
|
||||
for(var r in new n)e.push(r);for(r in arguments);$e.argsObject=arguments.constructor==Zt&&!(arguments instanceof Ht),$e.argsClass=_e.call(arguments)==T,$e.enumErrorProps=ye.call(ue,"message")||ye.call(ue,"name"),$e.enumPrototypes=ye.call(n,"prototype"),$e.fastBind=we&&!Fe,$e.ownLast="x"!=e[0],$e.nonEnumArgs=0!=r,$e.nonEnumShadows=!/valueOf/.test(e),$e.spliceObjects=(re.splice.call(t,0,1),!t[0]),$e.unindexedChars="xx"!="x"[0]+Zt("x")[0];try{$e.nodeClass=!(_e.call(document)==H&&!({toString:0}+""))}catch(u){$e.nodeClass=m
|
||||
}}(1),_.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:F,variable:"",imports:{_:_}},ke||(ft=function(n){if(dt(n)){p.prototype=n;var t=new p;p.prototype=d}return t||{}}),$e.argsClass||(gt=function(n){return n&&typeof n=="object"?ve.call(n,"callee"):b});var ze=xe||function(n){return n&&typeof n=="object"?_e.call(n)==q:b},Le=it({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),Te=Oe?function(n){return dt(n)?$e.enumPrototypes&&typeof n=="function"||$e.nonEnumArgs&&n.length&>(n)?Le(n):Oe(n):[]
|
||||
@@ -32,7 +32,7 @@ for(var r in new n)e.push(r);for(r in arguments);$e.argsObject=arguments.constru
|
||||
mt(/x/)&&(mt=function(n){return typeof n=="function"&&_e.call(n)==J});var Ze=ge?function(n){if(!n||_e.call(n)!=H||!$e.argsClass&>(n))return b;var t=n.valueOf,e=typeof t=="function"&&(e=ge(t))&&ge(e);return e?n==e||ge(n)==e:pt(n)}:pt,nr=ot(function(n,t,e){ve.call(n,e)?n[e]++:n[e]=1}),tr=ot(function(n,t,e){(ve.call(n,e)?n[e]:n[e]=[]).push(t)}),er=ot(function(n,t,e){n[e]=t}),rr=St;Fe&&nt&&typeof me=="function"&&(Wt=qt(me,r));var ur=8==Ie(S+"08")?Ie:function(n,t){return Ie(_t(n)?n.replace(R,""):n,t||0)
|
||||
};return _.after=function(n,t){return function(){return 1>--n?t.apply(this,arguments):void 0}},_.assign=Ve,_.at=function(n){var t=-1,e=Z(arguments,m,b,1),r=e.length,u=Ht(r);for($e.unindexedChars&&_t(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},_.bind=qt,_.bindAll=function(n){for(var t=1<arguments.length?Z(arguments,m,b,1):ht(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=qt(n[u],n)}return n},_.bindKey=function(n,t){return at(n,t,Pe.call(arguments,2),[],b,m)},_.chain=function(n){return n=new j(n),n.__chain__=m,n
|
||||
},_.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},_.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},_.countBy=nr,_.createCallback=function(n,t,e){var r=typeof n;if(n==d||"function"==r)return Y(n,t,e);if("object"!=r)return function(t){return t[n]};var u=Te(n),o=u[0],a=n[o];return 1!=u.length||a!==a||dt(a)?function(t){for(var e=u.length,r=b;e--&&(r=tt(t[u[e]],n[u[e]],d,m)););return r
|
||||
}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},_.debounce=Kt,_.defaults=Qe,_.defer=Wt,_.delay=function(n,t){var e=Pe.call(arguments,2);return de(function(){n.apply(y,e)},t)},_.difference=Nt,_.filter=xt,_.flatten=function(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=r&&r[t]===n?y:t,t=b),e!=d&&(n=St(n,e,r)),Z(n,t)},_.forEach=Et,_.forEachRight=Ot,_.forIn=Xe,_.forInRight=function(n,t,e){var r=-1,u=[];Xe(n,function(n,t){u.push(n,t)});var o=u.length;for(t=Y(t,e,3);++r<o&&t(u[r],u[++r],n)!==false;);return n
|
||||
}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},_.debounce=Kt,_.defaults=Qe,_.defer=Wt,_.delay=function(n,t){var e=Pe.call(arguments,2);return de(function(){n.apply(y,e)},t)},_.difference=Nt,_.filter=xt,_.flatten=function(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=r&&r[t]===n?y:t,t=b),e!=d&&(n=St(n,e,r)),Z(n,t)},_.forEach=Et,_.forEachRight=Ot,_.forIn=Xe,_.forInRight=function(n,t,e){var r=[];Xe(n,function(n,t){r.push(t,n)});var u=r.length;for(t=Y(t,e,3);u--&&t(r[u--],r[u],n)!==false;);return n
|
||||
},_.forOwn=Ye,_.forOwnRight=vt,_.functions=ht,_.groupBy=tr,_.indexBy=er,_.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&t!=d){var o=u;for(t=_.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=t==d||e?1:t||r;return v(n,0,Ae(Se(0,u-r),u))},_.intersection=function(n){for(var r=arguments,u=r.length,o=-1,i=f(),c=-1,l=lt(),p=n?n.length:0,v=[],h=f();++o<u;){var y=r[o];i[o]=l===t&&(y?y.length:0)>=E&&a(o?r[o]:h)}n:for(;++c<p;){var m=i[0],y=n[c];if(0>(m?e(m,y):l(h,y))){for(o=u,(m||h).push(y);--o;)if(m=i[o],0>(m?e(m,y):l(r[o],y)))continue n;
|
||||
v.push(y)}}for(;u--;)(m=i[u])&&g(m);return s(i),s(h),v},_.invert=yt,_.invoke=function(n,t){var e=Pe.call(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Ht(typeof o=="number"?o:0);return Et(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},_.keys=Te,_.map=St,_.max=At,_.memoize=function(n,t){function e(){var r=e.cache,u=C+(t?t.apply(this,arguments):arguments[0]);return ve.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},_.merge=function(n){var t=arguments,e=2;if(!dt(n))return n;
|
||||
if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=Y(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Pe.call(arguments,1,e),u=-1,o=f(),a=f();++u<e;)rt(n,t[u],r,o,a);return s(o),s(a),n},_.min=function(n,t,e){var r=1/0,o=r;if(!t&&ze(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=!t&&_t(n)?u:_.createCallback(t,e,3),Ue(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,o=n)});return o},_.omit=function(n,t,e){var r=lt(),u=typeof t=="function",o={};
|
||||
@@ -41,8 +41,8 @@ i in n&&(r[i]=n[i])}else t=_.createCallback(t,e,3),Xe(n,function(n,e,u){t(n,e,u)
|
||||
})},_.remove=function(n,t,e){var r=[];if(t=_.createCallback(t,e,3),ze(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&(r.push(o),be.call(n,e--,1),u--)}}else Ue(n,function(n,e,u){t(n,e,u)&&(r.push(n),delete u[e])});return r},_.rest=Dt,_.shuffle=function(n){var t=-1,e=n?n.length:0,r=Ht(typeof e=="number"?e:0);return Et(n,function(n){var e=se(Be()*(++t+1));r[t]=r[e],r[e]=n}),r},_.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,a=Ht(typeof u=="number"?u:0);for(t=_.createCallback(t,e,3),Et(n,function(n,e,u){var o=a[++r]=c();
|
||||
o.l=t(n,e,u),o.m=r,o.n=n}),u=a.length,a.sort(o);u--;)n=a[u],a[u]=n.n,g(n);return a},_.tap=function(n,t){return t(n),n},_.throttle=function(n,t,e){var r=m,u=m;return e===false?r=b:dt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=c(),e.leading=r,e.maxWait=t,e.trailing=u,n=Kt(n,t,e),g(e),n},_.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Ht(n);for(t=Y(t,e,1);++r<n;)u[r]=t(r);return u},_.toArray=function(n){return n&&typeof n.length=="number"?$e.unindexedChars&&_t(n)?n.split(""):v(n):jt(n)
|
||||
},_.transform=function(n,t,e,r){var u=ze(n);return t=Y(t,r,4),e==d&&(u?e=[]:(r=n&&n.constructor,e=ft(r&&r.prototype))),(u?Ue:Ye)(n,function(n,r,u){return t(e,n,r,u)}),e},_.union=function(){return ut(Z(arguments,m,m))},_.uniq=zt,_.values=jt,_.where=xt,_.without=function(n){return Nt(n,Pe.call(arguments,1))},_.wrap=function(n,t){return function(){var e=[n];return he.apply(e,arguments),t.apply(this,e)}},_.zip=Lt,_.zipObject=Tt,_.collect=St,_.drop=Dt,_.each=Et,_.extend=Ve,_.methods=ht,_.object=Tt,_.select=xt,_.tail=Dt,_.unique=zt,_.unzip=Lt,Jt(_),_.clone=function(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=t,t=b),O(n,t,typeof e=="function"&&Y(e,r,1))
|
||||
},_.cloneDeep=function(n,t,e){return O(n,m,typeof t=="function"&&Y(t,e,1))},_.contains=wt,_.escape=function(n){return n==d?"":te(n).replace(He,ct)},_.every=kt,_.find=Ct,_.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=_.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},_.findLast=function(n,t,e){var r;return t=_.createCallback(t,e),Ot(n,function(n,e,u){return t(n,e,u)?(r=n,b):void 0}),r},_.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=_.createCallback(t,e);r--&&!t(n[-1],-1,n););return-1
|
||||
},_.findKey=function(n,t,e){var r;return t=_.createCallback(t,e,3),Ye(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},_.findLastKey=function(n,t,e){var r;return t=_.createCallback(t,e),vt(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},_.has=function(n,t){return n?ve.call(n,t):b},_.identity=Gt,_.indexOf=Rt,_.isArguments=gt,_.isArray=ze,_.isBoolean=function(n){return n===m||n===false||_e.call(n)==K},_.isDate=function(n){return n?typeof n=="object"&&_e.call(n)==W:b},_.isElement=function(n){return n?1===n.nodeType:b
|
||||
},_.cloneDeep=function(n,t,e){return O(n,m,typeof t=="function"&&Y(t,e,1))},_.contains=wt,_.escape=function(n){return n==d?"":te(n).replace(He,ct)},_.every=kt,_.find=Ct,_.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=_.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},_.findLast=function(n,t,e){var r;return t=_.createCallback(t,e,3),Ot(n,function(n,e,u){return t(n,e,u)?(r=n,b):void 0}),r},_.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=_.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;
|
||||
return-1},_.findKey=function(n,t,e){var r;return t=_.createCallback(t,e,3),Ye(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},_.findLastKey=function(n,t,e){var r;return t=_.createCallback(t,e,3),vt(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},_.has=function(n,t){return n?ve.call(n,t):b},_.identity=Gt,_.indexOf=Rt,_.isArguments=gt,_.isArray=ze,_.isBoolean=function(n){return n===m||n===false||_e.call(n)==K},_.isDate=function(n){return n?typeof n=="object"&&_e.call(n)==W:b},_.isElement=function(n){return n?1===n.nodeType:b
|
||||
},_.isEmpty=function(n){var t=m;if(!n)return t;var e=_e.call(n),r=n.length;return e==q||e==V||($e.argsClass?e==T:gt(n))||e==H&&typeof r=="number"&&mt(n.splice)?!r:(Ye(n,function(){return t=b}),t)},_.isEqual=function(n,t,e,r){return tt(n,t,typeof e=="function"&&Y(e,r,2))},_.isFinite=function(n){return Ce(n)&&!Ee(parseFloat(n))},_.isFunction=mt,_.isNaN=function(n){return bt(n)&&n!=+n},_.isNull=function(n){return n===d},_.isNumber=bt,_.isObject=dt,_.isPlainObject=Ze,_.isRegExp=function(n){return n&&X[typeof n]?_e.call(n)==U:b
|
||||
},_.isString=_t,_.isUndefined=function(n){return typeof n=="undefined"},_.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Se(0,r+e):Ae(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},_.mixin=Jt,_.noConflict=function(){return r._=ie,this},_.parseInt=ur,_.random=function(n,t){n==d&&t==d&&(t=1),n=+n||0,t==d?(t=n,n=0):t=+t||0;var e=Be();return n%1||t%1?n+Ae(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+se(e*(t-n+1))},_.reduce=It,_.reduceRight=Bt,_.result=function(n,t){var e=n?n[t]:y;
|
||||
return mt(e)?n[t]():e},_.runInContext=h,_.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Te(n).length},_.some=Pt,_.sortedIndex=$t,_.template=function(n,t,e){var r=_.templateSettings;n||(n=""),e=Qe({},e,r);var u,o=Qe({},e.imports,r.imports),r=Te(o),o=jt(o),a=0,f=e.interpolate||D,c="__p+='",f=ne((e.escape||D).source+"|"+f.source+"|"+(f===F?P:D).source+"|"+(e.evaluate||D).source+"|$","g");n.replace(f,function(t,e,r,o,f,l){return r||(r=o),c+=n.slice(a,l).replace($,i),e&&(c+="'+__e("+e+")+'"),f&&(u=m,c+="';"+f+";__p+='"),r&&(c+="'+((__t=("+r+"))==null?'':__t)+'"),a=l+t.length,t
|
||||
|
||||
25
dist/lodash.js
vendored
25
dist/lodash.js
vendored
@@ -1650,7 +1650,7 @@
|
||||
*/
|
||||
function findLastKey(object, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forOwnRight(object, function(value, key, object) {
|
||||
if (callback(value, key, object)) {
|
||||
result = key;
|
||||
@@ -1727,17 +1727,16 @@
|
||||
* // => logs 'name' and 'bark' assuming `_.forIn ` logs 'bark' and 'name'
|
||||
*/
|
||||
function forInRight(object, callback, thisArg) {
|
||||
var index = -1,
|
||||
pairs = [];
|
||||
var pairs = [];
|
||||
|
||||
forIn(object, function(value, key) {
|
||||
pairs.push(value, key);
|
||||
pairs.push(key, value);
|
||||
});
|
||||
|
||||
var length = pairs.length;
|
||||
callback = baseCreateCallback(callback, thisArg, 3);
|
||||
while (++index < length) {
|
||||
if (callback(pairs[index], pairs[++index], object) === false) {
|
||||
while (length--) {
|
||||
if (callback(pairs[length--], pairs[length], object) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2868,7 +2867,7 @@
|
||||
*/
|
||||
function findLast(collection, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forEachRight(collection, function(value, index, collection) {
|
||||
if (callback(value, index, collection)) {
|
||||
result = value;
|
||||
@@ -2945,7 +2944,7 @@
|
||||
callback = baseCreateCallback(callback, thisArg, 3);
|
||||
forEach(collection, function(value, index, collection) {
|
||||
index = props ? props[--length] : --length;
|
||||
callback(iterable[index], index, collection);
|
||||
return callback(iterable[index], index, collection);
|
||||
});
|
||||
return collection;
|
||||
}
|
||||
@@ -3835,13 +3834,11 @@
|
||||
* // => 2
|
||||
*/
|
||||
function findLastIndex(array, callback, thisArg) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
var length = array ? array.length : 0;
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
while (length--) {
|
||||
if (callback(array[index], index, array)) {
|
||||
return index;
|
||||
if (callback(array[length], length, array)) {
|
||||
return length;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
10
dist/lodash.min.js
vendored
10
dist/lodash.min.js
vendored
@@ -18,7 +18,7 @@ return a&&(n=t[c]),(e.length||r.length)&&(de.apply(o,e),he.apply(o,r)),this inst
|
||||
}function vt(n){return n&&typeof n=="object"?be.call(n)==T:m}function gt(n,t,e){var r=ze(n),u=r.length;for(t=et(t,e,3);u--&&(e=r[u],!(t(n[e],e,n)===false)););return n}function ht(n){var t=[];return x(n,function(n,e){_t(n)&&t.push(e)}),t.sort()}function yt(n){for(var t=-1,e=ze(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function _t(n){return typeof n=="function"}function mt(n){return!(!n||!G[typeof n])}function bt(n){return typeof n=="number"||be.call(n)==K}function dt(n){return typeof n=="string"||be.call(n)==U
|
||||
}function wt(n){for(var t=-1,e=ze(n),r=e.length,u=Ht(r);++t<r;)u[t]=n[e[t]];return u}function jt(n,t,e){var r=-1,u=lt(),o=n?n.length:0,a=m;return e=(0>e?Ee(0,o+e):e)||0,o&&typeof o=="number"?a=-1<(dt(n)?n.indexOf(t,e):u(n,t,e)):d(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function kt(n,t,e){var r=y;t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else d(n,function(n,e,u){return r=!!t(n,e,u)});return r}function xt(n,t,e){var r=[];t=Z.createCallback(t,e,3),e=-1;
|
||||
var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}else d(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Ct(n,t,e){t=Z.createCallback(t,e,3),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return d(n,function(n,e,r){return t(n,e,r)?(u=n,m):void 0}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function Ot(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:et(t,e,3),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==false;);else d(n,t);return n
|
||||
}function Et(n,t,e){var r=n?n.length:0;if(typeof r!="number")var u=ze(n),r=u.length;return t=et(t,e,3),Ot(n,function(e,o,a){o=u?u[--r]:--r,t(n[o],o,a)}),n}function It(n,t,e){var r=-1,u=n?n.length:0;if(t=Z.createCallback(t,e,3),typeof u=="number")for(var o=Ht(u);++r<u;)o[r]=t(n[r],r,n);else o=[],d(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function St(n,t,e){var r=-1/0,o=r;if(!t&&Te(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=!t&&dt(n)?u:Z.createCallback(t,e,3),Ot(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,o=n)
|
||||
}function Et(n,t,e){var r=n?n.length:0;if(typeof r!="number")var u=ze(n),r=u.length;return t=et(t,e,3),Ot(n,function(e,o,a){return o=u?u[--r]:--r,t(n[o],o,a)}),n}function It(n,t,e){var r=-1,u=n?n.length:0;if(t=Z.createCallback(t,e,3),typeof u=="number")for(var o=Ht(u);++r<u;)o[r]=t(n[r],r,n);else o=[],d(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function St(n,t,e){var r=-1/0,o=r;if(!t&&Te(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=!t&&dt(n)?u:Z.createCallback(t,e,3),Ot(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,o=n)
|
||||
});return o}function At(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Ht(r);++e<r;)u[e]=n[e][t];return u||It(n,t)}function Nt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=et(t,r,4);var o=-1,a=n.length;if(typeof a=="number")for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n);else d(n,function(n,r,o){e=u?(u=m,n):t(e,n,r,o)});return e}function Rt(n,t,e,r){var u=3>arguments.length;return t=et(t,r,4),Et(n,function(n,r,o){e=u?(u=m,n):t(e,n,r,o)}),e}function Bt(n,t,e){var r;t=Z.createCallback(t,e,3),e=-1;
|
||||
var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else d(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function $t(n){var r=-1,u=lt(),o=n?n.length:0,i=rt(arguments,y,y,1),f=[],c=o>=k&&u===t;if(c){var l=a(i);l?(u=e,i=l):c=m}for(;++r<o;)l=n[r],0>u(i,l)&&f.push(l);return c&&s(i),f}function Dt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=_){var o=-1;for(t=Z.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,r==_||e)return n[0];return v(n,0,Ie(Ee(0,r),u))}}function Ft(n,e,r){if(typeof r=="number"){var u=n?n.length:0;
|
||||
r=0>r?Ee(0,u+r):r||0}else if(r)return r=zt(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Tt(n,t,e){if(typeof t!="number"&&t!=_){var r=0,u=-1,o=n?n.length:0;for(t=Z.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=t==_||e?1:Ee(0,t);return v(n,r)}function zt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?Z.createCallback(e,r,1):Ut,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function qt(n,t,e,r){return typeof t!="boolean"&&t!=_&&(r=e,e=r&&r[t]===n?h:t,t=m),e!=_&&(e=Z.createCallback(e,r,3)),at(n,t,e)
|
||||
@@ -28,9 +28,9 @@ r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return he.apply(r,arg
|
||||
$e[z]=Ht,$e[q]=Jt,$e[W]=Qt,$e[P]=Xt,$e[L]=ne,$e[K]=Zt,$e[M]=te,$e[U]=ee,nt.prototype=Z.prototype;var De=Z.support={};De.fastBind=we&&!Be,Z.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Z}};var Fe=le?function(n,t){var e=c();e.value=t,le(n,"__bindData__",e),s(e)}:l,Te=ke,ze=Oe?function(n){return mt(n)?Oe(n):[]}:X,qe={"&":"&","<":"<",">":">",'"':""","'":"'"},We=yt(qe),Pe=te("("+ze(We).join("|")+")","g"),Ke=te("["+ze(qe).join("")+"]","g"),Le=it(function(n,t,e){ge.call(n,e)?n[e]++:n[e]=1
|
||||
}),Me=it(function(n,t,e){(ge.call(n,e)?n[e]:n[e]=[]).push(t)}),Ue=it(function(n,t,e){n[e]=t});Be&&Q&&typeof ye=="function"&&(Mt=Kt(ye,r));var Ve=8==Se(C+"08")?Se:function(n,t){return Se(dt(n)?n.replace(R,""):n,t||0)};return Z.after=function(n,t){return function(){return 1>--n?t.apply(this,arguments):void 0}},Z.assign=J,Z.at=function(n){for(var t=-1,e=rt(arguments,y,m,1),r=e.length,u=Ht(r);++t<r;)u[t]=n[e[t]];return u},Z.bind=Kt,Z.bindAll=function(n){for(var t=1<arguments.length?rt(arguments,y,m,1):ht(n),e=-1,r=t.length;++e<r;){var u=t[e];
|
||||
n[u]=Kt(n[u],n)}return n},Z.bindKey=function(n,t){return ft(n,t,Ne.call(arguments,2),[],m,y)},Z.chain=function(n){return n=new nt(n),n.__chain__=y,n},Z.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},Z.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},Z.countBy=Le,Z.createCallback=function(n,t,e){var r=typeof n;if(n==_||"function"==r)return et(n,t,e);if("object"!=r)return function(t){return t[n]
|
||||
};var u=ze(n),o=u[0],a=n[o];return 1!=u.length||a!==a||mt(a)?function(t){for(var e=u.length,r=m;e--&&(r=ut(t[u[e]],n[u[e]],_,y)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},Z.debounce=Lt,Z.defaults=H,Z.defer=Mt,Z.delay=function(n,t){var e=Ne.call(arguments,2);return _e(function(){n.apply(h,e)},t)},Z.difference=$t,Z.filter=xt,Z.flatten=function(n,t,e,r){return typeof t!="boolean"&&t!=_&&(r=e,e=r&&r[t]===n?h:t,t=m),e!=_&&(n=It(n,e,r)),rt(n,t)},Z.forEach=Ot,Z.forEachRight=Et,Z.forIn=x,Z.forInRight=function(n,t,e){var r=-1,u=[];
|
||||
x(n,function(n,t){u.push(n,t)});var o=u.length;for(t=et(t,e,3);++r<o&&t(u[r],u[++r],n)!==false;);return n},Z.forOwn=d,Z.forOwnRight=gt,Z.functions=ht,Z.groupBy=Me,Z.indexBy=Ue,Z.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&t!=_){var o=u;for(t=Z.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=t==_||e?1:t||r;return v(n,0,Ie(Ee(0,u-r),u))},Z.intersection=function(n){for(var r=arguments,u=r.length,o=-1,i=f(),c=-1,l=lt(),v=n?n.length:0,g=[],h=f();++o<u;){var y=r[o];
|
||||
i[o]=l===t&&(y?y.length:0)>=k&&a(o?r[o]:h)}n:for(;++c<v;){var _=i[0],y=n[c];if(0>(_?e(_,y):l(h,y))){for(o=u,(_||h).push(y);--o;)if(_=i[o],0>(_?e(_,y):l(r[o],y)))continue n;g.push(y)}}for(;u--;)(_=i[u])&&s(_);return p(i),p(h),g},Z.invert=yt,Z.invoke=function(n,t){var e=Ne.call(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Ht(typeof o=="number"?o:0);return Ot(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},Z.keys=ze,Z.map=It,Z.max=St,Z.memoize=function(n,t){function e(){var r=e.cache,u=j+(t?t.apply(this,arguments):arguments[0]);
|
||||
};var u=ze(n),o=u[0],a=n[o];return 1!=u.length||a!==a||mt(a)?function(t){for(var e=u.length,r=m;e--&&(r=ut(t[u[e]],n[u[e]],_,y)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},Z.debounce=Lt,Z.defaults=H,Z.defer=Mt,Z.delay=function(n,t){var e=Ne.call(arguments,2);return _e(function(){n.apply(h,e)},t)},Z.difference=$t,Z.filter=xt,Z.flatten=function(n,t,e,r){return typeof t!="boolean"&&t!=_&&(r=e,e=r&&r[t]===n?h:t,t=m),e!=_&&(n=It(n,e,r)),rt(n,t)},Z.forEach=Ot,Z.forEachRight=Et,Z.forIn=x,Z.forInRight=function(n,t,e){var r=[];
|
||||
x(n,function(n,t){r.push(t,n)});var u=r.length;for(t=et(t,e,3);u--&&t(r[u--],r[u],n)!==false;);return n},Z.forOwn=d,Z.forOwnRight=gt,Z.functions=ht,Z.groupBy=Me,Z.indexBy=Ue,Z.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&t!=_){var o=u;for(t=Z.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=t==_||e?1:t||r;return v(n,0,Ie(Ee(0,u-r),u))},Z.intersection=function(n){for(var r=arguments,u=r.length,o=-1,i=f(),c=-1,l=lt(),v=n?n.length:0,g=[],h=f();++o<u;){var y=r[o];i[o]=l===t&&(y?y.length:0)>=k&&a(o?r[o]:h)
|
||||
}n:for(;++c<v;){var _=i[0],y=n[c];if(0>(_?e(_,y):l(h,y))){for(o=u,(_||h).push(y);--o;)if(_=i[o],0>(_?e(_,y):l(r[o],y)))continue n;g.push(y)}}for(;u--;)(_=i[u])&&s(_);return p(i),p(h),g},Z.invert=yt,Z.invoke=function(n,t){var e=Ne.call(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Ht(typeof o=="number"?o:0);return Ot(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},Z.keys=ze,Z.map=It,Z.max=St,Z.memoize=function(n,t){function e(){var r=e.cache,u=j+(t?t.apply(this,arguments):arguments[0]);
|
||||
return ge.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},Z.merge=function(n){var t=arguments,e=2;if(!mt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=et(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Ne.call(arguments,1,e),u=-1,o=f(),a=f();++u<e;)ot(n,t[u],r,o,a);return p(o),p(a),n},Z.min=function(n,t,e){var r=1/0,o=r;if(!t&&Te(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=!t&&dt(n)?u:Z.createCallback(t,e,3),Ot(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,o=n)
|
||||
});return o},Z.omit=function(n,t,e){var r=lt(),u=typeof t=="function",o={};if(u)t=Z.createCallback(t,e,3);else var a=rt(arguments,y,m,1);return x(n,function(n,e,i){(u?!t(n,e,i):0>r(a,e))&&(o[e]=n)}),o},Z.once=function(n){var t,e;return function(){return t?e:(t=y,e=n.apply(this,arguments),n=_,e)}},Z.pairs=function(n){for(var t=-1,e=ze(n),r=e.length,u=Ht(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},Z.partial=function(n){return ft(n,_,Ne.call(arguments,1),[],y)},Z.partialRight=function(n){return ft(n,_,[],Ne.call(arguments,1),y,y)
|
||||
},Z.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=rt(arguments,y,m,1),a=mt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=Z.createCallback(t,e,3),x(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},Z.pluck=At,Z.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(me.call(n,o--,1),u--);return n},Z.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:1,t==_&&(t=n,n=0);var r=-1;t=Ee(0,fe((t-n)/(e||1)));for(var u=Ht(t);++r<t;)u[r]=n,n+=e;
|
||||
@@ -38,7 +38,7 @@ return u},Z.reject=function(n,t,e){return t=Z.createCallback(t,e,3),xt(n,functio
|
||||
},Z.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,a=Ht(typeof u=="number"?u:0);for(t=Z.createCallback(t,e,3),Ot(n,function(n,e,u){var o=a[++r]=c();o.l=t(n,e,u),o.m=r,o.n=n}),u=a.length,a.sort(o);u--;)n=a[u],a[u]=n.n,s(n);return a},Z.tap=function(n,t){return t(n),n},Z.throttle=function(n,t,e){var r=y,u=y;return e===false?r=m:mt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=c(),e.leading=r,e.maxWait=t,e.trailing=u,n=Lt(n,t,e),s(e),n},Z.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Ht(n);
|
||||
for(t=et(t,e,1);++r<n;)u[r]=t(r);return u},Z.toArray=function(n){return n&&typeof n.length=="number"?v(n):wt(n)},Z.transform=function(n,t,e,r){var u=Te(n);return t=et(t,r,4),e==_&&(u?e=[]:(r=n&&n.constructor,e=mt(r&&r.prototype)?je(r&&r.prototype):{})),(u?Ot:d)(n,function(n,r,u){return t(e,n,r,u)}),e},Z.union=function(){return at(rt(arguments,y,y))},Z.uniq=qt,Z.values=wt,Z.where=xt,Z.without=function(n){return $t(n,Ne.call(arguments,1))},Z.wrap=function(n,t){return function(){var e=[n];return he.apply(e,arguments),t.apply(this,e)
|
||||
}},Z.zip=Wt,Z.zipObject=Pt,Z.collect=It,Z.drop=Tt,Z.each=Ot,Z.extend=J,Z.methods=ht,Z.object=Pt,Z.select=xt,Z.tail=Tt,Z.unique=qt,Z.unzip=Wt,Vt(Z),Z.clone=function(n,t,e,r){return typeof t!="boolean"&&t!=_&&(r=e,e=t,t=m),tt(n,t,typeof e=="function"&&et(e,r,1))},Z.cloneDeep=function(n,t,e){return tt(n,y,typeof t=="function"&&et(t,e,1))},Z.contains=jt,Z.escape=function(n){return n==_?"":ee(n).replace(Ke,ct)},Z.every=kt,Z.find=Ct,Z.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=Z.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;
|
||||
return-1},Z.findLast=function(n,t,e){var r;return t=Z.createCallback(t,e),Et(n,function(n,e,u){return t(n,e,u)?(r=n,m):void 0}),r},Z.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=Z.createCallback(t,e);r--&&!t(n[-1],-1,n););return-1},Z.findKey=function(n,t,e){var r;return t=Z.createCallback(t,e,3),d(n,function(n,e,u){return t(n,e,u)?(r=e,m):void 0}),r},Z.findLastKey=function(n,t,e){var r;return t=Z.createCallback(t,e),gt(n,function(n,e,u){return t(n,e,u)?(r=e,m):void 0}),r},Z.has=function(n,t){return n?ge.call(n,t):m
|
||||
return-1},Z.findLast=function(n,t,e){var r;return t=Z.createCallback(t,e,3),Et(n,function(n,e,u){return t(n,e,u)?(r=n,m):void 0}),r},Z.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=Z.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},Z.findKey=function(n,t,e){var r;return t=Z.createCallback(t,e,3),d(n,function(n,e,u){return t(n,e,u)?(r=e,m):void 0}),r},Z.findLastKey=function(n,t,e){var r;return t=Z.createCallback(t,e,3),gt(n,function(n,e,u){return t(n,e,u)?(r=e,m):void 0}),r},Z.has=function(n,t){return n?ge.call(n,t):m
|
||||
},Z.identity=Ut,Z.indexOf=Ft,Z.isArguments=vt,Z.isArray=Te,Z.isBoolean=function(n){return n===y||n===false||be.call(n)==q},Z.isDate=function(n){return n?typeof n=="object"&&be.call(n)==W:m},Z.isElement=function(n){return n?1===n.nodeType:m},Z.isEmpty=function(n){var t=y;if(!n)return t;var e=be.call(n),r=n.length;return e==z||e==U||e==T||e==L&&typeof r=="number"&&_t(n.splice)?!r:(d(n,function(){return t=m}),t)},Z.isEqual=function(n,t,e,r){return ut(n,t,typeof e=="function"&&et(e,r,2))},Z.isFinite=function(n){return xe(n)&&!Ce(parseFloat(n))
|
||||
},Z.isFunction=_t,Z.isNaN=function(n){return bt(n)&&n!=+n},Z.isNull=function(n){return n===_},Z.isNumber=bt,Z.isObject=mt,Z.isPlainObject=b,Z.isRegExp=function(n){return n?typeof n=="object"&&be.call(n)==M:m},Z.isString=dt,Z.isUndefined=function(n){return typeof n=="undefined"},Z.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ee(0,r+e):Ie(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Z.mixin=Vt,Z.noConflict=function(){return r._=ae,this},Z.parseInt=Ve,Z.random=function(n,t){n==_&&t==_&&(t=1),n=+n||0,t==_?(t=n,n=0):t=+t||0;
|
||||
var e=Ae();return n%1||t%1?n+Ie(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+pe(e*(t-n+1))},Z.reduce=Nt,Z.reduceRight=Rt,Z.result=function(n,t){var e=n?n[t]:h;return _t(e)?n[t]():e},Z.runInContext=g,Z.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ze(n).length},Z.some=Bt,Z.sortedIndex=zt,Z.template=function(n,t,e){var r=Z.templateSettings;n||(n=""),e=H({},e,r);var u,o=H({},e.imports,r.imports),r=ze(o),o=wt(o),a=0,f=e.interpolate||B,c="__p+='",f=te((e.escape||B).source+"|"+f.source+"|"+(f===N?S:B).source+"|"+(e.evaluate||B).source+"|$","g");
|
||||
|
||||
14
dist/lodash.underscore.js
vendored
14
dist/lodash.underscore.js
vendored
@@ -1896,7 +1896,7 @@
|
||||
}
|
||||
} else {
|
||||
forOwn(collection, callback);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1916,7 +1916,7 @@
|
||||
* _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(',');
|
||||
* // => logs each number from right to left and returns '3,2,1'
|
||||
*/
|
||||
function forEachRight(collection, callback, thisArg) {
|
||||
function forEachRight(collection, callback) {
|
||||
var iterable = collection,
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
@@ -1924,12 +1924,10 @@
|
||||
var props = keys(collection);
|
||||
length = props.length;
|
||||
}
|
||||
callback = baseCreateCallback(callback, thisArg, 3);
|
||||
forEach(collection, function(value, index, collection) {
|
||||
index = props ? props[--length] : --length;
|
||||
callback(iterable[index], index, collection);
|
||||
return callback(iterable[index], index, collection) === false && indicatorObject;
|
||||
});
|
||||
return collection;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4145,7 +4143,9 @@
|
||||
* ');
|
||||
*/
|
||||
function template(text, data, options) {
|
||||
var settings = lodash.templateSettings;
|
||||
var _ = lodash,
|
||||
settings = _.templateSettings;
|
||||
|
||||
text || (text = '');
|
||||
options = defaults({}, options, settings);
|
||||
|
||||
@@ -4186,7 +4186,7 @@
|
||||
'return __p\n}';
|
||||
|
||||
try {
|
||||
var result = Function('_', 'return ' + source)(lodash);
|
||||
var result = Function('_', 'return ' + source)(_);
|
||||
} catch(e) {
|
||||
e.source = source;
|
||||
throw e;
|
||||
|
||||
6
dist/lodash.underscore.min.js
vendored
6
dist/lodash.underscore.min.js
vendored
@@ -11,7 +11,7 @@ if(i!=ht)return ut;var i=n.constructor,a=t.constructor;if(i!=a&&(!E(i)||!(i inst
|
||||
}return o}function y(n){return T(n)?Dt(n):{}}function m(n){return Kt[n]}function _(){var n=(n=f.indexOf)===H?u:n;return n}function d(n){return Lt[n]}function b(n){return n&&typeof n=="object"?Rt.call(n)==lt:ut}function j(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function w(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function x(n){var t=[];
|
||||
return r(n,function(n,r){E(n)&&t.push(r)}),t.sort()}function A(n){for(var t=-1,r=Jt(n),e=r.length,u={};++t<e;){var i=r[t];u[n[i]]=i}return u}function O(n){if(!n)return rt;if(Ht(n)||F(n))return!n.length;for(var t in n)if(Ft.call(n,t))return ut;return rt}function E(n){return typeof n=="function"}function T(n){return!(!n||!_t[typeof n])}function S(n){return typeof n=="number"||Rt.call(n)==gt}function F(n){return typeof n=="string"||Rt.call(n)==mt}function N(n){for(var t=-1,r=Jt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];
|
||||
return u}function R(n,r){var e=_(),u=n?n.length:0,i=ut;return u&&typeof u=="number"?i=-1<e(n,r):t(n,function(n){return(i=n===r)&&ot}),i}function k(n,r,e){var u=rt;r=X(r,e,3),e=-1;var i=n?n.length:0;if(typeof i=="number")for(;++e<i&&(u=!!r(n[e],e,n)););else t(n,function(n,t,e){return!(u=!!r(n,t,e))&&ot});return u}function B(n,r,e){var u=[];r=X(r,e,3),e=-1;var i=n?n.length:0;if(typeof i=="number")for(;++e<i;){var o=n[e];r(o,e,n)&&u.push(o)}else t(n,function(n,t,e){r(n,t,e)&&u.push(n)});return u}function D(n,r,e){r=X(r,e,3),e=-1;
|
||||
var u=n?n.length:0;if(typeof u!="number"){var i;return t(n,function(n,t,e){return r(n,t,e)?(i=n,ot):void 0}),i}for(;++e<u;){var o=n[e];if(r(o,e,n))return o}}function q(n,r,e){var u=-1,i=n?n.length:0;if(r=r&&typeof e=="undefined"?r:l(r,e,3),typeof i=="number")for(;++u<i&&r(n[u],u,n)!==ot;);else t(n,r)}function M(n,t){var r=n?n.length:0;if(typeof r!="number")var e=Jt(n),r=e.length;t=l(t,void 0,3),q(n,function(u,i,o){i=e?e[--r]:--r,t(n[i],i,o)})}function $(n,r,e){var u=-1,i=n?n.length:0;if(r=X(r,e,3),typeof i=="number")for(var o=Array(i);++u<i;)o[u]=r(n[u],u,n);
|
||||
var u=n?n.length:0;if(typeof u!="number"){var i;return t(n,function(n,t,e){return r(n,t,e)?(i=n,ot):void 0}),i}for(;++e<u;){var o=n[e];if(r(o,e,n))return o}}function q(n,r,e){var u=-1,i=n?n.length:0;if(r=r&&typeof e=="undefined"?r:l(r,e,3),typeof i=="number")for(;++u<i&&r(n[u],u,n)!==ot;);else t(n,r)}function M(n,t){var r=n?n.length:0;if(typeof r!="number")var e=Jt(n),r=e.length;q(n,function(u,i,o){return i=e?e[--r]:--r,t(n[i],i,o)===ut&&ot})}function $(n,r,e){var u=-1,i=n?n.length:0;if(r=X(r,e,3),typeof i=="number")for(var o=Array(i);++u<i;)o[u]=r(n[u],u,n);
|
||||
else o=[],t(n,function(n,t,e){o[++u]=r(n,t,e)});return o}function I(n,t,r){var e=-1/0,u=e,i=-1,o=n?n.length:0;if(t||typeof o!="number")t=X(t,r,3),q(n,function(n,r,i){r=t(n,r,i),r>e&&(e=r,u=n)});else for(;++i<o;)r=n[i],r>u&&(u=r);return u}function W(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++r<e;)u[r]=n[r][t];return u||$(n,t)}function z(n,r,e,u){if(!n)return e;var i=3>arguments.length;r=l(r,u,4);var o=-1,a=n.length;if(typeof a=="number")for(i&&(e=n[++o]);++o<a;)e=r(e,n[o],o,n);
|
||||
else t(n,function(n,t,u){e=i?(i=ut,n):r(e,n,t,u)});return e}function C(n,t,r,e){var u=3>arguments.length;return t=l(t,e,4),M(n,function(n,e,i){r=u?(u=ut,n):t(r,n,e,i)}),r}function P(n,r,e){var u;r=X(r,e,3),e=-1;var i=n?n.length:0;if(typeof i=="number")for(;++e<i&&!(u=r(n[e],e,n)););else t(n,function(n,t,e){return(u=r(n,t,e))&&ot});return!!u}function U(n,t,r){return r&&O(t)?tt:(r?D:B)(n,t)}function V(n){for(var t=-1,r=_(),e=n.length,u=p(arguments,rt,rt,1),i=[];++t<e;){var o=n[t];0>r(u,o)&&i.push(o)
|
||||
}return i}function G(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=et){var i=-1;for(t=X(t,r,3);++i<u&&t(n[i],i,n);)e++}else if(e=t,e==et||r)return n[0];return Pt.call(n,0,zt(Wt(0,e),u))}}function H(n,t,r){if(typeof r=="number"){var e=n?n.length:0;r=0>r?Wt(0,e+r):r||0}else if(r)return r=K(n,t),n[r]===t?r:-1;return n?u(n,t,r):-1}function J(n,t,r){if(typeof t!="number"&&t!=et){var e=0,u=-1,i=n?n.length:0;for(t=X(t,r,3);++u<i&&t(n[u],u,n);)e++}else e=t==et||r?1:Wt(0,t);return Pt.call(n,e)
|
||||
@@ -30,7 +30,7 @@ return r===ut?e=ut:T(r)&&(e="leading"in r?r.leading:e,u="trailing"in r?r.trailin
|
||||
}},f.zip=function(){for(var n=-1,t=I(W(arguments,"length")),r=Array(0>t?0:t);++n<t;)r[n]=W(arguments,n);return r},f.collect=$,f.drop=J,f.each=q,f.extend=j,f.methods=x,f.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var i=n[r];t?u[i]=t[r]:i&&(u[i[0]]=i[1])}return u},f.select=B,f.tail=J,f.unique=L,f.clone=function(n){return T(n)?Ht(n)?Pt.call(n):j({},n):n},f.contains=R,f.escape=function(n){return n==et?"":(n+"").replace(Xt,m)},f.every=k,f.find=D,f.has=function(n,t){return n?Ft.call(n,t):ut
|
||||
},f.identity=Z,f.indexOf=H,f.isArguments=b,f.isArray=Ht,f.isBoolean=function(n){return n===rt||n===ut||Rt.call(n)==st},f.isDate=function(n){return n?typeof n=="object"&&Rt.call(n)==vt:ut},f.isElement=function(n){return n?1===n.nodeType:ut},f.isEmpty=O,f.isEqual=function(n,t){return s(n,t)},f.isFinite=function(n){return Mt(n)&&!$t(parseFloat(n))},f.isFunction=E,f.isNaN=function(n){return S(n)&&n!=+n},f.isNull=function(n){return n===et},f.isNumber=S,f.isObject=T,f.isRegExp=function(n){return n&&_t[typeof n]?Rt.call(n)==yt:ut
|
||||
},f.isString=F,f.isUndefined=function(n){return typeof n=="undefined"},f.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Wt(0,e+r):zt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},f.mixin=nt,f.noConflict=function(){return n._=Ot,this},f.random=function(n,t){n==et&&t==et&&(t=1),n=+n||0,t==et?(t=n,n=0):t=+t||0;var r=Ct();return n%1||t%1?n+zt(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+St(r*(t-n+1))},f.reduce=z,f.reduceRight=C,f.result=function(n,t){var r=n?n[t]:tt;
|
||||
return E(r)?n[t]():r},f.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Jt(n).length},f.some=P,f.sortedIndex=K,f.template=function(n,t,r){var e=f.templateSettings;n||(n=""),r=w({},r,e);var u=0,i="__p+='",e=r.variable;n.replace(RegExp((r.escape||ft).source+"|"+(r.interpolate||ft).source+"|"+(r.evaluate||ft).source+"|$","g"),function(t,r,e,a,f){return i+=n.slice(u,f).replace(ct,o),r&&(i+="'+_.escape("+r+")+'"),a&&(i+="';"+a+";__p+='"),e&&(i+="'+((__t=("+e+"))==null?'':__t)+'"),u=f+t.length,t
|
||||
}),i+="';\n",e||(e="obj",i="with("+e+"||{}){"+i+"}"),i="function("+e+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+i+"return __p}";try{var a=Function("_","return "+i)(f)}catch(c){throw c.source=i,c}return t?a(t):(a.source=i,a)},f.unescape=function(n){return n==et?"":(n+"").replace(Qt,d)},f.uniqueId=function(n){var t=++it+"";return n?n+t:t},f.all=k,f.any=P,f.detect=D,f.findWhere=function(n,t){return U(n,t,rt)},f.foldl=z,f.foldr=C,f.include=R,f.inject=z,f.first=G,f.last=function(n,t,r){if(n){var e=0,u=n.length;
|
||||
return E(r)?n[t]():r},f.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Jt(n).length},f.some=P,f.sortedIndex=K,f.template=function(n,t,r){var e=f,u=e.templateSettings;n||(n=""),r=w({},r,u);var i=0,a="__p+='",u=r.variable;n.replace(RegExp((r.escape||ft).source+"|"+(r.interpolate||ft).source+"|"+(r.evaluate||ft).source+"|$","g"),function(t,r,e,u,f){return a+=n.slice(i,f).replace(ct,o),r&&(a+="'+_.escape("+r+")+'"),u&&(a+="';"+u+";__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),i=f+t.length,t
|
||||
}),a+="';\n",u||(u="obj",a="with("+u+"||{}){"+a+"}"),a="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var c=Function("_","return "+a)(e)}catch(l){throw l.source=a,l}return t?c(t):(c.source=a,c)},f.unescape=function(n){return n==et?"":(n+"").replace(Qt,d)},f.uniqueId=function(n){var t=++it+"";return n?n+t:t},f.all=k,f.any=P,f.detect=D,f.findWhere=function(n,t){return U(n,t,rt)},f.foldl=z,f.foldr=C,f.include=R,f.inject=z,f.first=G,f.last=function(n,t,r){if(n){var e=0,u=n.length;
|
||||
if(typeof t!="number"&&t!=et){var i=u;for(t=X(t,r,3);i--&&t(n[i],i,n);)e++}else if(e=t,e==et||r)return n[u-1];return Pt.call(n,Wt(0,u-e))}},f.take=G,f.head=G,nt(f),f.VERSION="1.3.1",f.prototype.chain=function(){return this.__chain__=rt,this},f.prototype.value=function(){return this.__wrapped__},q("pop push reverse shift sort splice unshift".split(" "),function(n){var t=xt[n];f.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!Gt.spliceObjects&&0===n.length&&delete n[0],this
|
||||
}}),q(["concat","join","slice"],function(n){var t=xt[n];f.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new c(n),n.__chain__=rt),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=f, define(function(){return f})):bt&&!bt.nodeType?jt?(jt.exports=f)._=f:bt._=f:n._=f}(this);
|
||||
208
doc/README.md
208
doc/README.md
@@ -229,7 +229,7 @@
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_compactarray"></a>`_.compact(array)`
|
||||
<a href="#_compactarray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4086 "View in source") [Ⓣ][1]
|
||||
<a href="#_compactarray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4085 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey.
|
||||
|
||||
@@ -253,7 +253,7 @@ _.compact([0, 1, false, 2, '', 3]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_differencearray--array1-array2-"></a>`_.difference(array [, array1, array2, ...])`
|
||||
<a href="#_differencearray--array1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4115 "View in source") [Ⓣ][1]
|
||||
<a href="#_differencearray--array1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4114 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array excluding all values of the provided arrays using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -278,7 +278,7 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_findindexarray--callbackidentity-thisarg"></a>`_.findIndex(array [, callback=identity, thisArg])`
|
||||
<a href="#_findindexarray--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4165 "View in source") [Ⓣ][1]
|
||||
<a href="#_findindexarray--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4164 "View in source") [Ⓣ][1]
|
||||
|
||||
This method is like `_.find`, except that it returns the index of the first element that passes the callback check, instead of the element itself.
|
||||
|
||||
@@ -306,7 +306,7 @@ _.findIndex(['apple', 'banana', 'beet'], function(food) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_findlastindexarray--callbackidentity-thisarg"></a>`_.findLastIndex(array [, callback=identity, thisArg])`
|
||||
<a href="#_findlastindexarray--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4198 "View in source") [Ⓣ][1]
|
||||
<a href="#_findlastindexarray--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4197 "View in source") [Ⓣ][1]
|
||||
|
||||
This method is like `_.findIndex`, except that it iterates over elements of a `collection` from right to left.
|
||||
|
||||
@@ -334,7 +334,7 @@ _.findLastIndex(['apple', 'banana', 'beet'], function(food) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_firstarray--callbackn-thisarg"></a>`_.first(array [, callback|n, thisArg])`
|
||||
<a href="#_firstarray--callbackn-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4268 "View in source") [Ⓣ][1]
|
||||
<a href="#_firstarray--callbackn-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4265 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the first element of the `array`. If a number `n` is provided, the first `n` elements of the `array` are returned. If a `callback` function is provided, elements at the beginning of the array are returned as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -394,7 +394,7 @@ _.first(food, { 'type': 'fruit' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_flattenarray--isshallowfalse-callbackidentity-thisarg"></a>`_.flatten(array [, isShallow=false, callback=identity, thisArg])`
|
||||
<a href="#_flattenarray--isshallowfalse-callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4330 "View in source") [Ⓣ][1]
|
||||
<a href="#_flattenarray--isshallowfalse-callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4327 "View in source") [Ⓣ][1]
|
||||
|
||||
Flattens a nested array *(the nesting can be to any depth)*. If `isShallow` is truthy, `array` will only be flattened a single level. If `callback` is provided, each element of `array` is provided through a `callback` before flattening. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -437,7 +437,7 @@ _.flatten(stooges, 'quotes');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_indexofarray-value--fromindex0"></a>`_.indexOf(array, value [, fromIndex=0])`
|
||||
<a href="#_indexofarray-value--fromindex0">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4367 "View in source") [Ⓣ][1]
|
||||
<a href="#_indexofarray-value--fromindex0">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4364 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `fromIndex` will run a faster binary search.
|
||||
|
||||
@@ -469,7 +469,7 @@ _.indexOf([1, 1, 2, 2, 3, 3], 2, true);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_initialarray--callbackn1-thisarg"></a>`_.initial(array [, callback|n=1, thisArg])`
|
||||
<a href="#_initialarray--callbackn1-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4434 "View in source") [Ⓣ][1]
|
||||
<a href="#_initialarray--callbackn1-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4431 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets all but the last element of `array`. If a number `n` is provided, the last `n` elements are excluded from the result. If a `callback` function is provided, elements at the end of the array are excluded from the result as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -526,7 +526,7 @@ _.initial(food, { 'type': 'vegetable' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_intersectionarray1-array2-"></a>`_.intersection([array1, array2, ...])`
|
||||
<a href="#_intersectionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4467 "View in source") [Ⓣ][1]
|
||||
<a href="#_intersectionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4464 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of unique values present in all provided arrays using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -550,7 +550,7 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_lastarray--callbackn-thisarg"></a>`_.last(array [, callback|n, thisArg])`
|
||||
<a href="#_lastarray--callbackn-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4569 "View in source") [Ⓣ][1]
|
||||
<a href="#_lastarray--callbackn-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4566 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the last element of the `array`. If a number `n` is provided, the last `n` elements of the `array` are returned. If a `callback` function is provided, elements at the end of the array are returned as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments;(value, index, array).
|
||||
|
||||
@@ -607,7 +607,7 @@ _.last(food, { 'type': 'vegetable' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_lastindexofarray-value--fromindexarraylength-1"></a>`_.lastIndexOf(array, value [, fromIndex=array.length-1])`
|
||||
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4610 "View in source") [Ⓣ][1]
|
||||
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4607 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection.
|
||||
|
||||
@@ -636,7 +636,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_pullarray--value1-value2-"></a>`_.pull(array [, value1, value2, ...])`
|
||||
<a href="#_pullarray--value1-value2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4640 "View in source") [Ⓣ][1]
|
||||
<a href="#_pullarray--value1-value2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4637 "View in source") [Ⓣ][1]
|
||||
|
||||
Removes all provided values from the given array using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -663,7 +663,7 @@ console.log(array);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_rangestart0-end--step1"></a>`_.range([start=0], end [, step=1])`
|
||||
<a href="#_rangestart0-end--step1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4691 "View in source") [Ⓣ][1]
|
||||
<a href="#_rangestart0-end--step1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4688 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`. If `start` is less than `stop` a zero-length range is created unless a negative `step` is specified.
|
||||
|
||||
@@ -704,7 +704,7 @@ _.range(0);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_restarray--callbackn1-thisarg"></a>`_.rest(array [, callback|n=1, thisArg])`
|
||||
<a href="#_restarray--callbackn1-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4770 "View in source") [Ⓣ][1]
|
||||
<a href="#_restarray--callbackn1-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4767 "View in source") [Ⓣ][1]
|
||||
|
||||
The opposite of `_.initial`, this method gets all but the first value of `array`. If a number `n` is provided, the first `n` values are excluded from the result. If a `callback` function is provided, elements at the beginning of the array are excluded from the result as long as the `callback` returns truthy. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -764,7 +764,7 @@ _.rest(food, { 'type': 'fruit' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_sortedindexarray-value--callbackidentity-thisarg"></a>`_.sortedIndex(array, value [, callback=identity, thisArg])`
|
||||
<a href="#_sortedindexarray-value--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4834 "View in source") [Ⓣ][1]
|
||||
<a href="#_sortedindexarray-value--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4831 "View in source") [Ⓣ][1]
|
||||
|
||||
Uses a binary search to determine the smallest index at which the `value` should be inserted into `array` in order to maintain the sort order of the sorted `array`. If `callback` is provided, it will be executed for `value` and each element in `array` to compute their sort ranking. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*.
|
||||
|
||||
@@ -813,7 +813,7 @@ _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_unionarray1-array2-"></a>`_.union([array1, array2, ...])`
|
||||
<a href="#_unionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4865 "View in source") [Ⓣ][1]
|
||||
<a href="#_unionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4862 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of unique values, in order, of the provided arrays using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -837,7 +837,7 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_uniqarray--issortedfalse-callbackidentity-thisarg"></a>`_.uniq(array [, isSorted=false, callback=identity, thisArg])`
|
||||
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4913 "View in source") [Ⓣ][1]
|
||||
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4910 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is provided, each element of `array` is provided through the `callback` before uniqueness is computed. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -884,7 +884,7 @@ _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_withoutarray--value1-value2-"></a>`_.without(array [, value1, value2, ...])`
|
||||
<a href="#_withoutarray--value1-value2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4941 "View in source") [Ⓣ][1]
|
||||
<a href="#_withoutarray--value1-value2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4938 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array excluding all provided values using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -909,7 +909,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_ziparray1-array2-"></a>`_.zip([array1, array2, ...])`
|
||||
<a href="#_ziparray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4961 "View in source") [Ⓣ][1]
|
||||
<a href="#_ziparray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4958 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.
|
||||
|
||||
@@ -936,7 +936,7 @@ _.zip(['moe', 'larry'], [30, 40], [true, false]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_zipobjectkeys--values"></a>`_.zipObject(keys [, values=[]])`
|
||||
<a href="#_zipobjectkeys--values">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4991 "View in source") [Ⓣ][1]
|
||||
<a href="#_zipobjectkeys--values">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4988 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an object composed from arrays of `keys` and `values`. Pass either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or two arrays, one of `keys` and one of corresponding `values`.
|
||||
|
||||
@@ -1024,7 +1024,7 @@ _.isArray(squares.value());
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_chainvalue"></a>`_.chain(value)`
|
||||
<a href="#_chainvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6096 "View in source") [Ⓣ][1]
|
||||
<a href="#_chainvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6093 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a `lodash` object that wraps the given `value`.
|
||||
|
||||
@@ -1057,7 +1057,7 @@ var youngest = _.chain(stooges)
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
|
||||
<a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6123 "View in source") [Ⓣ][1]
|
||||
<a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6120 "View in source") [Ⓣ][1]
|
||||
|
||||
Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
|
||||
|
||||
@@ -1087,7 +1087,7 @@ _([1, 2, 3, 4])
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_prototypechain"></a>`_.prototype.chain()`
|
||||
<a href="#_prototypechain">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6143 "View in source") [Ⓣ][1]
|
||||
<a href="#_prototypechain">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6140 "View in source") [Ⓣ][1]
|
||||
|
||||
Enables method chaining on the wrapper object.
|
||||
|
||||
@@ -1111,7 +1111,7 @@ var sum = _([1, 2, 3])
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_prototypetostring"></a>`_.prototype.toString()`
|
||||
<a href="#_prototypetostring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6160 "View in source") [Ⓣ][1]
|
||||
<a href="#_prototypetostring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6157 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces the `toString` result of the wrapped value.
|
||||
|
||||
@@ -1132,7 +1132,7 @@ _([1, 2, 3]).toString();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_prototypevalueof"></a>`_.prototype.valueOf()`
|
||||
<a href="#_prototypevalueof">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6177 "View in source") [Ⓣ][1]
|
||||
<a href="#_prototypevalueof">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6174 "View in source") [Ⓣ][1]
|
||||
|
||||
Extracts the wrapped value.
|
||||
|
||||
@@ -1163,7 +1163,7 @@ _([1, 2, 3]).valueOf();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_atcollection--index1-index2-"></a>`_.at(collection [, index1, index2, ...])`
|
||||
<a href="#_atcollection--index1-index2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2924 "View in source") [Ⓣ][1]
|
||||
<a href="#_atcollection--index1-index2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2923 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of elements from the specified indexes, or keys, of the `collection`. Indexes may be specified as individual arguments or as arrays of indexes.
|
||||
|
||||
@@ -1191,7 +1191,7 @@ _.at(['moe', 'larry', 'curly'], 0, 2);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_containscollection-target--fromindex0"></a>`_.contains(collection, target [, fromIndex=0])`
|
||||
<a href="#_containscollection-target--fromindex0">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2966 "View in source") [Ⓣ][1]
|
||||
<a href="#_containscollection-target--fromindex0">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2965 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a given `target` element is present in a `collection` using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection.
|
||||
|
||||
@@ -1229,7 +1229,7 @@ _.contains('curly', 'ur');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_countbycollection--callbackidentity-thisarg"></a>`_.countBy(collection [, callback=identity, thisArg])`
|
||||
<a href="#_countbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3022 "View in source") [Ⓣ][1]
|
||||
<a href="#_countbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3021 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an object composed of keys generated from the results of running each element of the `collection` through the given `callback`. The corresponding value of each key is the number of times the key was returned by the `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -1265,7 +1265,7 @@ _.countBy(['one', 'two', 'three'], 'length');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_everycollection--callbackidentity-thisarg"></a>`_.every(collection [, callback=identity, thisArg])`
|
||||
<a href="#_everycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3067 "View in source") [Ⓣ][1]
|
||||
<a href="#_everycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3066 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -1311,7 +1311,7 @@ _.every(stooges, { 'age': 50 });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_filtercollection--callbackidentity-thisarg"></a>`_.filter(collection [, callback=identity, thisArg])`
|
||||
<a href="#_filtercollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3128 "View in source") [Ⓣ][1]
|
||||
<a href="#_filtercollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3127 "View in source") [Ⓣ][1]
|
||||
|
||||
Iterates over elements of a `collection`, returning an array of all elements the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -1357,7 +1357,7 @@ _.filter(food, { 'type': 'fruit' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_findcollection--callbackidentity-thisarg"></a>`_.find(collection [, callback=identity, thisArg])`
|
||||
<a href="#_findcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3195 "View in source") [Ⓣ][1]
|
||||
<a href="#_findcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3194 "View in source") [Ⓣ][1]
|
||||
|
||||
Iterates over elements of a `collection`, returning the first that the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -1406,7 +1406,7 @@ _.find(food, 'organic');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_findlastcollection--callbackidentity-thisarg"></a>`_.findLast(collection [, callback=identity, thisArg])`
|
||||
<a href="#_findlastcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3240 "View in source") [Ⓣ][1]
|
||||
<a href="#_findlastcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3239 "View in source") [Ⓣ][1]
|
||||
|
||||
This method is like `_.find`, except that it iterates over elements of a `collection` from right to left.
|
||||
|
||||
@@ -1434,7 +1434,7 @@ _.findLast([1, 2, 3, 4], function(num) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_foreachcollection--callbackidentity-thisarg"></a>`_.forEach(collection [, callback=identity, thisArg])`
|
||||
<a href="#_foreachcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3274 "View in source") [Ⓣ][1]
|
||||
<a href="#_foreachcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3273 "View in source") [Ⓣ][1]
|
||||
|
||||
Iterates over elements of a `collection`, executing the `callback` for each element. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`.
|
||||
|
||||
@@ -1466,7 +1466,7 @@ _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_foreachrightcollection--callbackidentity-thisarg"></a>`_.forEachRight(collection [, callback=identity, thisArg])`
|
||||
<a href="#_foreachrightcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3307 "View in source") [Ⓣ][1]
|
||||
<a href="#_foreachrightcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3306 "View in source") [Ⓣ][1]
|
||||
|
||||
This method is like `_.forEach`, except that it iterates over elements of a `collection` from right to left.
|
||||
|
||||
@@ -1495,7 +1495,7 @@ _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(',');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_groupbycollection--callbackidentity-thisarg"></a>`_.groupBy(collection [, callback=identity, thisArg])`
|
||||
<a href="#_groupbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3360 "View in source") [Ⓣ][1]
|
||||
<a href="#_groupbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3359 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an object composed of keys generated from the results of running each element of the `collection` through the `callback`. The corresponding value of each key is an array of the elements responsible for generating the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -1532,7 +1532,7 @@ _.groupBy(['one', 'two', 'three'], 'length');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_indexbycollection--callbackidentity-thisarg"></a>`_.indexBy(collection [, callback=identity, thisArg])`
|
||||
<a href="#_indexbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3403 "View in source") [Ⓣ][1]
|
||||
<a href="#_indexbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3402 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an object composed of keys generated from the results of running each element of the `collection` through the given `callback`. The corresponding value of each key is the last element responsible for generating the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -1573,7 +1573,7 @@ _.indexBy(stooges, function(key) { this.fromCharCode(key.code); }, String);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_invokecollection-methodname--arg1-arg2-"></a>`_.invoke(collection, methodName [, arg1, arg2, ...])`
|
||||
<a href="#_invokecollection-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3429 "View in source") [Ⓣ][1]
|
||||
<a href="#_invokecollection-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3428 "View in source") [Ⓣ][1]
|
||||
|
||||
Invokes the method named by `methodName` on each element in the `collection`, returning an array of the results of each invoked method. Additional arguments will be provided to each invoked method. If `methodName` is a function, it will be invoked for, and `this` bound to, each element in the `collection`.
|
||||
|
||||
@@ -1602,7 +1602,7 @@ _.invoke([123, 456], String.prototype.split, '');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_mapcollection--callbackidentity-thisarg"></a>`_.map(collection [, callback=identity, thisArg])`
|
||||
<a href="#_mapcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3481 "View in source") [Ⓣ][1]
|
||||
<a href="#_mapcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3480 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of values by running each element in the `collection` through the `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -1647,7 +1647,7 @@ _.map(stooges, 'name');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_maxcollection--callbackidentity-thisarg"></a>`_.max(collection [, callback=identity, thisArg])`
|
||||
<a href="#_maxcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3538 "View in source") [Ⓣ][1]
|
||||
<a href="#_maxcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3537 "View in source") [Ⓣ][1]
|
||||
|
||||
Retrieves the maximum value of an `array`. If `callback` is provided, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*.
|
||||
|
||||
@@ -1689,7 +1689,7 @@ _.max(stooges, 'age');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_mincollection--callbackidentity-thisarg"></a>`_.min(collection [, callback=identity, thisArg])`
|
||||
<a href="#_mincollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3607 "View in source") [Ⓣ][1]
|
||||
<a href="#_mincollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3606 "View in source") [Ⓣ][1]
|
||||
|
||||
Retrieves the minimum value of an `array`. If `callback` is provided, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*.
|
||||
|
||||
@@ -1731,7 +1731,7 @@ _.min(stooges, 'age');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_pluckcollection-property"></a>`_.pluck(collection, property)`
|
||||
<a href="#_pluckcollection-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3657 "View in source") [Ⓣ][1]
|
||||
<a href="#_pluckcollection-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3656 "View in source") [Ⓣ][1]
|
||||
|
||||
Retrieves the value of a specified property from all elements in the `collection`.
|
||||
|
||||
@@ -1761,7 +1761,7 @@ _.pluck(stooges, 'name');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_reducecollection--callbackidentity-accumulator-thisarg"></a>`_.reduce(collection [, callback=identity, accumulator, thisArg])`
|
||||
<a href="#_reducecollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3689 "View in source") [Ⓣ][1]
|
||||
<a href="#_reducecollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3688 "View in source") [Ⓣ][1]
|
||||
|
||||
Reduces a `collection` to a value which is the accumulated result of running each element in the `collection` through the `callback`, where each successive `callback` execution consumes the return value of the previous execution. If `accumulator` is not provided, the first element of the `collection` will be used as the initial `accumulator` value. The `callback` is bound to `thisArg` and invoked with four arguments; *(accumulator, value, index|key, collection)*.
|
||||
|
||||
@@ -1799,7 +1799,7 @@ var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_reducerightcollection--callbackidentity-accumulator-thisarg"></a>`_.reduceRight(collection [, callback=identity, accumulator, thisArg])`
|
||||
<a href="#_reducerightcollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3732 "View in source") [Ⓣ][1]
|
||||
<a href="#_reducerightcollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3731 "View in source") [Ⓣ][1]
|
||||
|
||||
This method is like `_.reduce`, except that it iterates over elements of a `collection` from right to left.
|
||||
|
||||
@@ -1830,7 +1830,7 @@ var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_rejectcollection--callbackidentity-thisarg"></a>`_.reject(collection [, callback=identity, thisArg])`
|
||||
<a href="#_rejectcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3782 "View in source") [Ⓣ][1]
|
||||
<a href="#_rejectcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3781 "View in source") [Ⓣ][1]
|
||||
|
||||
The opposite of `_.filter`, this method returns the elements of a `collection` that `callback` does **not** return truthy for.
|
||||
|
||||
@@ -1873,7 +1873,7 @@ _.reject(food, { 'type': 'fruit' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_removecollection--callbackidentity-thisarg"></a>`_.remove(collection [, callback=identity, thisArg])`
|
||||
<a href="#_removecollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3821 "View in source") [Ⓣ][1]
|
||||
<a href="#_removecollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3820 "View in source") [Ⓣ][1]
|
||||
|
||||
Removes all elements from the `collection` that thw `callback` returns truthy for and returns an array of removed elements. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -1909,7 +1909,7 @@ console.log(evens);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_shufflecollection"></a>`_.shuffle(collection)`
|
||||
<a href="#_shufflecollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3862 "View in source") [Ⓣ][1]
|
||||
<a href="#_shufflecollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3861 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
|
||||
|
||||
@@ -1933,7 +1933,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_sizecollection"></a>`_.size(collection)`
|
||||
<a href="#_sizecollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3895 "View in source") [Ⓣ][1]
|
||||
<a href="#_sizecollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3894 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects.
|
||||
|
||||
@@ -1963,7 +1963,7 @@ _.size('curly');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_somecollection--callbackidentity-thisarg"></a>`_.some(collection [, callback=identity, thisArg])`
|
||||
<a href="#_somecollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3942 "View in source") [Ⓣ][1]
|
||||
<a href="#_somecollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3941 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -2009,7 +2009,7 @@ _.some(food, { 'type': 'meat' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_sortbycollection--callbackidentity-thisarg"></a>`_.sortBy(collection [, callback=identity, thisArg])`
|
||||
<a href="#_sortbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3998 "View in source") [Ⓣ][1]
|
||||
<a href="#_sortbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3997 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of elements, sorted in ascending order by the results of running each element in the `collection` through the `callback`. This method performs a stable sort, that is, it will preserve the original sort order of equal elements. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -2046,7 +2046,7 @@ _.sortBy(['banana', 'strawberry', 'apple'], 'length');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_toarraycollection"></a>`_.toArray(collection)`
|
||||
<a href="#_toarraycollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4034 "View in source") [Ⓣ][1]
|
||||
<a href="#_toarraycollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4033 "View in source") [Ⓣ][1]
|
||||
|
||||
Converts the `collection` to an array.
|
||||
|
||||
@@ -2070,7 +2070,7 @@ Converts the `collection` to an array.
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_wherecollection-properties"></a>`_.where(collection, properties)`
|
||||
<a href="#_wherecollection-properties">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4068 "View in source") [Ⓣ][1]
|
||||
<a href="#_wherecollection-properties">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4067 "View in source") [Ⓣ][1]
|
||||
|
||||
Performs a deep comparison of each element in a `collection` to the given `properties` object, returning an array of all elements that have equivalent property values.
|
||||
|
||||
@@ -2110,7 +2110,7 @@ _.where(stooges, { 'quotes': ['Poifect!'] });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_aftern-func"></a>`_.after(n, func)`
|
||||
<a href="#_aftern-func">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5028 "View in source") [Ⓣ][1]
|
||||
<a href="#_aftern-func">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5025 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function this is restricted to executing `func`, with the `this` binding and arguments of the created function, only after it is called `n` times.
|
||||
|
||||
@@ -2138,7 +2138,7 @@ _.forEach(notes, function(note) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_bindfunc--thisarg-arg1-arg2-"></a>`_.bind(func [, thisArg, arg1, arg2, ...])`
|
||||
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5058 "View in source") [Ⓣ][1]
|
||||
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5055 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those provided to the bound function.
|
||||
|
||||
@@ -2169,7 +2169,7 @@ func();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_bindallobject--methodname1-methodname2-"></a>`_.bindAll(object [, methodName1, methodName2, ...])`
|
||||
<a href="#_bindallobject--methodname1-methodname2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5086 "View in source") [Ⓣ][1]
|
||||
<a href="#_bindallobject--methodname1-methodname2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5083 "View in source") [Ⓣ][1]
|
||||
|
||||
Binds methods on `object` to `object`, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided, all the function properties of `object` will be bound.
|
||||
|
||||
@@ -2200,7 +2200,7 @@ jQuery('#docs').on('click', view.onClick);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_bindkeyobject-key--arg1-arg2-"></a>`_.bindKey(object, key [, arg1, arg2, ...])`
|
||||
<a href="#_bindkeyobject-key--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5132 "View in source") [Ⓣ][1]
|
||||
<a href="#_bindkeyobject-key--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5129 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those provided to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern.
|
||||
|
||||
@@ -2241,7 +2241,7 @@ func();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_composefunc1-func2-"></a>`_.compose([func1, func2, ...])`
|
||||
<a href="#_composefunc1-func2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5166 "View in source") [Ⓣ][1]
|
||||
<a href="#_composefunc1-func2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5163 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that is the composition of the provided functions, where each function consumes the return value of the function that follows. For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function.
|
||||
|
||||
@@ -2279,7 +2279,7 @@ welcome('curly');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_createcallbackfuncidentity-thisarg-argcount"></a>`_.createCallback([func=identity, thisArg, argCount])`
|
||||
<a href="#_createcallbackfuncidentity-thisarg-argcount">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5210 "View in source") [Ⓣ][1]
|
||||
<a href="#_createcallbackfuncidentity-thisarg-argcount">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5207 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a callback bound to an optional `thisArg`. If `func` is a property name, the created callback will return the property value for a given element. If `func` is an object, the created callback will return `true` for elements that contain the equivalent object properties, otherwise it will return `false`.
|
||||
|
||||
@@ -2318,7 +2318,7 @@ _.filter(stooges, 'age__gt45');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_debouncefunc-wait-options"></a>`_.debounce(func, wait, options)`
|
||||
<a href="#_debouncefunc-wait-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5286 "View in source") [Ⓣ][1]
|
||||
<a href="#_debouncefunc-wait-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5283 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass an `options` object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call.
|
||||
|
||||
@@ -2359,7 +2359,7 @@ source.addEventListener('message', _.debounce(batchLog, 250, {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_deferfunc--arg1-arg2-"></a>`_.defer(func [, arg1, arg2, ...])`
|
||||
<a href="#_deferfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5383 "View in source") [Ⓣ][1]
|
||||
<a href="#_deferfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5380 "View in source") [Ⓣ][1]
|
||||
|
||||
Defers executing the `func` function until the current call stack has cleared. Additional arguments will be provided to `func` when it is invoked.
|
||||
|
||||
@@ -2384,7 +2384,7 @@ _.defer(function() { console.log('deferred'); });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_delayfunc-wait--arg1-arg2-"></a>`_.delay(func, wait [, arg1, arg2, ...])`
|
||||
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5409 "View in source") [Ⓣ][1]
|
||||
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5406 "View in source") [Ⓣ][1]
|
||||
|
||||
Executes the `func` function after `wait` milliseconds. Additional arguments will be provided to `func` when it is invoked.
|
||||
|
||||
@@ -2411,7 +2411,7 @@ _.delay(log, 1000, 'logged later');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_memoizefunc--resolver"></a>`_.memoize(func [, resolver])`
|
||||
<a href="#_memoizefunc--resolver">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5434 "View in source") [Ⓣ][1]
|
||||
<a href="#_memoizefunc--resolver">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5431 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that memoizes the result of `func`. If `resolver` is provided, it will be used to determine the cache key for storing the result based on the arguments provided to the memoized function. By default, the first argument provided to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. The result cache is exposed as the `cache` property on the memoized function.
|
||||
|
||||
@@ -2437,7 +2437,7 @@ var fibonacci = _.memoize(function(n) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_oncefunc"></a>`_.once(func)`
|
||||
<a href="#_oncefunc">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5464 "View in source") [Ⓣ][1]
|
||||
<a href="#_oncefunc">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5461 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that is restricted to execute `func` once. Repeat calls to the function will return the value of the first call. The `func` is executed with the `this` binding of the created function.
|
||||
|
||||
@@ -2463,7 +2463,7 @@ initialize();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_partialfunc--arg1-arg2-"></a>`_.partial(func [, arg1, arg2, ...])`
|
||||
<a href="#_partialfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5499 "View in source") [Ⓣ][1]
|
||||
<a href="#_partialfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5496 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those provided to the new function. This method is similar to `_.bind`, except it does **not** alter the `this` binding.
|
||||
|
||||
@@ -2490,7 +2490,7 @@ hi('moe');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_partialrightfunc--arg1-arg2-"></a>`_.partialRight(func [, arg1, arg2, ...])`
|
||||
<a href="#_partialrightfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5530 "View in source") [Ⓣ][1]
|
||||
<a href="#_partialrightfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5527 "View in source") [Ⓣ][1]
|
||||
|
||||
This method is like `_.partial`, except that `partial` arguments are appended to those provided to the new function.
|
||||
|
||||
@@ -2527,7 +2527,7 @@ options.imports
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_throttlefunc-wait-options"></a>`_.throttle(func, wait, options)`
|
||||
<a href="#_throttlefunc-wait-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5565 "View in source") [Ⓣ][1]
|
||||
<a href="#_throttlefunc-wait-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5562 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. Pass an `options` object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the throttled function will return the result of the last `func` call.
|
||||
|
||||
@@ -2561,7 +2561,7 @@ jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_wrapvalue-wrapper"></a>`_.wrap(value, wrapper)`
|
||||
<a href="#_wrapvalue-wrapper">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5606 "View in source") [Ⓣ][1]
|
||||
<a href="#_wrapvalue-wrapper">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5603 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments provided to the function are appended to those provided to the `wrapper` function. The `wrapper` is executed with the `this` binding of the created function.
|
||||
|
||||
@@ -2882,7 +2882,7 @@ _.forInRight(new Dog('Dagny'), function(value, key) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_forownobject--callbackidentity-thisarg"></a>`_.forOwn(object [, callback=identity, thisArg])`
|
||||
<a href="#_forownobject--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2143 "View in source") [Ⓣ][1]
|
||||
<a href="#_forownobject--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2142 "View in source") [Ⓣ][1]
|
||||
|
||||
Iterates over own enumerable properties of a given `object`, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`.
|
||||
|
||||
@@ -2910,7 +2910,7 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_forownrightobject--callbackidentity-thisarg"></a>`_.forOwnRight(object [, callback=identity, thisArg])`
|
||||
<a href="#_forownrightobject--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2163 "View in source") [Ⓣ][1]
|
||||
<a href="#_forownrightobject--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2162 "View in source") [Ⓣ][1]
|
||||
|
||||
This method is like `_.forOwn`, except that it iterates over elements of a `collection` in the opposite order.
|
||||
|
||||
@@ -2938,7 +2938,7 @@ _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_functionsobject"></a>`_.functions(object)`
|
||||
<a href="#_functionsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2192 "View in source") [Ⓣ][1]
|
||||
<a href="#_functionsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2191 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a sorted array of property names of all enumerable properties, own and inherited, of `object` that have function values.
|
||||
|
||||
@@ -2965,7 +2965,7 @@ _.functions(_);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_hasobject-property"></a>`_.has(object, property)`
|
||||
<a href="#_hasobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2217 "View in source") [Ⓣ][1]
|
||||
<a href="#_hasobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2216 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if the specified object `property` exists and is a direct property, instead of an inherited property.
|
||||
|
||||
@@ -2990,7 +2990,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_invertobject"></a>`_.invert(object)`
|
||||
<a href="#_invertobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2234 "View in source") [Ⓣ][1]
|
||||
<a href="#_invertobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2233 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an object composed of the inverted keys and values of the given `object`.
|
||||
|
||||
@@ -3068,7 +3068,7 @@ _.isArray([1, 2, 3]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
|
||||
<a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2260 "View in source") [Ⓣ][1]
|
||||
<a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2259 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a boolean value.
|
||||
|
||||
@@ -3092,7 +3092,7 @@ _.isBoolean(null);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isdatevalue"></a>`_.isDate(value)`
|
||||
<a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2277 "View in source") [Ⓣ][1]
|
||||
<a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2276 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a date.
|
||||
|
||||
@@ -3116,7 +3116,7 @@ _.isDate(new Date);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_iselementvalue"></a>`_.isElement(value)`
|
||||
<a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2294 "View in source") [Ⓣ][1]
|
||||
<a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2293 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a DOM element.
|
||||
|
||||
@@ -3140,7 +3140,7 @@ _.isElement(document.body);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
|
||||
<a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2319 "View in source") [Ⓣ][1]
|
||||
<a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2318 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is empty. Arrays, strings, or `arguments` objects with a length of `0` and objects with no own enumerable properties are considered "empty".
|
||||
|
||||
@@ -3170,7 +3170,7 @@ _.isEmpty('');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isequala-b--callback-thisarg"></a>`_.isEqual(a, b [, callback, thisArg])`
|
||||
<a href="#_isequala-b--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2376 "View in source") [Ⓣ][1]
|
||||
<a href="#_isequala-b--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2375 "View in source") [Ⓣ][1]
|
||||
|
||||
Performs a deep comparison between two values to determine if they are equivalent to each other. If `callback` is provided, it will be executed to compare values. If `callback` returns `undefined`, comparisons will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(a, b)*.
|
||||
|
||||
@@ -3215,7 +3215,7 @@ _.isEqual(words, otherWords, function(a, b) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isfinitevalue"></a>`_.isFinite(value)`
|
||||
<a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2408 "View in source") [Ⓣ][1]
|
||||
<a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2407 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is, or can be coerced to, a finite number.
|
||||
|
||||
@@ -3253,7 +3253,7 @@ _.isFinite(Infinity);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
|
||||
<a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2425 "View in source") [Ⓣ][1]
|
||||
<a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2424 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a function.
|
||||
|
||||
@@ -3277,7 +3277,7 @@ _.isFunction(_);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isnanvalue"></a>`_.isNaN(value)`
|
||||
<a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2488 "View in source") [Ⓣ][1]
|
||||
<a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2487 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is `NaN`.
|
||||
|
||||
@@ -3312,7 +3312,7 @@ _.isNaN(undefined);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isnullvalue"></a>`_.isNull(value)`
|
||||
<a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2510 "View in source") [Ⓣ][1]
|
||||
<a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2509 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is `null`.
|
||||
|
||||
@@ -3339,7 +3339,7 @@ _.isNull(undefined);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isnumbervalue"></a>`_.isNumber(value)`
|
||||
<a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2529 "View in source") [Ⓣ][1]
|
||||
<a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2528 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a number.
|
||||
|
||||
@@ -3365,7 +3365,7 @@ _.isNumber(8.4 * 5);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isobjectvalue"></a>`_.isObject(value)`
|
||||
<a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2455 "View in source") [Ⓣ][1]
|
||||
<a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2454 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)*
|
||||
|
||||
@@ -3395,7 +3395,7 @@ _.isObject(1);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
|
||||
<a href="#_isplainobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2557 "View in source") [Ⓣ][1]
|
||||
<a href="#_isplainobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2556 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a given `value` is an object created by the `Object` constructor.
|
||||
|
||||
@@ -3430,7 +3430,7 @@ _.isPlainObject({ 'name': 'moe', 'age': 40 });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
|
||||
<a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2582 "View in source") [Ⓣ][1]
|
||||
<a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2581 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a regular expression.
|
||||
|
||||
@@ -3454,7 +3454,7 @@ _.isRegExp(/moe/);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isstringvalue"></a>`_.isString(value)`
|
||||
<a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2599 "View in source") [Ⓣ][1]
|
||||
<a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2598 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a string.
|
||||
|
||||
@@ -3478,7 +3478,7 @@ _.isString('moe');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
|
||||
<a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2616 "View in source") [Ⓣ][1]
|
||||
<a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2615 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is `undefined`.
|
||||
|
||||
@@ -3526,7 +3526,7 @@ _.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_mergeobject--source1-source2--callback-thisarg"></a>`_.merge(object [, source1, source2, ..., callback, thisArg])`
|
||||
<a href="#_mergeobject--source1-source2--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2671 "View in source") [Ⓣ][1]
|
||||
<a href="#_mergeobject--source1-source2--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2670 "View in source") [Ⓣ][1]
|
||||
|
||||
Recursively merges own enumerable properties of the source object(s), that don't resolve to `undefined`, into the destination object. Subsequent sources will overwrite property assignments of previous sources. If a `callback` function is provided, it will be executed to produce the merged values of the destination and source properties. If `callback` returns `undefined`, merging will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*.
|
||||
|
||||
@@ -3582,7 +3582,7 @@ _.merge(food, otherFood, function(a, b) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_omitobject-callback-prop1-prop2--thisarg"></a>`_.omit(object, callback|[prop1, prop2, ..., thisArg])`
|
||||
<a href="#_omitobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2727 "View in source") [Ⓣ][1]
|
||||
<a href="#_omitobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2726 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If a `callback` function is provided, it will be executed for each property in the `object`, omitting the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*.
|
||||
|
||||
@@ -3613,7 +3613,7 @@ _.omit({ 'name': 'moe', 'age': 40 }, function(value) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_pairsobject"></a>`_.pairs(object)`
|
||||
<a href="#_pairsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2762 "View in source") [Ⓣ][1]
|
||||
<a href="#_pairsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2761 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`.
|
||||
|
||||
@@ -3637,7 +3637,7 @@ _.pairs({ 'moe': 30, 'larry': 40 });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_pickobject-callback-prop1-prop2--thisarg"></a>`_.pick(object, callback|[prop1, prop2, ..., thisArg])`
|
||||
<a href="#_pickobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2801 "View in source") [Ⓣ][1]
|
||||
<a href="#_pickobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2800 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is provided, it will be executed for each property in the `object`, picking the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*.
|
||||
|
||||
@@ -3668,7 +3668,7 @@ _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_transformcollection--callbackidentity-accumulator-thisarg"></a>`_.transform(collection [, callback=identity, accumulator, thisArg])`
|
||||
<a href="#_transformcollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2856 "View in source") [Ⓣ][1]
|
||||
<a href="#_transformcollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2855 "View in source") [Ⓣ][1]
|
||||
|
||||
An alternative to `_.reduce`, this method transforms an `object` to a new `accumulator` object which is the result of running each of its elements through the `callback`, with each `callback` execution potentially mutating the `accumulator` object. The `callback` is bound to `thisArg` and invoked with four arguments; *(accumulator, value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`.
|
||||
|
||||
@@ -3705,7 +3705,7 @@ var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key)
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_valuesobject"></a>`_.values(object)`
|
||||
<a href="#_valuesobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2889 "View in source") [Ⓣ][1]
|
||||
<a href="#_valuesobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2888 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array composed of the own enumerable property values of `object`.
|
||||
|
||||
@@ -3736,7 +3736,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_escapestring"></a>`_.escape(string)`
|
||||
<a href="#_escapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5630 "View in source") [Ⓣ][1]
|
||||
<a href="#_escapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5627 "View in source") [Ⓣ][1]
|
||||
|
||||
Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities.
|
||||
|
||||
@@ -3760,7 +3760,7 @@ _.escape('Moe, Larry & Curly');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_identityvalue"></a>`_.identity(value)`
|
||||
<a href="#_identityvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5648 "View in source") [Ⓣ][1]
|
||||
<a href="#_identityvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5645 "View in source") [Ⓣ][1]
|
||||
|
||||
This method returns the first argument provided to it.
|
||||
|
||||
@@ -3785,7 +3785,7 @@ moe === _.identity(moe);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_mixinobject"></a>`_.mixin(object)`
|
||||
<a href="#_mixinobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5674 "View in source") [Ⓣ][1]
|
||||
<a href="#_mixinobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5671 "View in source") [Ⓣ][1]
|
||||
|
||||
Adds functions properties of `object` to the `lodash` function and chainable wrapper.
|
||||
|
||||
@@ -3815,7 +3815,7 @@ _('moe').capitalize();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_noconflict"></a>`_.noConflict()`
|
||||
<a href="#_noconflict">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5712 "View in source") [Ⓣ][1]
|
||||
<a href="#_noconflict">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5709 "View in source") [Ⓣ][1]
|
||||
|
||||
Reverts the '_' variable to its previous value and returns a reference to the `lodash` function.
|
||||
|
||||
@@ -3835,7 +3835,7 @@ var lodash = _.noConflict();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_parseintvalue--radix"></a>`_.parseInt(value [, radix])`
|
||||
<a href="#_parseintvalue--radix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5736 "View in source") [Ⓣ][1]
|
||||
<a href="#_parseintvalue--radix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5733 "View in source") [Ⓣ][1]
|
||||
|
||||
Converts the given `value` into an integer of the specified `radix`. If `radix` is `undefined` or `0`, a `radix` of `10` is used unless the `value` is a hexadecimal, in which case a `radix` of `16` is used.
|
||||
|
||||
@@ -3862,7 +3862,7 @@ _.parseInt('08');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_randommin0-max1"></a>`_.random([min=0, max=1])`
|
||||
<a href="#_randommin0-max1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5760 "View in source") [Ⓣ][1]
|
||||
<a href="#_randommin0-max1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5757 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a random number between `min` and `max` *(inclusive)*. If only one argument is provided, a number between `0` and the given number will be returned.
|
||||
|
||||
@@ -3890,7 +3890,7 @@ _.random(5);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_resultobject-property"></a>`_.result(object, property)`
|
||||
<a href="#_resultobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5804 "View in source") [Ⓣ][1]
|
||||
<a href="#_resultobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5801 "View in source") [Ⓣ][1]
|
||||
|
||||
Resolves the value of `property` on `object`. If `property` is a function, it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is falsey, then `undefined` is returned.
|
||||
|
||||
@@ -3943,7 +3943,7 @@ Create a new `lodash` function using the given `context` object.
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_templatetext-data-options"></a>`_.template(text, data, options)`
|
||||
<a href="#_templatetext-data-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5895 "View in source") [Ⓣ][1]
|
||||
<a href="#_templatetext-data-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5892 "View in source") [Ⓣ][1]
|
||||
|
||||
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code.
|
||||
|
||||
@@ -4031,7 +4031,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_timesn-callback--thisarg"></a>`_.times(n, callback [, thisArg])`
|
||||
<a href="#_timesn-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6020 "View in source") [Ⓣ][1]
|
||||
<a href="#_timesn-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6017 "View in source") [Ⓣ][1]
|
||||
|
||||
Executes the `callback` function `n` times, returning an array of the results of each `callback` execution. The `callback` is bound to `thisArg` and invoked with one argument; *(index)*.
|
||||
|
||||
@@ -4063,7 +4063,7 @@ _.times(3, function(n) { this.cast(n); }, mage);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_unescapestring"></a>`_.unescape(string)`
|
||||
<a href="#_unescapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6047 "View in source") [Ⓣ][1]
|
||||
<a href="#_unescapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6044 "View in source") [Ⓣ][1]
|
||||
|
||||
The inverse of `_.escape`, this method converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters.
|
||||
|
||||
@@ -4087,7 +4087,7 @@ _.unescape('Moe, Larry & Curly');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix])`
|
||||
<a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6067 "View in source") [Ⓣ][1]
|
||||
<a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6064 "View in source") [Ⓣ][1]
|
||||
|
||||
Generates a unique ID. If `prefix` is provided, the ID will be appended to it.
|
||||
|
||||
@@ -4140,7 +4140,7 @@ A reference to the `lodash` function.
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_version"></a>`_.VERSION`
|
||||
<a href="#_version">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6371 "View in source") [Ⓣ][1]
|
||||
<a href="#_version">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6368 "View in source") [Ⓣ][1]
|
||||
|
||||
*(String)*: The semantic version number.
|
||||
|
||||
|
||||
@@ -2032,7 +2032,7 @@
|
||||
*/
|
||||
function findLastKey(object, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forOwnRight(object, function(value, key, object) {
|
||||
if (callback(value, key, object)) {
|
||||
result = key;
|
||||
@@ -3238,7 +3238,7 @@
|
||||
*/
|
||||
function findLast(collection, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forEachRight(collection, function(value, index, collection) {
|
||||
if (callback(value, index, collection)) {
|
||||
result = value;
|
||||
@@ -4196,7 +4196,7 @@
|
||||
*/
|
||||
function findLastIndex(array, callback, thisArg) {
|
||||
var length = array ? array.length : 0;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
while (length--) {
|
||||
if (callback(array[length], length, array)) {
|
||||
return length;
|
||||
|
||||
@@ -1599,6 +1599,8 @@
|
||||
'zip'
|
||||
];
|
||||
|
||||
var tested = {};
|
||||
|
||||
function strip(value) {
|
||||
return String(value)
|
||||
.replace(/^ *\/\/.*/gm, '')
|
||||
@@ -1608,50 +1610,74 @@
|
||||
}
|
||||
|
||||
funcNames.forEach(function(funcName) {
|
||||
var command = 'underscore plus=' + funcName;
|
||||
_.times(2, function(index) {
|
||||
var command = 'underscore plus=' + funcName,
|
||||
expected = !(funcName == 'defer' && global.setImmediate);
|
||||
|
||||
if (funcName == 'createCallback') {
|
||||
command += ',where';
|
||||
}
|
||||
if (funcName != 'chain' && _.contains(categoryMap.Chaining.concat('mixin'), funcName)) {
|
||||
command += ',chain';
|
||||
}
|
||||
if (_.contains(['isEqual', 'isPlainObject'], funcName)) {
|
||||
command += ',forIn';
|
||||
}
|
||||
if (_.contains(['contains', 'every', 'find', 'some', 'transform'], funcName)) {
|
||||
command += ',forOwn';
|
||||
}
|
||||
asyncTest('`lodash ' + command +'`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s'].concat(command.split(' ')), function(data) {
|
||||
var basename = path.basename(data.outputPath, '.js'),
|
||||
context = createContext();
|
||||
|
||||
vm.runInContext(data.source, context, true);
|
||||
|
||||
var lodash = context._,
|
||||
func = lodash[funcName],
|
||||
array = [1, 2, 3],
|
||||
object = { 'a': 1, 'b': 2, 'c': 3 },
|
||||
result = [];
|
||||
|
||||
if (/^for(?:Each|In|Own)(?:Right)?$/.test(funcName)) {
|
||||
func(/^forEach/.test(funcName) ? array : object, function(value) {
|
||||
result.push(value);
|
||||
return false;
|
||||
});
|
||||
|
||||
equal(result.length, 1, basename);
|
||||
if (funcName == 'createCallback') {
|
||||
expected = !!index;
|
||||
if (index) {
|
||||
command += ',where';
|
||||
}
|
||||
if (funcName == 'chain' || funcName == 'findWhere' || (funcName == 'defer' && global.setImmediate)) {
|
||||
notEqual(strip(func), strip(_[funcName]), basename);
|
||||
} else if (!/\.min$/.test(basename)) {
|
||||
equal(strip(func), strip(_[funcName]), basename);
|
||||
}
|
||||
if (funcName != 'chain' && _.contains(categoryMap.Chaining.concat('mixin'), funcName)) {
|
||||
expected = funcName == 'tap' || !!index;
|
||||
if (index) {
|
||||
command += ',chain';
|
||||
}
|
||||
testMethod(lodash, funcName, basename);
|
||||
start();
|
||||
}
|
||||
if (_.contains(['contains', 'every', 'find', 'findKey', 'findWhere', 'some', 'transform'], funcName)) {
|
||||
expected = !!index;
|
||||
if (index) {
|
||||
command += ',forOwn';
|
||||
}
|
||||
}
|
||||
if (funcName == 'findLast') {
|
||||
expected = !!index;
|
||||
if (index) {
|
||||
command += ',forEachRight';
|
||||
}
|
||||
}
|
||||
if (funcName == 'findLastKey') {
|
||||
expected = !!index;
|
||||
if (index) {
|
||||
command += ',forOwnRight';
|
||||
}
|
||||
}
|
||||
if (tested[command]) {
|
||||
return;
|
||||
}
|
||||
tested[command] = true;
|
||||
|
||||
asyncTest('`lodash ' + command +'`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s'].concat(command.split(' ')), function(data) {
|
||||
var basename = path.basename(data.outputPath, '.js'),
|
||||
context = createContext();
|
||||
|
||||
vm.runInContext(data.source, context, true);
|
||||
|
||||
var lodash = context._,
|
||||
func = lodash[funcName],
|
||||
array = [1, 2, 3],
|
||||
object = { 'a': 1, 'b': 2, 'c': 3 },
|
||||
result = [];
|
||||
|
||||
if (/^for(?:Each|In|Own)(?:Right)?$/.test(funcName)) {
|
||||
func(/^forEach/.test(funcName) ? array : object, function(value) {
|
||||
result.push(value);
|
||||
return false;
|
||||
});
|
||||
|
||||
equal(result.length, 1, basename);
|
||||
}
|
||||
if (!/\.min$/.test(basename)) {
|
||||
equal(strip(func) === strip(_[funcName]), expected, basename);
|
||||
}
|
||||
testMethod(lodash, funcName, basename);
|
||||
start();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user