mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-13 20:37:48 +00:00
lodash: Add spaces to compiled / template strings. [jddalton]
Former-commit-id: e28bb94dfb8f315f62dd942765752739f30950dc
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
/** The Node filesystem module */
|
/** The Node filesystem module */
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
/** Used to minify string literals embedded in compiled strings */
|
/** Used to minify string values used by `iterationFactory` and its options */
|
||||||
var compiledValues = [
|
var compiledValues = [
|
||||||
'arrays',
|
'arrays',
|
||||||
'objects'
|
'objects'
|
||||||
@@ -114,6 +114,13 @@
|
|||||||
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
|
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
|
||||||
source = source.replace(RegExp('\\.(' + iterationFactoryOptions.concat(propWhitelist).join('|') + ')\\b', 'g'), "['$1']");
|
source = source.replace(RegExp('\\.(' + iterationFactoryOptions.concat(propWhitelist).join('|') + ')\\b', 'g'), "['$1']");
|
||||||
|
|
||||||
|
// remove whitespace from string literals
|
||||||
|
source = source.replace(/'(?:(?=(\\?))\1.)*?'/g, function(string) {
|
||||||
|
return string.replace(/\[object |else if|function | in |return\s+[\w']|throw |use strict|var |'\\n'|\\n|\s+/g, function(match) {
|
||||||
|
return match == false || match == '\\n' ? '' : match;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// minify `sortBy` and `template` methods
|
// minify `sortBy` and `template` methods
|
||||||
['sortBy', 'template'].forEach(function(methodName) {
|
['sortBy', 'template'].forEach(function(methodName) {
|
||||||
var properties = ['criteria', 'value'],
|
var properties = ['criteria', 'value'],
|
||||||
@@ -125,9 +132,6 @@
|
|||||||
result = result.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
|
result = result.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove escaped newlines in strings
|
|
||||||
result = result.replace(/\\n/g, '');
|
|
||||||
|
|
||||||
// replace with modified snippet
|
// replace with modified snippet
|
||||||
source = source.replace(snippet, result);
|
source = source.replace(snippet, result);
|
||||||
});
|
});
|
||||||
@@ -186,9 +190,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove escaped newlines in strings
|
|
||||||
result = result.replace(/\\n/g, '');
|
|
||||||
|
|
||||||
// replace with modified snippet
|
// replace with modified snippet
|
||||||
source = source.replace(snippet, result);
|
source = source.replace(snippet, result);
|
||||||
});
|
});
|
||||||
|
|||||||
34
lodash.js
34
lodash.js
@@ -96,7 +96,9 @@
|
|||||||
var extendFactoryOptions = {
|
var extendFactoryOptions = {
|
||||||
'args': 'object',
|
'args': 'object',
|
||||||
'init': 'object',
|
'init': 'object',
|
||||||
'beforeLoop': 'for(var source,j=1,length=arguments.length;j<length;j++){\nsource=arguments[j]',
|
'beforeLoop':
|
||||||
|
'for (var source, j = 1, length = arguments.length; j < length; j++) {\n' +
|
||||||
|
'source = arguments[j]',
|
||||||
'loopExp': 'index in source',
|
'loopExp': 'index in source',
|
||||||
'inLoop': 'object[index] = source[index]',
|
'inLoop': 'object[index] = source[index]',
|
||||||
'useHas': false,
|
'useHas': false,
|
||||||
@@ -113,8 +115,12 @@
|
|||||||
var forEachFactoryOptions = {
|
var forEachFactoryOptions = {
|
||||||
'args': 'collection, callback, thisArg',
|
'args': 'collection, callback, thisArg',
|
||||||
'top':
|
'top':
|
||||||
'if(!callback){\ncallback=identity\n}\n' +
|
'if (!callback) {\n' +
|
||||||
'else if(thisArg){\ncallback=bind(callback,thisArg)\n}',
|
'callback = identity\n' +
|
||||||
|
'}\n' +
|
||||||
|
'else if (thisArg) {\n' +
|
||||||
|
'callback = bind(callback, thisArg)\n' +
|
||||||
|
'}',
|
||||||
'init': 'collection',
|
'init': 'collection',
|
||||||
'inLoop': 'callback(collection[index], index, collection)'
|
'inLoop': 'callback(collection[index], index, collection)'
|
||||||
};
|
};
|
||||||
@@ -144,14 +150,19 @@
|
|||||||
/** Compilation options for `_.max` */
|
/** Compilation options for `_.max` */
|
||||||
var maxFactoryOptions = {
|
var maxFactoryOptions = {
|
||||||
'top':
|
'top':
|
||||||
'var current,result=-Infinity,computed=result;\n' +
|
'var current, computed = -Infinity, result = computed;\n' +
|
||||||
'if (!callback) {\n' +
|
'if (!callback) {\n' +
|
||||||
'if(isArray(collection)&&collection[0]===+collection[0])return Math.max.apply(Math,collection);\n' +
|
'if (isArray(collection) && collection[0] === +collection[0])' +
|
||||||
'if(isEmpty(collection))return result;\n' +
|
'return Math.max.apply(Math, collection);\n' +
|
||||||
|
'if (isEmpty(collection))' +
|
||||||
|
'return result\n' +
|
||||||
'} else if (thisArg) callback = bind(callback, thisArg)',
|
'} else if (thisArg) callback = bind(callback, thisArg)',
|
||||||
'inLoop':
|
'inLoop':
|
||||||
'current=callback?callback(collection[index],index,collection):collection[index];\n' +
|
'current = callback' +
|
||||||
'if(current>=computed)computed=current,result=collection[index]'
|
'? callback(collection[index], index, collection)' +
|
||||||
|
': collection[index];\n' +
|
||||||
|
'if (current >= computed)' +
|
||||||
|
'computed = current, result = collection[index]'
|
||||||
};
|
};
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -285,7 +296,8 @@
|
|||||||
// the following branch is for iterating arrays and array-like objects
|
// the following branch is for iterating arrays and array-like objects
|
||||||
(arrayBranch
|
(arrayBranch
|
||||||
// initialize `length` and `index` variables
|
// initialize `length` and `index` variables
|
||||||
? 'var length=' + firstArg + '.length;\nindex=-1;\n' +
|
? 'var length = ' + firstArg + '.length;\n' +
|
||||||
|
'index = -1;\n' +
|
||||||
// check if the `collection` is array-like when there is an object iteration branch
|
// check if the `collection` is array-like when there is an object iteration branch
|
||||||
((objectBranch ? 'if (length === +length) {\n' : '') +
|
((objectBranch ? 'if (length === +length) {\n' : '') +
|
||||||
// add code before the while-loop
|
// add code before the while-loop
|
||||||
@@ -486,7 +498,9 @@
|
|||||||
'var prop, isFunc = toString.call(callback) == funcClass;\n' +
|
'var prop, isFunc = toString.call(callback) == funcClass;\n' +
|
||||||
'if (isFunc && thisArg) callback = bind(callback, thisArg)',
|
'if (isFunc && thisArg) callback = bind(callback, thisArg)',
|
||||||
'inLoop':
|
'inLoop':
|
||||||
'prop=isFunc?callback(collection[index],index,collection):collection[index][callback];\n' +
|
'prop = isFunc' +
|
||||||
|
'? callback(collection[index], index, collection)' +
|
||||||
|
': collection[index][callback];\n' +
|
||||||
'(result[prop] || (result[prop] = [])).push(collection[index])'
|
'(result[prop] || (result[prop] = [])).push(collection[index])'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
14
lodash.min.js
vendored
14
lodash.min.js
vendored
@@ -11,16 +11,16 @@ if(d!=k.call(b))return o;switch(d){case F:return a==""+b;case L:return a!=+a?b!=
|
|||||||
b.constructor)return o;for(var j in a)if(r.call(a,j)&&(f++,!(e=r.call(b,j)&&Y(a[j],b[j],c))))break;if(e){for(j in b)if(r.call(b,j)&&!f--)break;e=!f}}c.pop();return e}function t(a){return k.call(a)==ba}function S(a){return a}function na(a){u(M(a),function(b){var c=i[b]=a[b];i.prototype[b]=function(){var a=[this.o];G.apply(a,arguments);a=c.apply(i,a);return this.p?(new p(a)).chain():a}})}var y={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};(function(){for(var a in y)y[y[a]]=
|
b.constructor)return o;for(var j in a)if(r.call(a,j)&&(f++,!(e=r.call(b,j)&&Y(a[j],b[j],c))))break;if(e){for(j in b)if(r.call(b,j)&&!f--)break;e=!f}}c.pop();return e}function t(a){return k.call(a)==ba}function S(a){return a}function na(a){u(M(a),function(b){var c=i[b]=a[b];i.prototype[b]=function(){var a=[this.o];G.apply(a,arguments);a=c.apply(i,a);return this.p?(new p(a)).chain():a}})}var y={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};(function(){for(var a in y)y[y[a]]=
|
||||||
a})();var Z="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(q=global),exports),wa=0,xa=q._,ya=/\\|'|\r|\n|\t|\u2028|\u2029/g,$=/.^/,ua=/\\(\\|'|r|n|t|u2028|u2029)/g,B="[object Array]",ka="[object Boolean]",la="[object Date]",ba="[object Function]",L="[object Number]",ma="[object RegExp]",F="[object String]",z=Array.prototype,N=Object.prototype,C=z.concat,r=N.hasOwnProperty,G=z.push,m=z.slice,k=N.toString,za=q.isFinite,N=Object.keys,va=q.clearTimeout,K=
|
a})();var Z="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(q=global),exports),wa=0,xa=q._,ya=/\\|'|\r|\n|\t|\u2028|\u2029/g,$=/.^/,ua=/\\(\\|'|r|n|t|u2028|u2029)/g,B="[object Array]",ka="[object Boolean]",la="[object Date]",ba="[object Function]",L="[object Number]",ma="[object RegExp]",F="[object String]",z=Array.prototype,N=Object.prototype,C=z.concat,r=N.hasOwnProperty,G=z.push,m=z.slice,k=N.toString,za=q.isFinite,N=Object.keys,va=q.clearTimeout,K=
|
||||||
q.setTimeout,O={b:"c",m:"var M=j.apply([],D.call(arguments,1))",h:"[]",g:"if(q(M,c[p])<0)C.push(c[p])"},v={h:"J",g:"if(!f(h[p],p,h))return!C"},aa={b:"x",h:"x",d:"for(var E,j=1,w=arguments.length;j<w;j++){E=arguments[j]",j:"p in E",g:"x[p]=E[p]",n:o,a:"}"},A={h:"[]",g:"f(h[p],p,h)&&C.push(h[p])"},l={b:"h,f,H",m:"if(!f){f=o}else if(H){f=e(f,H)}",h:"h",g:"f(h[p],p,h)"},oa={b:"x",m:"if(x!==Object(x))throw TypeError()",h:"[]",g:"C.push(p)"},w={h:"",f:"[]",d:{c:"C=Array(w)",k:"C=[]"},g:{c:"C[p]=f(h[p],p,h)",
|
q.setTimeout,O={b:"c",m:"var M=j.apply([],D.call(arguments,1))",h:"[]",g:"if(q(M,c[p])<0)C.push(c[p])"},v={h:"J",g:"if(!f(h[p],p,h))return!C"},aa={b:"x",h:"x",d:"for(var E,j=1,w=arguments.length;j<w;j++){E=arguments[j]",j:"p in E",g:"x[p]=E[p]",n:o,a:"}"},A={h:"[]",g:"f(h[p],p,h)&&C.push(h[p])"},l={b:"h,f,H",m:"if(!f){f=o}else if(H){f=e(f,H)}",h:"h",g:"f(h[p],p,h)"},oa={b:"x",m:"if(x!==Object(x))throw TypeError()",h:"[]",g:"C.push(p)"},w={h:"",f:"[]",d:{c:"C=Array(w)",k:"C=[]"},g:{c:"C[p]=f(h[p],p,h)",
|
||||||
k:"C[C.length]=f(h[p],p,h)"}},x={m:"var k,C=-r,i=C;if(!f){if(t(h)&&h[0]===+h[0])return y.max.apply(y,h);if(u(h))return C;}else if(H)f=e(f,H)",g:"k=f?f(h[p],p,h):h[p];if(k>=i)i=k,C=h[p]"},E=Array.isArray||function(a){return k.call(a)==B},ca=g({b:"L",i:"b",m:"var g=I.call(L)",h:"J",d:"if(g==d||g==F)return !L.length",g:"return l"}),pa=g({b:"h,G",h:"l",g:"if(h[p]===G)return J"}),X=g(l,v),W=g(l,A),qa=g(l,{g:"if(f(h[p],p,h))return h[p]"}),u=g(l),Aa=g(l,{h:"{}",d:"var A,v=I.call(f)==m;if(v&&H)f=e(f,H)",
|
k:"C[C.length]=f(h[p],p,h)"}},x={m:"var k,i=-r,C=i;if(!f){if(t(h)&&h[0]===+h[0])return y.max.apply(y,h);if(u(h))return C}else if(H)f=e(f,H)",g:"k=f?f(h[p],p,h):h[p];if(k>=i)i=k,C=h[p]"},E=Array.isArray||function(a){return k.call(a)==B},ca=g({b:"L",i:"b",m:"var g=I.call(L)",h:"J",d:"if(g==d||g==F)return!L.length",g:"return l"}),pa=g({b:"h,G",h:"l",g:"if(h[p]===G)return J"}),X=g(l,v),W=g(l,A),qa=g(l,{g:"if(f(h[p],p,h))return h[p]"}),u=g(l),Aa=g(l,{h:"{}",d:"var A,v=I.call(f)==m;if(v&&H)f=e(f,H)",g:"A=v?f(h[p],p,h):h[p][f];(C[A]||(C[A]=[])).push(h[p])"}),
|
||||||
g:"A=v?f(h[p],p,h):h[p][f];(C[A]||(C[A]=[])).push(h[p])"}),Ba=g(w,{b:"h,z",m:"var b=D.call(arguments,2),v=I.call(z)==m",g:{c:"C[p]=(v?z:h[p][z]).apply(h[p],b)",k:"C[C.length]=(v?z:h[p][z]).apply(h[p],b)"}}),I=g(l,w),ra=g(l,x),x=g(l,x,{m:x.m.replace("-","").replace("max","min"),g:x.g.replace(">=","<")}),P=g(w,{b:"h,B",g:{c:"C[p]=h[p][B]",k:"C[C.length]=h[p][B]"}}),J=g({b:"h,f,a,H",m:"var s=arguments.length>2;if(H)f=e(f,H)",h:"a",d:{c:"if(!s)C=h[++p]"},g:{c:"C=f(C,h[p],p,h)",k:"C=s?f(C,h[p],p,h):(s=J,h[p])"}}),
|
Ba=g(w,{b:"h,z",m:"var b=D.call(arguments,2),v=I.call(z)==m",g:{c:"C[p]=(v?z:h[p][z]).apply(h[p],b)",k:"C[C.length]=(v?z:h[p][z]).apply(h[p],b)"}}),I=g(l,w),ra=g(l,x),x=g(l,x,{m:x.m.replace("-","").replace("max","min"),g:x.g.replace(">=","<")}),P=g(w,{b:"h,B",g:{c:"C[p]=h[p][B]",k:"C[C.length]=h[p][B]"}}),J=g({b:"h,f,a,H",m:"var s=arguments.length>2;if(H)f=e(f,H)",h:"a",d:{c:"if(!s)C=h[++p]"},g:{c:"C=f(C,h[p],p,h)",k:"C=s?f(C,h[p],p,h):(s=J,h[p])"}}),A=g(l,A,{g:"!"+A.g}),v=g(l,v,{h:"l",g:v.g.replace("!",
|
||||||
A=g(l,A,{g:"!"+A.g}),v=g(l,v,{h:"l",g:v.g.replace("!","")}),sa=g(w,{b:"h",g:{c:"C[p]=h[p]",k:"C[C.length]=h[p]"}}),w=g({b:"c",h:"[]",g:"if(c[p])C.push(c[p])"}),l=g(O),O=g(O,{m:"var M=D.call(arguments,1)",h:"[]"}),ta=g(aa,{g:"if(x[p]==K)"+aa.g}),Q=g(aa),M=g(oa,{m:"",n:o,g:"if(I.call(x[p])==m)C.push(p)",l:"C.sort()"});R(arguments)||(R=function(a){return!(!a||!r.call(a,"callee"))});var U=N||g(oa);Q(i,{VERSION:"0.1.0",templateSettings:{escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},
|
"")}),sa=g(w,{b:"h",g:{c:"C[p]=h[p]",k:"C[C.length]=h[p]"}}),w=g({b:"c",h:"[]",g:"if(c[p])C.push(c[p])"}),l=g(O),O=g(O,{m:"var M=D.call(arguments,1)",h:"[]"}),ta=g(aa,{g:"if(x[p]==K)"+aa.g}),Q=g(aa),M=g(oa,{m:"",n:o,g:"if(I.call(x[p])==m)C.push(p)",l:"C.sort()"});R(arguments)||(R=function(a){return!(!a||!r.call(a,"callee"))});var U=N||g(oa);Q(i,{VERSION:"0.1.0",templateSettings:{escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},after:function(a,b){return 1>a?b():
|
||||||
after:function(a,b){return 1>a?b():function(){if(1>--a)return b.apply(this,arguments)}},bind:s,bindAll:function(a){var b=arguments,c=1;1==b.length&&(c=0,b=M(a));for(var d=b.length;c<d;c++)a[b[c]]=s(a[b[c]],a);return a},chain:function(a){return(new p(a)).chain()},clone:function(a){return a!==Object(a)?a:E(a)?a.slice():Q({},a)},compact:w,compose:function(){var a=arguments;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}},contains:pa,debounce:ja,defaults:ta,defer:function(a){var b=
|
function(){if(1>--a)return b.apply(this,arguments)}},bind:s,bindAll:function(a){var b=arguments,c=1;1==b.length&&(c=0,b=M(a));for(var d=b.length;c<d;c++)a[b[c]]=s(a[b[c]],a);return a},chain:function(a){return(new p(a)).chain()},clone:function(a){return a!==Object(a)?a:E(a)?a.slice():Q({},a)},compact:w,compose:function(){var a=arguments;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}},contains:pa,debounce:ja,defaults:ta,defer:function(a){var b=m.call(arguments,
|
||||||
m.call(arguments,1);return K(function(){return a.apply(h,b)},1)},delay:function(a,b){var c=m.call(arguments,2);return K(function(){return a.apply(h,c)},b)},difference:l,escape:function(a){return(a+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},every:X,extend:Q,filter:W,find:qa,first:V,flatten:fa,forEach:u,functions:M,groupBy:Aa,has:function(a,b){return r.call(a,b)},identity:S,indexOf:D,initial:function(a,b,
|
1);return K(function(){return a.apply(h,b)},1)},delay:function(a,b){var c=m.call(arguments,2);return K(function(){return a.apply(h,c)},b)},difference:l,escape:function(a){return(a+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},every:X,extend:Q,filter:W,find:qa,first:V,flatten:fa,forEach:u,functions:M,groupBy:Aa,has:function(a,b){return r.call(a,b)},identity:S,indexOf:D,initial:function(a,b,c){return m.call(a,
|
||||||
c){return m.call(a,0,-(b==h||c?1:b))},intersection:ga,invoke:Ba,isArguments:R,isArray:E,isBoolean:function(a){return a===n||a===o||k.call(a)==ka},isDate:function(a){return k.call(a)==la},isElement:function(a){return!!(a&&1==a.nodeType)},isEmpty:ca,isEqual:Y,isFinite:function(a){return za(a)&&k.call(a)==L},isFunction:t,isNaN:function(a){return k.call(a)==L&&a!=+a},isNull:function(a){return null===a},isNumber:function(a){return k.call(a)==L},isObject:function(a){return a===Object(a)},isRegExp:function(a){return k.call(a)==
|
0,-(b==h||c?1:b))},intersection:ga,invoke:Ba,isArguments:R,isArray:E,isBoolean:function(a){return a===n||a===o||k.call(a)==ka},isDate:function(a){return k.call(a)==la},isElement:function(a){return!!(a&&1==a.nodeType)},isEmpty:ca,isEqual:Y,isFinite:function(a){return za(a)&&k.call(a)==L},isFunction:t,isNaN:function(a){return k.call(a)==L&&a!=+a},isNull:function(a){return null===a},isNumber:function(a){return k.call(a)==L},isObject:function(a){return a===Object(a)},isRegExp:function(a){return k.call(a)==
|
||||||
ma},isString:function(a){return k.call(a)==F},isUndefined:function(a){return a===h},keys:U,last:ha,lastIndexOf:function(a,b){if(a==h)return-1;for(var c=a.length;c--;)if(a[c]===b)return c;return-1},map:I,max:ra,memoize:function(a,b){var c={};return function(){var d=b?b.apply(this,arguments):arguments[0];return r.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},min:x,mixin:na,noConflict:function(){q._=xa;return this},once:function(a){var b,c=o;return function(){if(c)return b;c=n;return b=a.apply(this,
|
ma},isString:function(a){return k.call(a)==F},isUndefined:function(a){return a===h},keys:U,last:ha,lastIndexOf:function(a,b){if(a==h)return-1;for(var c=a.length;c--;)if(a[c]===b)return c;return-1},map:I,max:ra,memoize:function(a,b){var c={};return function(){var d=b?b.apply(this,arguments):arguments[0];return r.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},min:x,mixin:na,noConflict:function(){q._=xa;return this},once:function(a){var b,c=o;return function(){if(c)return b;c=n;return b=a.apply(this,
|
||||||
arguments)}},pick:function(a){for(var b,c=-1,d=C.apply([],m.call(arguments,1)),e=d.length,f={};++c<e;)b=d[c],b in a&&(f[b]=a[b]);return f},pluck:P,range:function(a,b,c){c||(c=1);2>arguments.length&&(b=a||0,a=0);for(var d=-1,e=Math.max(Math.ceil((b-a)/c),0),f=Array(e);++d<e;)f[d]=a,a+=c;return f},reduce:J,reduceRight:da,reject:A,rest:ia,result:function(a,b){if(a==h)return null;var c=a[b];return t(c)?a[b]():c},shuffle:function(a){var b,c=[];u(a,function(a,e){b=Math.floor(Math.random()*(e+1));c[e]=c[b];
|
arguments)}},pick:function(a){for(var b,c=-1,d=C.apply([],m.call(arguments,1)),e=d.length,f={};++c<e;)b=d[c],b in a&&(f[b]=a[b]);return f},pluck:P,range:function(a,b,c){c||(c=1);2>arguments.length&&(b=a||0,a=0);for(var d=-1,e=Math.max(Math.ceil((b-a)/c),0),f=Array(e);++d<e;)f[d]=a,a+=c;return f},reduce:J,reduceRight:da,reject:A,rest:ia,result:function(a,b){if(a==h)return null;var c=a[b];return t(c)?a[b]():c},shuffle:function(a){var b,c=[];u(a,function(a,e){b=Math.floor(Math.random()*(e+1));c[e]=c[b];
|
||||||
c[b]=a});return c},size:function(a){var b=k.call(a);return b==B||b==F?a.length:U(a).length},some:v,sortBy:function(a,b,c){if(t(b))c&&(b=s(b,c));else var d=b,b=function(a){return a[d]};return P(I(a,function(c,f){return{a:b(c,f,a),b:c}}).sort(function(a,b){var c=a.a,d=b.a;return c===h?1:d===h?-1:c<d?-1:c>d?1:0}),"b")},sortedIndex:ea,tap:function(a,b){b(a);return a},template:function(a,b,c){function d(a){return e.call(this,a,i)}c=ta(c||{},i.templateSettings);a="__p+='"+a.replace(ya,function(a){return"\\"+
|
c[b]=a});return c},size:function(a){var b=k.call(a);return b==B||b==F?a.length:U(a).length},some:v,sortBy:function(a,b,c){if(t(b))c&&(b=s(b,c));else var d=b,b=function(a){return a[d]};return P(I(a,function(c,f){return{a:b(c,f,a),b:c}}).sort(function(a,b){var c=a.a,d=b.a;return c===h?1:d===h?-1:c<d?-1:c>d?1:0}),"b")},sortedIndex:ea,tap:function(a,b){b(a);return a},template:function(a,b,c){function d(a){return e.call(this,a,i)}c=ta(c||{},i.templateSettings);a="__p+='"+a.replace(ya,function(a){return"\\"+
|
||||||
y[a]}).replace(c.escape||$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':_['escape'](__t))+'"}).replace(c.interpolate||$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':__t)+'"}).replace(c.evaluate||$,function(a,b){return"';"+T(b)+";__p+='"})+"';";c.variable||(a="with(object||{}){"+a+"}");var a='var __t,__j=Array.prototype.join,__p="";function print(){__p+=__j.call(arguments,"")}'+a+"return __p",e=Function(c.variable||"object","_",a);if(b)return e(b,i);d.source="function("+(c.variable||"object")+
|
y[a]}).replace(c.escape||$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':_['escape'](__t))+'"}).replace(c.interpolate||$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':__t)+'"}).replace(c.evaluate||$,function(a,b){return"';"+T(b)+";__p+='"})+"';\n";c.variable||(a="with(object||{}){"+a+"}");var a='var __t,__j=Array.prototype.join,__p="";function print(){__p+=__j.call(arguments,"")}'+a+"return __p",e=Function(c.variable||"object","_",a);if(b)return e(b,i);d.source="function("+(c.variable||"object")+
|
||||||
"){"+a+"}";return d},throttle:function(a,b){var c,d,e,f,g,i,k=ja(function(){d=g=o},b);return function(){c=arguments;f=this;i||(i=K(function(){i=h;d&&a.apply(f,c);k()},b));g?d=n:e=a.apply(f,c);k();g=n;return e}},times:function(a,b,c){c&&(b=s(b,c));for(c=0;c<a;c++)b(c)},toArray:function(a){if(!a)return[];if(t(a.toArray))return a.toArray();var b=a.length;return b===+b?m.call(a):sa(a)},union:function(){return H(C.apply([],arguments))},uniq:H,uniqueId:function(a){var b=wa++;return a?a+b:b},values:sa,without:O,
|
"){"+a+"}";return d},throttle:function(a,b){var c,d,e,f,g,i,k=ja(function(){d=g=o},b);return function(){c=arguments;f=this;i||(i=K(function(){i=h;d&&a.apply(f,c);k()},b));g?d=n:e=a.apply(f,c);k();g=n;return e}},times:function(a,b,c){c&&(b=s(b,c));for(c=0;c<a;c++)b(c)},toArray:function(a){if(!a)return[];if(t(a.toArray))return a.toArray();var b=a.length;return b===+b?m.call(a):sa(a)},union:function(){return H(C.apply([],arguments))},uniq:H,uniqueId:function(a){var b=wa++;return a?a+b:b},values:sa,without:O,
|
||||||
wrap:function(a,b){return function(){var c=[a];G.apply(c,arguments);return b.apply(this,c)}},zip:function(){for(var a=-1,b=ra(P(arguments,"length")),c=Array(b);++a<b;)c[a]=P(arguments,a);return c},all:X,any:v,collect:I,detect:qa,each:u,foldl:J,foldr:da,head:V,include:pa,inject:J,intersect:ga,methods:M,select:W,tail:ia,take:V,unique:H});p.prototype=i.prototype;na(i);u("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=z[a];i.prototype[a]=function(){var a=this.o;b.apply(a,arguments);
|
wrap:function(a,b){return function(){var c=[a];G.apply(c,arguments);return b.apply(this,c)}},zip:function(){for(var a=-1,b=ra(P(arguments,"length")),c=Array(b);++a<b;)c[a]=P(arguments,a);return c},all:X,any:v,collect:I,detect:qa,each:u,foldl:J,foldr:da,head:V,include:pa,inject:J,intersect:ga,methods:M,select:W,tail:ia,take:V,unique:H});p.prototype=i.prototype;na(i);u("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=z[a];i.prototype[a]=function(){var a=this.o;b.apply(a,arguments);
|
||||||
a.length===0&&delete a[0];return this.p?(new p(a)).chain():a}});u(["concat","join","slice"],function(a){var b=z[a];p.prototype[a]=function(){var a=b.apply(this.o,arguments);return this.p?(new p(a)).chain():a}});Q(p.prototype,{chain:function(){this.p=n;return this},value:function(){return this.o}});Z?"object"==typeof module&&module&&module.q==Z?(module.q=i)._=i:Z._=i:(q._=i,"function"==typeof define&&"object"==typeof define.amd&&define.amd&&define(function(){return i}))})(this);
|
a.length===0&&delete a[0];return this.p?(new p(a)).chain():a}});u(["concat","join","slice"],function(a){var b=z[a];p.prototype[a]=function(){var a=b.apply(this.o,arguments);return this.p?(new p(a)).chain():a}});Q(p.prototype,{chain:function(){this.p=n;return this},value:function(){return this.o}});Z?"object"==typeof module&&module&&module.q==Z?(module.q=i)._=i:Z._=i:(q._=i,"function"==typeof define&&"object"==typeof define.amd&&define.amd&&define(function(){return i}))})(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user