mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Change _.defaults to not overwrite null values.
Former-commit-id: 4a85aefc3eaf2180fb0e8cd0f6efb1524a9d7caa
This commit is contained in:
39
dist/lodash.compat.js
vendored
39
dist/lodash.compat.js
vendored
@@ -438,23 +438,16 @@
|
||||
};
|
||||
|
||||
/** Reusable iterator options for `assign` and `defaults` */
|
||||
var assignIteratorOptions = {
|
||||
var defaultsIteratorOptions = {
|
||||
'args': 'object, source, guard',
|
||||
'top':
|
||||
'var args = arguments,\n' +
|
||||
' argsIndex = 0,\n' +
|
||||
" argsLength = typeof guard == 'number' ? 2 : arguments.length;\n" +
|
||||
'if (argsLength > 2) {\n' +
|
||||
" if (typeof args[argsLength - 2] == 'function') {\n" +
|
||||
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
|
||||
" } else if (typeof args[argsLength - 1] == 'function') {\n" +
|
||||
' callback = args[--argsLength];\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
" argsLength = typeof guard == 'number' ? 2 : args.length;\n" +
|
||||
'while (++argsIndex < argsLength) {\n' +
|
||||
' iterable = arguments[argsIndex];\n' +
|
||||
' iterable = args[argsIndex];\n' +
|
||||
' if (iterable && objectTypes[typeof iterable]) {',
|
||||
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]',
|
||||
'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]",
|
||||
'bottom': ' }\n}'
|
||||
};
|
||||
|
||||
@@ -1056,7 +1049,20 @@
|
||||
* defaults(food, { 'name': 'banana', 'type': 'fruit' });
|
||||
* // => { 'name': 'apple', 'type': 'fruit' }
|
||||
*/
|
||||
var assign = createIterator(assignIteratorOptions);
|
||||
var assign = createIterator(defaultsIteratorOptions, {
|
||||
'top':
|
||||
defaultsIteratorOptions.top.replace(';',
|
||||
';\n' +
|
||||
'if (argsLength > 2) {\n' +
|
||||
" if (typeof args[argsLength - 2] == 'function') {\n" +
|
||||
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
|
||||
" } else if (typeof args[argsLength - 1] == 'function') {\n" +
|
||||
' callback = args[--argsLength];\n' +
|
||||
' }\n' +
|
||||
'}'
|
||||
),
|
||||
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]'
|
||||
});
|
||||
|
||||
/**
|
||||
* Creates a clone of `value`. If `deep` is `true`, nested objects will also
|
||||
@@ -1231,9 +1237,8 @@
|
||||
|
||||
/**
|
||||
* Assigns own enumerable properties of source object(s) to the destination
|
||||
* object for all destination properties that resolve to `null`/`undefined`.
|
||||
* Once a property is set, additional defaults of the same property will be
|
||||
* ignored.
|
||||
* object for all destination properties that resolve to `undefined`. Once a
|
||||
* property is set, additional defaults of the same property will be ignored.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -1250,9 +1255,7 @@
|
||||
* _.defaults(food, { 'name': 'banana', 'type': 'fruit' });
|
||||
* // => { 'name': 'apple', 'type': 'fruit' }
|
||||
*/
|
||||
var defaults = createIterator(assignIteratorOptions, {
|
||||
'loop': 'if (result[index] == null) ' + assignIteratorOptions.loop
|
||||
});
|
||||
var defaults = createIterator(defaultsIteratorOptions);
|
||||
|
||||
/**
|
||||
* Creates a sorted array of all enumerable properties, own and inherited,
|
||||
|
||||
40
dist/lodash.compat.min.js
vendored
40
dist/lodash.compat.min.js
vendored
@@ -7,35 +7,35 @@
|
||||
;(function(n,t){function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||it);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(Ot.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return Ot.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
|
||||
}return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=Q,a=n.apply(c,a),x(a)?a:c):n.apply(c,a)}var o=w(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,t,r){if(n==Q)return V;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=pr(n);return function(t){for(var r=u.length,e=W;r--&&(e=j(t[u[r]],n[u[r]],ot)););return e
|
||||
}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function a(){for(var n,t={e:Z,f:nt,g:Gt,i:Jt,j:Xt,k:_t,b:"l(n)",c:"",h:"",l:"",m:J},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],r="var j,n="+t.d+",u=n;if(!n)return u;"+t.l+";",t.b?(r+="var o=n.length;j=-1;if("+t.b+"){",t.j&&(r+="if(m(n)){n=n.split('')}"),r+="while(++j<o){"+t.h+"}}else{"):t.i&&(r+="var o=n.length;j=-1;if(o&&k(n)){while(++j<o){j+='';"+t.h+"}}else{"),t.f&&(r+="var v=typeof n=='function';"),t.g&&t.m?(r+="var s=-1,t=r[typeof n]?p(n):[],o=t.length;while(++s<o){j=t[s];",t.f&&(r+="if(!(v&&j=='prototype')){"),r+=t.h+"",t.f&&(r+="}")):(r+="for(j in n){",(t.f||t.m)&&(r+="if(",t.f&&(r+="!(v&&j=='prototype')"),t.f&&t.m&&(r+="&&"),t.m&&(r+="i.call(n,j)"),r+="){"),r+=t.h+";",(t.f||t.m)&&(r+="}")),r+="}",t.e)for(r+="var g=n.constructor;",e=0;7>e;e++)r+="j='"+t.k[e]+"';if(","constructor"==t.k[e]&&(r+="!(g&&g.prototype===n)&&"),r+="i.call(n,j)){"+t.h+"}";
|
||||
return(t.b||t.i)&&(r+="}"),r+=t.c+";return u",Function("f,i,k,l,m,r,p","return function("+n+"){"+r+"}")(f,Ot,h,lr,A,rr,$t)}function c(n){return"\\"+er[n]}function l(n){return sr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return vr[n]}function h(n){return St.call(n)==It}function y(n){var t=W;if(!n||typeof n!="object"||h(n))return t;
|
||||
return(t.b||t.i)&&(r+="}"),r+=t.c+";return u",Function("f,i,k,l,m,r,p","return function("+n+"){"+r+"}")(f,Ot,y,lr,A,rr,$t)}function c(n){return"\\"+er[n]}function l(n){return sr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return vr[n]}function y(n){return St.call(n)==It}function h(n){var t=W;if(!n||typeof n!="object"||y(n))return t;
|
||||
var r=n.constructor;return!w(r)&&(!Yt||!p(n))||r instanceof r?tt?(ar(n,function(n,r,e){return t=!Ot.call(e,r),W}),t===W):(ar(n,function(n,r){t=r}),t===W||Ot.call(n,t)):t}function m(n){var t=[];return cr(n,function(n,r){t.push(r)}),t}function d(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=W),typeof e=="function"){e=typeof u=="undefined"?e:f(e,u,1);var a=e(a),c=typeof a!="undefined";c||(a=n)}if(u=x(a)){var l=St.call(a);if(!nr[l]||Yt&&p(a))return a;var s=lr(a)}if(!u||!r)return u&&!c?s?v(a):gr({},a):a;
|
||||
switch(u=tr[l],l){case Bt:case Mt:return c?a:new u(+a);case Pt:case Kt:return c?a:new u(a);case Ct:return c?a:u(a.source,st.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=s?u(a.length):{},s&&(Ot.call(n,"index")&&(a.index=n.index),Ot.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(s?F:cr)(c?a:n,function(n,u){a[u]=d(n,r,e,t,o,i)}),a}function _(n){var t=[];return ar(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function b(n){for(var t=-1,r=pr(n),e=r.length,u={};++t<e;){var o=r[t];
|
||||
u[n[o]]=o}return u}function j(n,t,r,e,u,o){var i=r===ot;if(r&&!i){r=typeof e=="undefined"?r:f(r,e,2);var a=r(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,l=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=l&&"object"!=l))return W;if(n==Q||t==Q)return n===t;if(l=St.call(n),c=St.call(t),l==It&&(l=zt),c==It&&(c=zt),l!=c)return W;switch(l){case Bt:case Mt:return+n==+t;case Pt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Ct:case Kt:return n==t+""
|
||||
}if(c=l==Tt,!c){if(n.__wrapped__||t.__wrapped__)return j(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=zt||Yt&&(p(n)||p(t)))return W;var l=!Qt&&h(n)?Object:n.constructor,s=!Qt&&h(t)?Object:t.constructor;if(l!=s&&(!w(l)||!(l instanceof l&&w(s)&&s instanceof s)))return W}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var v=0,a=J;if(u.push(n),o.push(t),c){if(v=t.length,a=i||v==n.length)for(;v--&&(a=j(n[v],t[v],r,e,u,o)););return a}return ar(t,function(t,i,f){return Ot.call(f,i)?(v++,a=Ot.call(n,i)&&j(n[i],t,r,e,u,o)):void 0
|
||||
}if(c=l==Tt,!c){if(n.__wrapped__||t.__wrapped__)return j(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=zt||Yt&&(p(n)||p(t)))return W;var l=!Qt&&y(n)?Object:n.constructor,s=!Qt&&y(t)?Object:t.constructor;if(l!=s&&(!w(l)||!(l instanceof l&&w(s)&&s instanceof s)))return W}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var v=0,a=J;if(u.push(n),o.push(t),c){if(v=t.length,a=i||v==n.length)for(;v--&&(a=j(n[v],t[v],r,e,u,o)););return a}return ar(t,function(t,i,f){return Ot.call(f,i)?(v++,a=Ot.call(n,i)&&j(n[i],t,r,e,u,o)):void 0
|
||||
}),a&&!i&&ar(n,function(n,t,r){return Ot.call(r,t)?a=-1<--v:void 0}),a}function w(n){return typeof n=="function"}function x(n){return n?rr[typeof n]:W}function O(n){return typeof n=="number"||St.call(n)==Pt}function A(n){return typeof n=="string"||St.call(n)==Kt}function S(n,t,r){var e=arguments,u=0,o=2;if(!x(n))return n;if(r===ot)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length),2<o&&("function"==typeof e[o-2]?i=f(e[--o-1],e[o--],2):"function"==typeof e[o-1]&&(i=e[--o]));for(;++u<o;)(lr(e[u])?F:cr)(e[u],function(t,r){var e,u,o=t,f=n[r];
|
||||
if(t&&((u=lr(t))||yr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?lr(f)?f:[]:yr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=S(f,t,ot,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function E(n){for(var t=-1,r=pr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function k(n,t,r){var e=-1,u=n?n.length:0,o=W;return r=(0>r?Ft(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):fr(n,function(n){return++e<r?void 0:!(o=n===t)
|
||||
if(t&&((u=lr(t))||hr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?lr(f)?f:[]:hr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=S(f,t,ot,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function E(n){for(var t=-1,r=pr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function k(n,t,r){var e=-1,u=n?n.length:0,o=W;return r=(0>r?Ft(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):fr(n,function(n){return++e<r?void 0:!(o=n===t)
|
||||
}),o}function N(n,t,r){var e=J;if(t=f(t,r),lr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else fr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function R(n,t,r){var e=[];if(t=f(t,r),lr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else fr(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function $(n,t,r){var e;return t=f(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,W):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&lr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==W;);}else fr(n,t,r);
|
||||
return n}function q(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),lr(n))for(;++e<u;)o[e]=t(n[e],e,n);else fr(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function D(n,t,r){var e=-1/0,o=e;if(!t&&lr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&A(n)?u:f(t,r),fr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function I(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),lr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else fr(n,function(n,e,o){r=u?(u=W,n):t(r,n,e,o)
|
||||
});return r}function T(n,t,r,e){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var a=pr(n),o=a.length;else Xt&&A(n)&&(u=n.split(""));return t=f(t,e,4),F(n,function(n,e,f){e=a?a[--o]:--o,r=i?(i=W,u[e]):t(r,u[e],e,f)}),r}function B(n,t,r){var e;if(t=f(t,r),lr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else fr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function M(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=-1;for(t=f(t,r);++o<u&&t(n[o],o,n);)e++
|
||||
}else if(e=t,e==Q||r)return n[0];return v(n,0,qt(Ft(0,e),u))}}function P(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];lr(o)?At.apply(u,t?o:P(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Ft(0,u+r):r||0)-1;else if(r)return e=K(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function C(n,t,r){if(typeof t!="number"&&t!=Q){var e=0,u=-1,o=n?n.length:0;for(t=f(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==Q||r?1:Ft(0,t);return v(n,e)}function K(n,t,r,e){var u=0,o=n?n.length:u;
|
||||
for(r=r?f(r,e,1):V,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function L(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;typeof t=="function"&&(e=r,r=t,t=W);var c=!t&&75<=o;if(c)var l={};for(r&&(a=[],r=f(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=Ot.call(l,s)?!(a=l[s]):a=l[s]=[];(t?!u||a[a.length-1]!==p:s||0>z(a,p))&&((r||c)&&a.push(p),i.push(e))}return i}function U(n,t){return Vt||Et&&2<arguments.length?Et.call.apply(Et,arguments):i(n,t,v(arguments,2))}function V(n){return n}function G(n){F(_(n),function(t){var e=r[t]=n[t];
|
||||
r.prototype[t]=function(){var n=[this.__wrapped__];return At.apply(n,arguments),new r(e.apply(r,n))}})}function H(){return this.__wrapped__}var J=!0,Q=null,W=!1,X=typeof exports=="object"&&exports,Y=typeof global=="object"&&global;Y.global===Y&&(n=Y);var Z,nt,tt,rt=[],et={},ut=0,ot=et,it=30,ft=n._,at=/&(?:amp|lt|gt|quot|#39);/g,ct=/\b__p\+='';/g,lt=/\b(__p\+=)''\+/g,pt=/(__e\(.*?\)|\b__t\))\+'';/g,st=/\w*$/,vt=RegExp("^"+(et.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),gt=/\$\{((?:(?=\\?)\\?[\s\S])*?)\}/g,ht=/<%=([\s\S]+?)%>/g,yt=/($^)/,mt=/[&<>"']/g,dt=/['\n\r\t\u2028\u2029\\]/g,_t="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),bt=Math.ceil,jt=rt.concat,wt=Math.floor,xt=vt.test(xt=Object.getPrototypeOf)&&xt,Ot=et.hasOwnProperty,At=rt.push,St=et.toString,Et=vt.test(Et=v.bind)&&Et,kt=vt.test(kt=Array.isArray)&&kt,Nt=n.isFinite,Rt=n.isNaN,$t=vt.test($t=Object.keys)&&$t,Ft=Math.max,qt=Math.min,Dt=Math.random,It="[object Arguments]",Tt="[object Array]",Bt="[object Boolean]",Mt="[object Date]",Pt="[object Number]",zt="[object Object]",Ct="[object RegExp]",Kt="[object String]",Lt=!!n.attachEvent,Ut=Et&&!/\n|true/.test(Et+Lt),Vt=Et&&!Ut,Gt=$t&&(Lt||Ut),Ht=(Ht={0:1,length:1},rt.splice.call(Ht,0,1),Ht[0]),Jt=J;
|
||||
(function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Jt=!r;Z=!/valueOf/.test(t),nt=n.propertyIsEnumerable("prototype"),tt="x"!=t[0]})(1);var Qt=arguments.constructor==Object,Wt=!h(arguments),Xt="xx"!="x"[0]+Object("x")[0];try{var Yt=St.call(document)==zt&&!({toString:0}+"")}catch(Zt){}var nr={"[object Function]":W};nr[It]=nr[Tt]=nr[Bt]=nr[Mt]=nr[Pt]=nr[zt]=nr[Ct]=nr[Kt]=J;var tr={};tr[Tt]=Array,tr[Bt]=Boolean,tr[Mt]=Date,tr[zt]=Object,tr[Pt]=Number,tr[Ct]=RegExp,tr[Kt]=String;
|
||||
var rr={"boolean":W,"function":J,object:J,number:W,string:W,undefined:W},er={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:ht,variable:"",imports:{_:r}};var ur={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:arguments.length;if(c>2){if(typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(typeof a[c-1]=='function'){d=a[--c];}}while(++b<c){n=arguments[b];if(n&&r[typeof n]){",h:"u[j]=d?d(u[j],n[j]):n[j]",c:"}}"},or={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},ir={l:"if(!r[typeof n])return u;"+or.l,b:W},fr=a(or);
|
||||
Wt&&(h=function(n){return n?Ot.call(n,"callee"):W});var ar=a(or,ir,{m:W}),cr=a(or,ir),lr=kt||function(n){return Qt&&n instanceof Array||St.call(n)==Tt},pr=$t?function(n){return x(n)?nt&&typeof n=="function"||Jt&&n.length&&h(n)?m(n):$t(n):[]}:m,sr={"&":"&","<":"<",">":">",'"':""","'":"'"},vr=b(sr),gr=a(ur),hr=a(ur,{h:"if(u[j]==null)"+ur.h});w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==St.call(n)});var yr=xt?function(n){if(!n||typeof n!="object")return W;
|
||||
var t=n.valueOf,r=typeof t=="function"&&(r=xt(t))&&xt(r);return r?n==r||xt(n)==r&&!h(n):y(n)}:y,mr=q,dr=R;r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=gr,r.at=function(n){var t=-1,r=jt.apply(rt,v(arguments,1)),e=r.length,u=Array(e);for(Xt&&A(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];return u},r.bind=U,r.bindAll=function(n){for(var t=jt.apply(rt,arguments),r=1<t.length?0:(t=_(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=U(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,v(arguments,2))
|
||||
},r.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},r.countBy=function(n,t,r){var e={};return t=f(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",Ot.call(e,r)?e[r]++:e[r]=1}),e},r.debounce=function(n,t,r){function e(){f=Q,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o
|
||||
}},r.defaults=hr,r.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},r.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=jt.apply(rt,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=R,r.flatten=P,r.forEach=F,r.forIn=ar,r.forOwn=cr,r.functions=_,r.groupBy=function(n,t,r){var e={};return t=f(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(Ot.call(e,r)?e[r]:e[r]=[]).push(n)
|
||||
}),e},r.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=u;for(t=f(t,r);o--&&t(n[o],o,n);)e++}else e=t==Q||r?1:t||e;return v(n,0,qt(Ft(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=Ot.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;a.push(l)}}return a},r.invert=b,r.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);
|
||||
return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=pr,r.map=q,r.max=D,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return Ot.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=S,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&lr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a)}}else t=!t&&A(n)?u:f(t,r),fr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)});return o},r.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];
|
||||
t?u[o]=t[r]:u[o[0]]=o[1]}return u},r.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=f(t,r);else var o=jt.apply(rt,arguments);return ar(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=J,r=n.apply(this,arguments),n=Q,r)}},r.pairs=function(n){for(var t=-1,r=pr(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},r.partial=function(n){return i(n,v(arguments,1))},r.partialRight=function(n){return i(n,v(arguments,1),Q,ot)
|
||||
},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=jt.apply(rt,arguments),i=x(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),ar(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=mr,r.range=function(n,t,r){n=+n||0,r=+r||1,t==Q&&(t=n,n=0);var e=-1;t=Ft(0,bt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},r.reject=function(n,t,r){return t=f(t,r),R(n,function(n,r,e){return!t(n,r,e)})},r.rest=C,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);
|
||||
return F(n,function(n){var r=wt(Dt()*(++t+1));e[t]=e[r],e[r]=n}),e},r.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=f(t,r),F(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},r.tap=function(n,t){return t(n),n},r.throttle=function(n,t){function r(){f=new Date,i=Q,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=Q,f=a,u=n.apply(o,e)),u
|
||||
}},r.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},r.toArray=function(n){return n&&typeof n.length=="number"?Xt&&A(n)?n.split(""):v(n):E(n)},r.union=function(){return L(jt.apply(rt,arguments))},r.uniq=L,r.values=E,r.where=dr,r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n];return At.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?D(mr(arguments,"length")):0,e=Array(r);++t<r;)e[t]=mr(arguments,t);
|
||||
return e},r.collect=q,r.drop=C,r.each=F,r.extend=gr,r.methods=_,r.select=R,r.tail=C,r.unique=L,G(r),r.clone=d,r.cloneDeep=function(n,t,r){return d(n,J,t,r)},r.contains=k,r.escape=function(n){return n==Q?"":(n+"").replace(mt,l)},r.every=N,r.find=$,r.has=function(n,t){return n?Ot.call(n,t):W},r.identity=V,r.indexOf=z,r.isArguments=h,r.isArray=lr,r.isBoolean=function(n){return n===J||n===W||St.call(n)==Bt},r.isDate=function(n){return n instanceof Date||St.call(n)==Mt},r.isElement=function(n){return n?1===n.nodeType:W
|
||||
},r.isEmpty=function(n){var t=J;if(!n)return t;var r=St.call(n),e=n.length;return r==Tt||r==Kt||r==It||Wt&&h(n)||r==zt&&typeof e=="number"&&w(n.splice)?!e:(cr(n,function(){return t=W}),t)},r.isEqual=j,r.isFinite=function(n){return Nt(n)&&!Rt(parseFloat(n))},r.isFunction=w,r.isNaN=function(n){return O(n)&&n!=+n},r.isNull=function(n){return n===Q},r.isNumber=O,r.isObject=x,r.isPlainObject=yr,r.isRegExp=function(n){return n instanceof RegExp||St.call(n)==Ct},r.isString=A,r.isUndefined=function(n){return typeof n=="undefined"
|
||||
},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Ft(0,e+r):qt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=G,r.noConflict=function(){return n._=ft,this},r.random=function(n,t){return n==Q&&t==Q&&(t=1),n=+n||0,t==Q&&(t=n,n=0),n+wt(Dt()*((+t||0)-n+1))},r.reduce=I,r.reduceRight=T,r.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:pr(n).length},r.some=B,r.sortedIndex=K,r.template=function(n,e,u){var o=r.templateSettings;
|
||||
n||(n=""),u=hr({},u,o);var i,f=hr({},u.imports,o.imports),o=pr(f),f=E(f),a=0,l=u.interpolate||yt,p="__p+='";n.replace(RegExp((u.escape||yt).source+"|"+l.source+"|"+(l===ht?gt:yt).source+"|"+(u.evaluate||yt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(dt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=J,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(ct,""):p).replace(lt,"$1").replace(pt,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";
|
||||
r.prototype[t]=function(){var n=[this.__wrapped__];return At.apply(n,arguments),new r(e.apply(r,n))}})}function H(){return this.__wrapped__}var J=!0,Q=null,W=!1,X=typeof exports=="object"&&exports,Y=typeof global=="object"&&global;Y.global===Y&&(n=Y);var Z,nt,tt,rt=[],et={},ut=0,ot=et,it=30,ft=n._,at=/&(?:amp|lt|gt|quot|#39);/g,ct=/\b__p\+='';/g,lt=/\b(__p\+=)''\+/g,pt=/(__e\(.*?\)|\b__t\))\+'';/g,st=/\w*$/,vt=RegExp("^"+(et.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),gt=/\$\{((?:(?=\\?)\\?[\s\S])*?)\}/g,yt=/<%=([\s\S]+?)%>/g,ht=/($^)/,mt=/[&<>"']/g,dt=/['\n\r\t\u2028\u2029\\]/g,_t="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),bt=Math.ceil,jt=rt.concat,wt=Math.floor,xt=vt.test(xt=Object.getPrototypeOf)&&xt,Ot=et.hasOwnProperty,At=rt.push,St=et.toString,Et=vt.test(Et=v.bind)&&Et,kt=vt.test(kt=Array.isArray)&&kt,Nt=n.isFinite,Rt=n.isNaN,$t=vt.test($t=Object.keys)&&$t,Ft=Math.max,qt=Math.min,Dt=Math.random,It="[object Arguments]",Tt="[object Array]",Bt="[object Boolean]",Mt="[object Date]",Pt="[object Number]",zt="[object Object]",Ct="[object RegExp]",Kt="[object String]",Lt=!!n.attachEvent,Ut=Et&&!/\n|true/.test(Et+Lt),Vt=Et&&!Ut,Gt=$t&&(Lt||Ut),Ht=(Ht={0:1,length:1},rt.splice.call(Ht,0,1),Ht[0]),Jt=J;
|
||||
(function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Jt=!r;Z=!/valueOf/.test(t),nt=n.propertyIsEnumerable("prototype"),tt="x"!=t[0]})(1);var Qt=arguments.constructor==Object,Wt=!y(arguments),Xt="xx"!="x"[0]+Object("x")[0];try{var Yt=St.call(document)==zt&&!({toString:0}+"")}catch(Zt){}var nr={"[object Function]":W};nr[It]=nr[Tt]=nr[Bt]=nr[Mt]=nr[Pt]=nr[zt]=nr[Ct]=nr[Kt]=J;var tr={};tr[Tt]=Array,tr[Bt]=Boolean,tr[Mt]=Date,tr[zt]=Object,tr[Pt]=Number,tr[Ct]=RegExp,tr[Kt]=String;
|
||||
var rr={"boolean":W,"function":J,object:J,number:W,string:W,undefined:W},er={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:yt,variable:"",imports:{_:r}};var ur={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:a.length;while(++b<c){n=a[b];if(n&&r[typeof n]){",h:"if(typeof u[j]=='undefined')u[j]=n[j]",c:"}}"},or={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},ir={l:"if(!r[typeof n])return u;"+or.l,b:W},fr=a(or);
|
||||
Wt&&(y=function(n){return n?Ot.call(n,"callee"):W});var ar=a(or,ir,{m:W}),cr=a(or,ir),lr=kt||function(n){return Qt&&n instanceof Array||St.call(n)==Tt},pr=$t?function(n){return x(n)?nt&&typeof n=="function"||Jt&&n.length&&y(n)?m(n):$t(n):[]}:m,sr={"&":"&","<":"<",">":">",'"':""","'":"'"},vr=b(sr),gr=a(ur,{l:ur.l.replace(";",";if(c>2){if(typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(typeof a[c-1]=='function'){d=a[--c];}}"),h:"u[j]=d?d(u[j],n[j]):n[j]"}),yr=a(ur);
|
||||
w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==St.call(n)});var hr=xt?function(n){if(!n||typeof n!="object")return W;var t=n.valueOf,r=typeof t=="function"&&(r=xt(t))&&xt(r);return r?n==r||xt(n)==r&&!y(n):h(n)}:h,mr=q,dr=R;r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=gr,r.at=function(n){var t=-1,r=jt.apply(rt,v(arguments,1)),e=r.length,u=Array(e);for(Xt&&A(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];return u},r.bind=U,r.bindAll=function(n){for(var t=jt.apply(rt,arguments),r=1<t.length?0:(t=_(n),-1),e=t.length;++r<e;){var u=t[r];
|
||||
n[u]=U(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,v(arguments,2))},r.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},r.countBy=function(n,t,r){var e={};return t=f(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",Ot.call(e,r)?e[r]++:e[r]=1}),e},r.debounce=function(n,t,r){function e(){f=Q,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;
|
||||
return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},r.defaults=yr,r.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},r.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=jt.apply(rt,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=R,r.flatten=P,r.forEach=F,r.forIn=ar,r.forOwn=cr,r.functions=_,r.groupBy=function(n,t,r){var e={};
|
||||
return t=f(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(Ot.call(e,r)?e[r]:e[r]=[]).push(n)}),e},r.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=u;for(t=f(t,r);o--&&t(n[o],o,n);)e++}else e=t==Q||r?1:t||e;return v(n,0,qt(Ft(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=Ot.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;
|
||||
a.push(l)}}return a},r.invert=b,r.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=pr,r.map=q,r.max=D,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return Ot.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=S,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&lr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a)
|
||||
}}else t=!t&&A(n)?u:f(t,r),fr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)});return o},r.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},r.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=f(t,r);else var o=jt.apply(rt,arguments);return ar(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=J,r=n.apply(this,arguments),n=Q,r)}},r.pairs=function(n){for(var t=-1,r=pr(n),e=r.length,u=Array(e);++t<e;){var o=r[t];
|
||||
u[t]=[o,n[o]]}return u},r.partial=function(n){return i(n,v(arguments,1))},r.partialRight=function(n){return i(n,v(arguments,1),Q,ot)},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=jt.apply(rt,arguments),i=x(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),ar(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=mr,r.range=function(n,t,r){n=+n||0,r=+r||1,t==Q&&(t=n,n=0);var e=-1;t=Ft(0,bt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},r.reject=function(n,t,r){return t=f(t,r),R(n,function(n,r,e){return!t(n,r,e)
|
||||
})},r.rest=C,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=wt(Dt()*(++t+1));e[t]=e[r],e[r]=n}),e},r.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=f(t,r),F(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},r.tap=function(n,t){return t(n),n},r.throttle=function(n,t){function r(){f=new Date,i=Q,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);
|
||||
return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=Q,f=a,u=n.apply(o,e)),u}},r.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},r.toArray=function(n){return n&&typeof n.length=="number"?Xt&&A(n)?n.split(""):v(n):E(n)},r.union=function(){return L(jt.apply(rt,arguments))},r.uniq=L,r.values=E,r.where=dr,r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n];
|
||||
return At.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?D(mr(arguments,"length")):0,e=Array(r);++t<r;)e[t]=mr(arguments,t);return e},r.collect=q,r.drop=C,r.each=F,r.extend=gr,r.methods=_,r.select=R,r.tail=C,r.unique=L,G(r),r.clone=d,r.cloneDeep=function(n,t,r){return d(n,J,t,r)},r.contains=k,r.escape=function(n){return n==Q?"":(n+"").replace(mt,l)},r.every=N,r.find=$,r.has=function(n,t){return n?Ot.call(n,t):W},r.identity=V,r.indexOf=z,r.isArguments=y,r.isArray=lr,r.isBoolean=function(n){return n===J||n===W||St.call(n)==Bt
|
||||
},r.isDate=function(n){return n instanceof Date||St.call(n)==Mt},r.isElement=function(n){return n?1===n.nodeType:W},r.isEmpty=function(n){var t=J;if(!n)return t;var r=St.call(n),e=n.length;return r==Tt||r==Kt||r==It||Wt&&y(n)||r==zt&&typeof e=="number"&&w(n.splice)?!e:(cr(n,function(){return t=W}),t)},r.isEqual=j,r.isFinite=function(n){return Nt(n)&&!Rt(parseFloat(n))},r.isFunction=w,r.isNaN=function(n){return O(n)&&n!=+n},r.isNull=function(n){return n===Q},r.isNumber=O,r.isObject=x,r.isPlainObject=hr,r.isRegExp=function(n){return n instanceof RegExp||St.call(n)==Ct
|
||||
},r.isString=A,r.isUndefined=function(n){return typeof n=="undefined"},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Ft(0,e+r):qt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=G,r.noConflict=function(){return n._=ft,this},r.random=function(n,t){return n==Q&&t==Q&&(t=1),n=+n||0,t==Q&&(t=n,n=0),n+wt(Dt()*((+t||0)-n+1))},r.reduce=I,r.reduceRight=T,r.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:pr(n).length
|
||||
},r.some=B,r.sortedIndex=K,r.template=function(n,e,u){var o=r.templateSettings;n||(n=""),u=yr({},u,o);var i,f=yr({},u.imports,o.imports),o=pr(f),f=E(f),a=0,l=u.interpolate||ht,p="__p+='";n.replace(RegExp((u.escape||ht).source+"|"+l.source+"|"+(l===yt?gt:ht).source+"|"+(u.evaluate||ht).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(dt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=J,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(ct,""):p).replace(lt,"$1").replace(pt,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";
|
||||
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return e?s(e):(s.source=p,s)},r.unescape=function(n){return n==Q?"":(n+"").replace(at,g)},r.uniqueId=function(n){var t=++ut;return(n==Q?"":n+"")+t},r.all=N,r.any=B,r.detect=$,r.foldl=I,r.foldr=T,r.include=k,r.inject=I,cr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return At.apply(t,arguments),n.apply(r,t)})}),r.first=M,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=u;
|
||||
for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==Q||r)return n[u-1];return v(n,Ft(0,u-e))}},r.take=M,r.head=M,cr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==Q||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.0-rc.3",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=H,r.prototype.valueOf=H,fr(["join","pop","shift"],function(n){var t=rt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
|
||||
}}),fr(["push","reverse","sort","unshift"],function(n){var t=rt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),fr(["concat","slice","splice"],function(n){var t=rt[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Ht&&fr(["pop","shift","splice"],function(n){var t=rt[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r
|
||||
|
||||
39
dist/lodash.js
vendored
39
dist/lodash.js
vendored
@@ -320,23 +320,16 @@
|
||||
};
|
||||
|
||||
/** Reusable iterator options for `assign` and `defaults` */
|
||||
var assignIteratorOptions = {
|
||||
var defaultsIteratorOptions = {
|
||||
'args': 'object, source, guard',
|
||||
'top':
|
||||
'var args = arguments,\n' +
|
||||
' argsIndex = 0,\n' +
|
||||
" argsLength = typeof guard == 'number' ? 2 : arguments.length;\n" +
|
||||
'if (argsLength > 2) {\n' +
|
||||
" if (typeof args[argsLength - 2] == 'function') {\n" +
|
||||
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
|
||||
" } else if (typeof args[argsLength - 1] == 'function') {\n" +
|
||||
' callback = args[--argsLength];\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
" argsLength = typeof guard == 'number' ? 2 : args.length;\n" +
|
||||
'while (++argsIndex < argsLength) {\n' +
|
||||
' iterable = arguments[argsIndex];\n' +
|
||||
' iterable = args[argsIndex];\n' +
|
||||
' if (iterable && objectTypes[typeof iterable]) {',
|
||||
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]',
|
||||
'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]",
|
||||
'bottom': ' }\n}'
|
||||
};
|
||||
|
||||
@@ -913,7 +906,20 @@
|
||||
* defaults(food, { 'name': 'banana', 'type': 'fruit' });
|
||||
* // => { 'name': 'apple', 'type': 'fruit' }
|
||||
*/
|
||||
var assign = createIterator(assignIteratorOptions);
|
||||
var assign = createIterator(defaultsIteratorOptions, {
|
||||
'top':
|
||||
defaultsIteratorOptions.top.replace(';',
|
||||
';\n' +
|
||||
'if (argsLength > 2) {\n' +
|
||||
" if (typeof args[argsLength - 2] == 'function') {\n" +
|
||||
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
|
||||
" } else if (typeof args[argsLength - 1] == 'function') {\n" +
|
||||
' callback = args[--argsLength];\n' +
|
||||
' }\n' +
|
||||
'}'
|
||||
),
|
||||
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]'
|
||||
});
|
||||
|
||||
/**
|
||||
* Creates a clone of `value`. If `deep` is `true`, nested objects will also
|
||||
@@ -1088,9 +1094,8 @@
|
||||
|
||||
/**
|
||||
* Assigns own enumerable properties of source object(s) to the destination
|
||||
* object for all destination properties that resolve to `null`/`undefined`.
|
||||
* Once a property is set, additional defaults of the same property will be
|
||||
* ignored.
|
||||
* object for all destination properties that resolve to `undefined`. Once a
|
||||
* property is set, additional defaults of the same property will be ignored.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -1107,9 +1112,7 @@
|
||||
* _.defaults(food, { 'name': 'banana', 'type': 'fruit' });
|
||||
* // => { 'name': 'apple', 'type': 'fruit' }
|
||||
*/
|
||||
var defaults = createIterator(assignIteratorOptions, {
|
||||
'loop': 'if (result[index] == null) ' + assignIteratorOptions.loop
|
||||
});
|
||||
var defaults = createIterator(defaultsIteratorOptions);
|
||||
|
||||
/**
|
||||
* Creates a sorted array of all enumerable properties, own and inherited,
|
||||
|
||||
35
dist/lodash.min.js
vendored
35
dist/lodash.min.js
vendored
@@ -20,20 +20,21 @@ return n}function k(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:
|
||||
return v(n,0,Nt(St(0,e),u))}}function M(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Yt(o)?bt.apply(u,t?o:M(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?St(0,u+r):r||0)-1;else if(r)return e=C(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function P(n,t,r){if(typeof t!="number"&&t!=L){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==L||r?1:St(0,t);return v(n,e)}function C(n,t,r,e){var u=0,o=n?n.length:u;
|
||||
for(r=r?a(r,e,1):V,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function K(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;typeof t=="function"&&(e=r,r=t,t=Q);var c=!t&&75<=o;if(c)var l={};for(r&&(f=[],r=a(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=_t.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>z(f,p))&&((r||c)&&f.push(p),i.push(e))}return i}function U(n,t){return Pt||wt&&2<arguments.length?wt.call.apply(wt,arguments):f(n,t,v(arguments,2))}function V(n){return n}function G(n){F(d(n),function(t){var r=e[t]=n[t];
|
||||
e.prototype[t]=function(){var n=[this.__wrapped__];return bt.apply(n,arguments),new e(r.apply(e,n))}})}function H(){return this.__wrapped__}var J=!0,L=null,Q=!1,W=typeof exports=="object"&&exports,X=typeof global=="object"&&global;X.global===X&&(n=X);var Y=[],Z={},nt=0,tt=Z,rt=30,et=n._,ut=/&(?:amp|lt|gt|quot|#39);/g,ot=/\b__p\+='';/g,it=/\b(__p\+=)''\+/g,ft=/(__e\(.*?\)|\b__t\))\+'';/g,at=/\w*$/,ct=RegExp("^"+(Z.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),lt=/\$\{((?:(?=\\?)\\?[\s\S])*?)\}/g,pt=/<%=([\s\S]+?)%>/g,st=/($^)/,vt=/[&<>"']/g,gt=/['\n\r\t\u2028\u2029\\]/g,ht=Math.ceil,yt=Y.concat,mt=Math.floor,dt=ct.test(dt=Object.getPrototypeOf)&&dt,_t=Z.hasOwnProperty,bt=Y.push,jt=Z.toString,wt=ct.test(wt=v.bind)&&wt,xt=ct.test(xt=Array.isArray)&&xt,At=n.isFinite,Ot=n.isNaN,Et=ct.test(Et=Object.keys)&&Et,St=Math.max,Nt=Math.min,Rt=Math.random,$t="[object Arguments]",Ft="[object Array]",kt="[object Boolean]",qt="[object Date]",Dt="[object Number]",Tt="[object Object]",Bt="[object RegExp]",It="[object String]",Mt=!!n.attachEvent,zt=wt&&!/\n|true/.test(wt+Mt),Pt=wt&&!zt,Ct=Et&&(Mt||zt),Kt={"[object Function]":Q};
|
||||
Kt[$t]=Kt[Ft]=Kt[kt]=Kt[qt]=Kt[Dt]=Kt[Tt]=Kt[Bt]=Kt[It]=J;var Ut={};Ut[Ft]=Array,Ut[kt]=Boolean,Ut[qt]=Date,Ut[Tt]=Object,Ut[Dt]=Number,Ut[Bt]=RegExp,Ut[It]=String;var Vt={"boolean":Q,"function":J,object:J,number:Q,string:Q,undefined:Q},Gt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:pt,variable:"",imports:{_:e}};var Ht={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:arguments.length;if(c>2){if(typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(typeof a[c-1]=='function'){d=a[--c];}}while(++b<c){n=arguments[b];if(n&&r[typeof n]){",h:"u[j]=d?d(u[j],n[j]):n[j]",c:"}}"},Jt={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},Lt={l:"if(!r[typeof n])return u;"+Jt.l,b:Q},Qt=c(Jt),Wt=c(Jt,Lt,{m:Q}),Xt=c(Jt,Lt),Yt=xt||function(n){return n instanceof Array||jt.call(n)==Ft
|
||||
},Zt=Et?function(n){return w(n)?Et(n):[]}:y,nr={"&":"&","<":"<",">":">",'"':""","'":"'"},tr=_(nr),rr=c(Ht),er=c(Ht,{h:"if(u[j]==null)"+Ht.h});j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==jt.call(n)}),e.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},e.assign=rr,e.at=function(n){for(var t=-1,r=yt.apply(Y,v(arguments,1)),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u},e.bind=U,e.bindAll=function(n){for(var t=yt.apply(Y,arguments),r=1<t.length?0:(t=d(n),-1),e=t.length;++r<e;){var u=t[r];
|
||||
n[u]=U(n[u],n)}return n},e.bindKey=function(n,t){return f(n,t,v(arguments,2))},e.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},e.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},e.countBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",_t.call(e,r)?e[r]++:e[r]=1}),e},e.debounce=function(n,t,r){function e(){f=L,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;
|
||||
return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},e.defaults=er,e.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},e.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},e.difference=function(n){for(var t=-1,r=n?n.length:0,e=yt.apply(Y,arguments),e=u(e,r),o=[];++t<r;){var i=n[t];e(i)||o.push(i)}return o},e.filter=R,e.flatten=M,e.forEach=F,e.forIn=Wt,e.forOwn=Xt,e.functions=d,e.groupBy=function(n,t,r){var e={};
|
||||
return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(_t.call(e,r)?e[r]:e[r]=[]).push(n)}),e},e.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=L){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==L||r?1:t||e;return v(n,0,Nt(St(0,u-e),u))},e.intersection=function(n){var t=arguments,r=t.length,e={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=_t.call(e[0],p)?!(c=e[0][p]):c=e[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(e[s]||(e[s]=u(t[s],0,100)))(l))continue n;
|
||||
a.push(l)}}return a},e.invert=_,e.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},e.keys=Zt,e.map=k,e.max=q,e.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return _t.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},e.merge=O,e.min=function(n,t,r){var e=1/0,u=e;if(!t&&Yt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<u&&(u=f)
|
||||
}}else t=!t&&A(n)?o:a(t,r),Qt(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});return u},e.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},e.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=a(t,r);else var o=yt.apply(Y,arguments);return Wt(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},e.once=function(n){var t,r;return function(){return t?r:(t=J,r=n.apply(this,arguments),n=L,r)}},e.pairs=function(n){for(var t=-1,r=Zt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];
|
||||
u[t]=[o,n[o]]}return u},e.partial=function(n){return f(n,v(arguments,1))},e.partialRight=function(n){return f(n,v(arguments,1),L,tt)},e.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=yt.apply(Y,arguments),i=w(n)?o.length:0;++u<i;){var f=o[u];f in n&&(e[f]=n[f])}else t=a(t,r),Wt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},e.pluck=k,e.range=function(n,t,r){n=+n||0,r=+r||1,t==L&&(t=n,n=0);var e=-1;t=St(0,ht((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},e.reject=function(n,t,r){return t=a(t,r),R(n,function(n,r,e){return!t(n,r,e)
|
||||
})},e.rest=P,e.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=mt(Rt()*(++t+1));e[t]=e[r],e[r]=n}),e},e.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);for(t=a(t,r),F(n,function(n,r,u){o[++e]={a:t(n,r,u),b:e,c:n}}),u=o.length,o.sort(i);u--;)o[u]=o[u].c;return o},e.tap=function(n,t){return t(n),n},e.throttle=function(n,t){function r(){f=new Date,i=L,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);
|
||||
return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=L,f=a,u=n.apply(o,e)),u}},e.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},e.toArray=function(n){return n&&typeof n.length=="number"?v(n):E(n)},e.union=function(){return K(yt.apply(Y,arguments))},e.uniq=K,e.values=E,e.where=R,e.without=function(n){for(var t=-1,r=n?n.length:0,e=u(arguments,1),o=[];++t<r;){var i=n[t];e(i)||o.push(i)}return o},e.wrap=function(n,t){return function(){var r=[n];
|
||||
return bt.apply(r,arguments),t.apply(this,r)}},e.zip=function(n){for(var t=-1,r=n?q(k(arguments,"length")):0,e=Array(r);++t<r;)e[t]=k(arguments,t);return e},e.collect=k,e.drop=P,e.each=F,e.extend=rr,e.methods=d,e.select=R,e.tail=P,e.unique=K,G(e),e.clone=m,e.cloneDeep=function(n,t,r){return m(n,J,t,r)},e.contains=S,e.escape=function(n){return n==L?"":(n+"").replace(vt,p)},e.every=N,e.find=$,e.has=function(n,t){return n?_t.call(n,t):Q},e.identity=V,e.indexOf=z,e.isArguments=h,e.isArray=Yt,e.isBoolean=function(n){return n===J||n===Q||jt.call(n)==kt
|
||||
},e.isDate=function(n){return n instanceof Date||jt.call(n)==qt},e.isElement=function(n){return n?1===n.nodeType:Q},e.isEmpty=function(n){var t=J;if(!n)return t;var r=jt.call(n),e=n.length;return r==Ft||r==It||r==$t||r==Tt&&typeof e=="number"&&j(n.splice)?!e:(Xt(n,function(){return t=Q}),t)},e.isEqual=b,e.isFinite=function(n){return At(n)&&!Ot(parseFloat(n))},e.isFunction=j,e.isNaN=function(n){return x(n)&&n!=+n},e.isNull=function(n){return n===L},e.isNumber=x,e.isObject=w,e.isPlainObject=r,e.isRegExp=function(n){return n instanceof RegExp||jt.call(n)==Bt
|
||||
},e.isString=A,e.isUndefined=function(n){return typeof n=="undefined"},e.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?St(0,e+r):Nt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=G,e.noConflict=function(){return n._=et,this},e.random=function(n,t){return n==L&&t==L&&(t=1),n=+n||0,t==L&&(t=n,n=0),n+mt(Rt()*((+t||0)-n+1))},e.reduce=D,e.reduceRight=T,e.result=function(n,r){var e=n?n[r]:t;return j(e)?n[r]():e},e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Zt(n).length
|
||||
},e.some=B,e.sortedIndex=C,e.template=function(n,r,u){var o=e.templateSettings;n||(n=""),u=er({},u,o);var i,f=er({},u.imports,o.imports),o=Zt(f),f=E(f),a=0,c=u.interpolate||st,p="__p+='";n.replace(RegExp((u.escape||st).source+"|"+c.source+"|"+(c===pt?lt:st).source+"|"+(u.evaluate||st).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(gt,l),r&&(p+="'+__e("+r+")+'"),o&&(i=J,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",c=u=u.variable,c||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(ot,""):p).replace(it,"$1").replace(ft,"$1;"),p="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(c?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";
|
||||
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return r?s(r):(s.source=p,s)},e.unescape=function(n){return n==L?"":(n+"").replace(ut,g)},e.uniqueId=function(n){var t=++nt;return(n==L?"":n+"")+t},e.all=N,e.any=B,e.detect=$,e.foldl=D,e.foldr=T,e.include=S,e.inject=D,Xt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(){var t=[this.__wrapped__];return bt.apply(t,arguments),n.apply(e,t)})}),e.first=I,e.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=L){var o=u;
|
||||
for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==L||r)return n[u-1];return v(n,St(0,u-e))}},e.take=I,e.head=I,Xt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(t,r){var u=n(this.__wrapped__,t,r);return t==L||r&&typeof t!="function"?u:new e(u)})}),e.VERSION="1.0.0-rc.3",e.prototype.toString=function(){return this.__wrapped__+""},e.prototype.value=H,e.prototype.valueOf=H,Qt(["join","pop","shift"],function(n){var t=Y[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}
|
||||
}),Qt(["push","reverse","sort","unshift"],function(n){var t=Y[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Qt(["concat","slice","splice"],function(n){var t=Y[n];e.prototype[n]=function(){return new e(t.apply(this.__wrapped__,arguments))}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=e,define(function(){return e})):W?typeof module=="object"&&module&&module.exports==W?(module.exports=e)._=e:W._=e:n._=e})(this);
|
||||
Kt[$t]=Kt[Ft]=Kt[kt]=Kt[qt]=Kt[Dt]=Kt[Tt]=Kt[Bt]=Kt[It]=J;var Ut={};Ut[Ft]=Array,Ut[kt]=Boolean,Ut[qt]=Date,Ut[Tt]=Object,Ut[Dt]=Number,Ut[Bt]=RegExp,Ut[It]=String;var Vt={"boolean":Q,"function":J,object:J,number:Q,string:Q,undefined:Q},Gt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:pt,variable:"",imports:{_:e}};var Ht={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:a.length;while(++b<c){n=a[b];if(n&&r[typeof n]){",h:"if(typeof u[j]=='undefined')u[j]=n[j]",c:"}}"},Jt={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},Lt={l:"if(!r[typeof n])return u;"+Jt.l,b:Q},Qt=c(Jt),Wt=c(Jt,Lt,{m:Q}),Xt=c(Jt,Lt),Yt=xt||function(n){return n instanceof Array||jt.call(n)==Ft
|
||||
},Zt=Et?function(n){return w(n)?Et(n):[]}:y,nr={"&":"&","<":"<",">":">",'"':""","'":"'"},tr=_(nr),rr=c(Ht,{l:Ht.l.replace(";",";if(c>2){if(typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(typeof a[c-1]=='function'){d=a[--c];}}"),h:"u[j]=d?d(u[j],n[j]):n[j]"}),er=c(Ht);j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==jt.call(n)}),e.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},e.assign=rr,e.at=function(n){for(var t=-1,r=yt.apply(Y,v(arguments,1)),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];
|
||||
return u},e.bind=U,e.bindAll=function(n){for(var t=yt.apply(Y,arguments),r=1<t.length?0:(t=d(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=U(n[u],n)}return n},e.bindKey=function(n,t){return f(n,t,v(arguments,2))},e.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},e.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},e.countBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",_t.call(e,r)?e[r]++:e[r]=1
|
||||
}),e},e.debounce=function(n,t,r){function e(){f=L,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},e.defaults=er,e.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},e.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},e.difference=function(n){for(var t=-1,r=n?n.length:0,e=yt.apply(Y,arguments),e=u(e,r),o=[];++t<r;){var i=n[t];e(i)||o.push(i)
|
||||
}return o},e.filter=R,e.flatten=M,e.forEach=F,e.forIn=Wt,e.forOwn=Xt,e.functions=d,e.groupBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(_t.call(e,r)?e[r]:e[r]=[]).push(n)}),e},e.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=L){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==L||r?1:t||e;return v(n,0,Nt(St(0,u-e),u))},e.intersection=function(n){var t=arguments,r=t.length,e={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];
|
||||
if(f)var p=l+"",p=_t.call(e[0],p)?!(c=e[0][p]):c=e[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(e[s]||(e[s]=u(t[s],0,100)))(l))continue n;a.push(l)}}return a},e.invert=_,e.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},e.keys=Zt,e.map=k,e.max=q,e.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return _t.call(r,e)?r[e]:r[e]=n.apply(this,arguments)
|
||||
}},e.merge=O,e.min=function(n,t,r){var e=1/0,u=e;if(!t&&Yt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<u&&(u=f)}}else t=!t&&A(n)?o:a(t,r),Qt(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});return u},e.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},e.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=a(t,r);else var o=yt.apply(Y,arguments);return Wt(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},e.once=function(n){var t,r;
|
||||
return function(){return t?r:(t=J,r=n.apply(this,arguments),n=L,r)}},e.pairs=function(n){for(var t=-1,r=Zt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},e.partial=function(n){return f(n,v(arguments,1))},e.partialRight=function(n){return f(n,v(arguments,1),L,tt)},e.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=yt.apply(Y,arguments),i=w(n)?o.length:0;++u<i;){var f=o[u];f in n&&(e[f]=n[f])}else t=a(t,r),Wt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},e.pluck=k,e.range=function(n,t,r){n=+n||0,r=+r||1,t==L&&(t=n,n=0);
|
||||
var e=-1;t=St(0,ht((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},e.reject=function(n,t,r){return t=a(t,r),R(n,function(n,r,e){return!t(n,r,e)})},e.rest=P,e.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=mt(Rt()*(++t+1));e[t]=e[r],e[r]=n}),e},e.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);for(t=a(t,r),F(n,function(n,r,u){o[++e]={a:t(n,r,u),b:e,c:n}}),u=o.length,o.sort(i);u--;)o[u]=o[u].c;return o
|
||||
},e.tap=function(n,t){return t(n),n},e.throttle=function(n,t){function r(){f=new Date,i=L,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=L,f=a,u=n.apply(o,e)),u}},e.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},e.toArray=function(n){return n&&typeof n.length=="number"?v(n):E(n)},e.union=function(){return K(yt.apply(Y,arguments))},e.uniq=K,e.values=E,e.where=R,e.without=function(n){for(var t=-1,r=n?n.length:0,e=u(arguments,1),o=[];++t<r;){var i=n[t];
|
||||
e(i)||o.push(i)}return o},e.wrap=function(n,t){return function(){var r=[n];return bt.apply(r,arguments),t.apply(this,r)}},e.zip=function(n){for(var t=-1,r=n?q(k(arguments,"length")):0,e=Array(r);++t<r;)e[t]=k(arguments,t);return e},e.collect=k,e.drop=P,e.each=F,e.extend=rr,e.methods=d,e.select=R,e.tail=P,e.unique=K,G(e),e.clone=m,e.cloneDeep=function(n,t,r){return m(n,J,t,r)},e.contains=S,e.escape=function(n){return n==L?"":(n+"").replace(vt,p)},e.every=N,e.find=$,e.has=function(n,t){return n?_t.call(n,t):Q
|
||||
},e.identity=V,e.indexOf=z,e.isArguments=h,e.isArray=Yt,e.isBoolean=function(n){return n===J||n===Q||jt.call(n)==kt},e.isDate=function(n){return n instanceof Date||jt.call(n)==qt},e.isElement=function(n){return n?1===n.nodeType:Q},e.isEmpty=function(n){var t=J;if(!n)return t;var r=jt.call(n),e=n.length;return r==Ft||r==It||r==$t||r==Tt&&typeof e=="number"&&j(n.splice)?!e:(Xt(n,function(){return t=Q}),t)},e.isEqual=b,e.isFinite=function(n){return At(n)&&!Ot(parseFloat(n))},e.isFunction=j,e.isNaN=function(n){return x(n)&&n!=+n
|
||||
},e.isNull=function(n){return n===L},e.isNumber=x,e.isObject=w,e.isPlainObject=r,e.isRegExp=function(n){return n instanceof RegExp||jt.call(n)==Bt},e.isString=A,e.isUndefined=function(n){return typeof n=="undefined"},e.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?St(0,e+r):Nt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=G,e.noConflict=function(){return n._=et,this},e.random=function(n,t){return n==L&&t==L&&(t=1),n=+n||0,t==L&&(t=n,n=0),n+mt(Rt()*((+t||0)-n+1))
|
||||
},e.reduce=D,e.reduceRight=T,e.result=function(n,r){var e=n?n[r]:t;return j(e)?n[r]():e},e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Zt(n).length},e.some=B,e.sortedIndex=C,e.template=function(n,r,u){var o=e.templateSettings;n||(n=""),u=er({},u,o);var i,f=er({},u.imports,o.imports),o=Zt(f),f=E(f),a=0,c=u.interpolate||st,p="__p+='";n.replace(RegExp((u.escape||st).source+"|"+c.source+"|"+(c===pt?lt:st).source+"|"+(u.evaluate||st).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(gt,l),r&&(p+="'+__e("+r+")+'"),o&&(i=J,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t
|
||||
}),p+="';\n",c=u=u.variable,c||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(ot,""):p).replace(it,"$1").replace(ft,"$1;"),p="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(c?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return r?s(r):(s.source=p,s)},e.unescape=function(n){return n==L?"":(n+"").replace(ut,g)},e.uniqueId=function(n){var t=++nt;
|
||||
return(n==L?"":n+"")+t},e.all=N,e.any=B,e.detect=$,e.foldl=D,e.foldr=T,e.include=S,e.inject=D,Xt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(){var t=[this.__wrapped__];return bt.apply(t,arguments),n.apply(e,t)})}),e.first=I,e.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=L){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==L||r)return n[u-1];return v(n,St(0,u-e))}},e.take=I,e.head=I,Xt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(t,r){var u=n(this.__wrapped__,t,r);
|
||||
return t==L||r&&typeof t!="function"?u:new e(u)})}),e.VERSION="1.0.0-rc.3",e.prototype.toString=function(){return this.__wrapped__+""},e.prototype.value=H,e.prototype.valueOf=H,Qt(["join","pop","shift"],function(n){var t=Y[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Qt(["push","reverse","sort","unshift"],function(n){var t=Y[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Qt(["concat","slice","splice"],function(n){var t=Y[n];e.prototype[n]=function(){return new e(t.apply(this.__wrapped__,arguments))
|
||||
}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=e,define(function(){return e})):W?typeof module=="object"&&module&&module.exports==W?(module.exports=e)._=e:W._=e:n._=e})(this);
|
||||
42
dist/lodash.underscore.js
vendored
42
dist/lodash.underscore.js
vendored
@@ -238,43 +238,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/** Reusable iterator options for `assign` and `defaults` */
|
||||
var assignIteratorOptions = {
|
||||
'args': 'object, source, guard',
|
||||
'top':
|
||||
'var args = arguments,\n' +
|
||||
' argsIndex = 0,\n' +
|
||||
" argsLength = typeof guard == 'number' ? 2 : arguments.length;\n" +
|
||||
'if (argsLength > 2) {\n' +
|
||||
" if (typeof args[argsLength - 2] == 'function') {\n" +
|
||||
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
|
||||
" } else if (typeof args[argsLength - 1] == 'function') {\n" +
|
||||
' callback = args[--argsLength];\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
'while (++argsIndex < argsLength) {\n' +
|
||||
' iterable = arguments[argsIndex];\n' +
|
||||
' if (iterable && objectTypes[typeof iterable]) {',
|
||||
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]',
|
||||
'bottom': ' }\n}'
|
||||
};
|
||||
|
||||
/** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */
|
||||
var eachIteratorOptions = {
|
||||
'args': 'collection, callback, thisArg',
|
||||
'top': "callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg)",
|
||||
'arrays': "typeof length == 'number'",
|
||||
'loop': 'if (callback(iterable[index], index, collection) === false) return result'
|
||||
};
|
||||
|
||||
/** Reusable iterator options for `forIn` and `forOwn` */
|
||||
var forOwnIteratorOptions = {
|
||||
'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top,
|
||||
'arrays': false
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Used by `_.max` and `_.min` as the default `callback` when a given
|
||||
* `collection` is a string value.
|
||||
@@ -854,9 +817,8 @@
|
||||
|
||||
/**
|
||||
* Assigns own enumerable properties of source object(s) to the destination
|
||||
* object for all destination properties that resolve to `null`/`undefined`.
|
||||
* Once a property is set, additional defaults of the same property will be
|
||||
* ignored.
|
||||
* object for all destination properties that resolve to `undefined`. Once a
|
||||
* property is set, additional defaults of the same property will be ignored.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
200
doc/README.md
200
doc/README.md
@@ -197,7 +197,7 @@
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_compactarray"></a>`_.compact(array)`
|
||||
<a href="#_compactarray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3153 "View in source") [Ⓣ][1]
|
||||
<a href="#_compactarray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3156 "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.
|
||||
|
||||
@@ -221,7 +221,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#L3183 "View in source") [Ⓣ][1]
|
||||
<a href="#_differencearray--array1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3186 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of `array` elements not present in the other arrays using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -246,7 +246,7 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
|
||||
<!-- 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#L3254 "View in source") [Ⓣ][1]
|
||||
<a href="#_firstarray--callbackn-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3257 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the first element of the `array`. If a number `n` is passed, the first `n` elements of the `array` are returned. If a `callback` function is passed, the first elements the `callback` returns truthy for are returned. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -306,7 +306,7 @@ _.first(food, { 'type': 'fruit' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_flattenarray-shallow"></a>`_.flatten(array, shallow)`
|
||||
<a href="#_flattenarray-shallow">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3293 "View in source") [Ⓣ][1]
|
||||
<a href="#_flattenarray-shallow">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3296 "View in source") [Ⓣ][1]
|
||||
|
||||
Flattens a nested array *(the nesting can be to any depth)*. If `shallow` is truthy, `array` will only be flattened a single level.
|
||||
|
||||
@@ -334,7 +334,7 @@ _.flatten([1, [2], [3, [[4]]]], true);
|
||||
<!-- 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#L3335 "View in source") [Ⓣ][1]
|
||||
<a href="#_indexofarray-value--fromindex0">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3338 "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.
|
||||
|
||||
@@ -366,7 +366,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#L3408 "View in source") [Ⓣ][1]
|
||||
<a href="#_initialarray--callbackn1-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3411 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets all but the last element of `array`. If a number `n` is passed, the last `n` elements are excluded from the result. If a `callback` function is passed, the last elements the `callback` returns truthy for are excluded from the result. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -423,7 +423,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#L3442 "View in source") [Ⓣ][1]
|
||||
<a href="#_intersectionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3445 "View in source") [Ⓣ][1]
|
||||
|
||||
Computes the intersection of all the passed-in arrays using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -447,7 +447,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#L3532 "View in source") [Ⓣ][1]
|
||||
<a href="#_lastarray--callbackn-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3535 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the last element of the `array`. If a number `n` is passed, the last `n` elements of the `array` are returned. If a `callback` function is passed, the last elements the `callback` returns truthy for are returned. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -504,7 +504,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#L3573 "View in source") [Ⓣ][1]
|
||||
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3576 "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.
|
||||
|
||||
@@ -533,7 +533,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_objectkeys--values"></a>`_.object(keys [, values=[]])`
|
||||
<a href="#_objectkeys--values">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3603 "View in source") [Ⓣ][1]
|
||||
<a href="#_objectkeys--values">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3606 "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`.
|
||||
|
||||
@@ -558,7 +558,7 @@ _.object(['moe', 'larry'], [30, 40]);
|
||||
<!-- 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#L3647 "View in source") [Ⓣ][1]
|
||||
<a href="#_rangestart0-end--step1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3650 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`.
|
||||
|
||||
@@ -596,7 +596,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#L3724 "View in source") [Ⓣ][1]
|
||||
<a href="#_restarray--callbackn1-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3727 "View in source") [Ⓣ][1]
|
||||
|
||||
The opposite of `_.initial`, this method gets all but the first value of `array`. If a number `n` is passed, the first `n` values are excluded from the result. If a `callback` function is passed, the first elements the `callback` returns truthy for are excluded from the result. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -656,7 +656,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#L3788 "View in source") [Ⓣ][1]
|
||||
<a href="#_sortedindexarray-value--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3791 "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 passed, 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)*.
|
||||
|
||||
@@ -705,7 +705,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#L3820 "View in source") [Ⓣ][1]
|
||||
<a href="#_unionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3823 "View in source") [Ⓣ][1]
|
||||
|
||||
Computes the union of the passed-in arrays using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -729,7 +729,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#L3867 "View in source") [Ⓣ][1]
|
||||
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3870 "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 passed, each element of `array` is passed through a callback` before uniqueness is computed. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||
|
||||
@@ -776,7 +776,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#L3926 "View in source") [Ⓣ][1]
|
||||
<a href="#_withoutarray--value1-value2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3929 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -801,7 +801,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#L3957 "View in source") [Ⓣ][1]
|
||||
<a href="#_ziparray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3960 "View in source") [Ⓣ][1]
|
||||
|
||||
Groups the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion.
|
||||
|
||||
@@ -861,7 +861,7 @@ The wrapper functions `first` and `last` return wrapped values when `n` is passe
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
|
||||
<a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4853 "View in source") [Ⓣ][1]
|
||||
<a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4856 "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.
|
||||
|
||||
@@ -891,7 +891,7 @@ _([1, 2, 3, 4])
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_prototypetostring"></a>`_.prototype.toString()`
|
||||
<a href="#_prototypetostring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4870 "View in source") [Ⓣ][1]
|
||||
<a href="#_prototypetostring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4873 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces the `toString` result of the wrapped value.
|
||||
|
||||
@@ -912,7 +912,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#L4887 "View in source") [Ⓣ][1]
|
||||
<a href="#_prototypevalueof">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4890 "View in source") [Ⓣ][1]
|
||||
|
||||
Extracts the wrapped value.
|
||||
|
||||
@@ -943,7 +943,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#L2154 "View in source") [Ⓣ][1]
|
||||
<a href="#_atcollection--index1-index2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2157 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of elements from the specified index(es), or keys, of the `collection`. Indexes may be specified as individual arguments or as arrays of indexes.
|
||||
|
||||
@@ -971,7 +971,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#L2196 "View in source") [Ⓣ][1]
|
||||
<a href="#_containscollection-target--fromindex0">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2199 "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.
|
||||
|
||||
@@ -1009,7 +1009,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#L2250 "View in source") [Ⓣ][1]
|
||||
<a href="#_countbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2253 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an object composed of keys returned from 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)*.
|
||||
|
||||
@@ -1045,7 +1045,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#L2302 "View in source") [Ⓣ][1]
|
||||
<a href="#_everycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2305 "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)*.
|
||||
|
||||
@@ -1091,7 +1091,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#L2363 "View in source") [Ⓣ][1]
|
||||
<a href="#_filtercollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2366 "View in source") [Ⓣ][1]
|
||||
|
||||
Examines each element in 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)*.
|
||||
|
||||
@@ -1137,7 +1137,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#L2430 "View in source") [Ⓣ][1]
|
||||
<a href="#_findcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2433 "View in source") [Ⓣ][1]
|
||||
|
||||
Examines each element in 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)*.
|
||||
|
||||
@@ -1185,7 +1185,7 @@ var healthy = _.find(food, 'organic');
|
||||
<!-- 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#L2465 "View in source") [Ⓣ][1]
|
||||
<a href="#_foreachcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2468 "View in source") [Ⓣ][1]
|
||||
|
||||
Iterates over a `collection`, executing the `callback` for each element in the `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`.
|
||||
|
||||
@@ -1217,7 +1217,7 @@ _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert);
|
||||
<!-- 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#L2515 "View in source") [Ⓣ][1]
|
||||
<a href="#_groupbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2518 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an object composed of keys returned from running each element of the `collection` through the `callback`. The corresponding value of each key is an array of elements passed to `callback` that returned the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||
|
||||
@@ -1254,7 +1254,7 @@ _.groupBy(['one', 'two', 'three'], 'length');
|
||||
<!-- 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#L2548 "View in source") [Ⓣ][1]
|
||||
<a href="#_invokecollection-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2551 "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 passed to each invoked method. If `methodName` is a function, it will be invoked for, and `this` bound to, each element in the `collection`.
|
||||
|
||||
@@ -1283,7 +1283,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#L2600 "View in source") [Ⓣ][1]
|
||||
<a href="#_mapcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2603 "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)*.
|
||||
|
||||
@@ -1328,7 +1328,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#L2657 "View in source") [Ⓣ][1]
|
||||
<a href="#_maxcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2660 "View in source") [Ⓣ][1]
|
||||
|
||||
Retrieves the maximum value of an `array`. If `callback` is passed, 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)*.
|
||||
|
||||
@@ -1370,7 +1370,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#L2726 "View in source") [Ⓣ][1]
|
||||
<a href="#_mincollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2729 "View in source") [Ⓣ][1]
|
||||
|
||||
Retrieves the minimum value of an `array`. If `callback` is passed, 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)*.
|
||||
|
||||
@@ -1412,7 +1412,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#L2776 "View in source") [Ⓣ][1]
|
||||
<a href="#_pluckcollection-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2779 "View in source") [Ⓣ][1]
|
||||
|
||||
Retrieves the value of a specified property from all elements in the `collection`.
|
||||
|
||||
@@ -1442,7 +1442,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#L2808 "View in source") [Ⓣ][1]
|
||||
<a href="#_reducecollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2811 "View in source") [Ⓣ][1]
|
||||
|
||||
Reduces a `collection` to a value that 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 passed, 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)*.
|
||||
|
||||
@@ -1480,7 +1480,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#L2851 "View in source") [Ⓣ][1]
|
||||
<a href="#_reducerightcollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2854 "View in source") [Ⓣ][1]
|
||||
|
||||
This method is similar to `_.reduce`, except that it iterates over a `collection` from right to left.
|
||||
|
||||
@@ -1511,7 +1511,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#L2911 "View in source") [Ⓣ][1]
|
||||
<a href="#_rejectcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2914 "View in source") [Ⓣ][1]
|
||||
|
||||
The opposite of `_.filter`, this method returns the elements of a `collection` that `callback` does **not** return truthy for.
|
||||
|
||||
@@ -1554,7 +1554,7 @@ _.reject(food, { 'type': 'fruit' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_shufflecollection"></a>`_.shuffle(collection)`
|
||||
<a href="#_shufflecollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2932 "View in source") [Ⓣ][1]
|
||||
<a href="#_shufflecollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2935 "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.
|
||||
|
||||
@@ -1578,7 +1578,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#L2965 "View in source") [Ⓣ][1]
|
||||
<a href="#_sizecollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2968 "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.
|
||||
|
||||
@@ -1608,7 +1608,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#L3012 "View in source") [Ⓣ][1]
|
||||
<a href="#_somecollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3015 "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)*.
|
||||
|
||||
@@ -1654,7 +1654,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#L3068 "View in source") [Ⓣ][1]
|
||||
<a href="#_sortbycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3071 "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)*.
|
||||
|
||||
@@ -1691,7 +1691,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#L3103 "View in source") [Ⓣ][1]
|
||||
<a href="#_toarraycollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3106 "View in source") [Ⓣ][1]
|
||||
|
||||
Converts the `collection` to an array.
|
||||
|
||||
@@ -1715,7 +1715,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#L3135 "View in source") [Ⓣ][1]
|
||||
<a href="#_wherecollection-properties">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3138 "View in source") [Ⓣ][1]
|
||||
|
||||
Examines each element in a `collection`, returning an array of all elements that have the given `properties`. When checking `properties`, this method performs a deep comparison between values to determine if they are equivalent to each other.
|
||||
|
||||
@@ -1752,7 +1752,7 @@ _.where(stooges, { 'age': 40 });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_aftern-func"></a>`_.after(n, func)`
|
||||
<a href="#_aftern-func">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3990 "View in source") [Ⓣ][1]
|
||||
<a href="#_aftern-func">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3993 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that is restricted to executing `func` only after it is called `n` times. The `func` is executed with the `this` binding of the created function.
|
||||
|
||||
@@ -1780,7 +1780,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#L4023 "View in source") [Ⓣ][1]
|
||||
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4026 "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 passed to the bound function.
|
||||
|
||||
@@ -1811,7 +1811,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#L4054 "View in source") [Ⓣ][1]
|
||||
<a href="#_bindallobject--methodname1-methodname2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4057 "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.
|
||||
|
||||
@@ -1842,7 +1842,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#L4100 "View in source") [Ⓣ][1]
|
||||
<a href="#_bindkeyobject-key--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4103 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those passed 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.
|
||||
|
||||
@@ -1883,7 +1883,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#L4123 "View in source") [Ⓣ][1]
|
||||
<a href="#_composefunc1-func2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4126 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that is the composition of the passed 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.
|
||||
|
||||
@@ -1910,7 +1910,7 @@ welcome('moe');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_debouncefunc-wait-immediate"></a>`_.debounce(func, wait, immediate)`
|
||||
<a href="#_debouncefunc-wait-immediate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4156 "View in source") [Ⓣ][1]
|
||||
<a href="#_debouncefunc-wait-immediate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4159 "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 `true` for `immediate` to cause debounce to invoke `func` on the leading, instead of the trailing, edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call.
|
||||
|
||||
@@ -1936,7 +1936,7 @@ jQuery(window).on('resize', lazyLayout);
|
||||
<!-- 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#L4220 "View in source") [Ⓣ][1]
|
||||
<a href="#_deferfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4223 "View in source") [Ⓣ][1]
|
||||
|
||||
Defers executing the `func` function until the current call stack has cleared. Additional arguments will be passed to `func` when it is invoked.
|
||||
|
||||
@@ -1961,7 +1961,7 @@ _.defer(function() { alert('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#L4200 "View in source") [Ⓣ][1]
|
||||
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4203 "View in source") [Ⓣ][1]
|
||||
|
||||
Executes the `func` function after `wait` milliseconds. Additional arguments will be passed to `func` when it is invoked.
|
||||
|
||||
@@ -1988,7 +1988,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#L4244 "View in source") [Ⓣ][1]
|
||||
<a href="#_memoizefunc--resolver">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4247 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function.
|
||||
|
||||
@@ -2014,7 +2014,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#L4271 "View in source") [Ⓣ][1]
|
||||
<a href="#_oncefunc">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4274 "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.
|
||||
|
||||
@@ -2040,7 +2040,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#L4306 "View in source") [Ⓣ][1]
|
||||
<a href="#_partialfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4309 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `_.bind`, except it does **not** alter the `this` binding.
|
||||
|
||||
@@ -2067,7 +2067,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#L4337 "View in source") [Ⓣ][1]
|
||||
<a href="#_partialrightfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4340 "View in source") [Ⓣ][1]
|
||||
|
||||
This method is similar to `_.partial`, except that `partial` arguments are appended to those passed to the new function.
|
||||
|
||||
@@ -2104,7 +2104,7 @@ options.imports
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_throttlefunc-wait"></a>`_.throttle(func, wait)`
|
||||
<a href="#_throttlefunc-wait">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4359 "View in source") [Ⓣ][1]
|
||||
<a href="#_throttlefunc-wait">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4362 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. If the throttled function is invoked more than once during the `wait` timeout, `func` will also be called on the trailing edge of the timeout. Subsequent calls to the throttled function will return the result of the last `func` call.
|
||||
|
||||
@@ -2129,7 +2129,7 @@ jQuery(window).on('scroll', throttled);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_wrapvalue-wrapper"></a>`_.wrap(value, wrapper)`
|
||||
<a href="#_wrapvalue-wrapper">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4412 "View in source") [Ⓣ][1]
|
||||
<a href="#_wrapvalue-wrapper">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4415 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments passed to the function are appended to those passed to the `wrapper` function. The `wrapper` is executed with the `this` binding of the created function.
|
||||
|
||||
@@ -2165,7 +2165,7 @@ hello();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_assignobject--source1-source2--callback-thisarg"></a>`_.assign(object [, source1, source2, ..., callback, thisArg])`
|
||||
<a href="#_assignobject--source1-source2--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1066 "View in source") [Ⓣ][1]
|
||||
<a href="#_assignobject--source1-source2--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1059 "View in source") [Ⓣ][1]
|
||||
|
||||
Assigns own enumerable properties of source object(s) to the destination object. Subsequent sources will overwrite propery assignments of previous sources. If a `callback` function is passed, it will be executed to produce the assigned values. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*.
|
||||
|
||||
@@ -2203,7 +2203,7 @@ defaults(food, { 'name': 'banana', 'type': 'fruit' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_clonevalue--deepfalse-callback-thisarg"></a>`_.clone(value [, deep=false, callback, thisArg])`
|
||||
<a href="#_clonevalue--deepfalse-callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1110 "View in source") [Ⓣ][1]
|
||||
<a href="#_clonevalue--deepfalse-callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1116 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a clone of `value`. If `deep` is `true`, nested objects will also be cloned, otherwise they will be assigned by reference. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns `undefined`, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*.
|
||||
|
||||
@@ -2250,7 +2250,7 @@ clone.childNodes.length;
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_clonedeepvalue--callback-thisarg"></a>`_.cloneDeep(value [, callback, thisArg])`
|
||||
<a href="#_clonedeepvalue--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1235 "View in source") [Ⓣ][1]
|
||||
<a href="#_clonedeepvalue--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1241 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a deep clone of `value`. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns the value it was passed, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*.
|
||||
|
||||
@@ -2296,9 +2296,9 @@ clone.node == view.node;
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_defaultsobject--source1-source2-"></a>`_.defaults(object [, source1, source2, ...])`
|
||||
<a href="#_defaultsobject--source1-source2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1260 "View in source") [Ⓣ][1]
|
||||
<a href="#_defaultsobject--source1-source2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1265 "View in source") [Ⓣ][1]
|
||||
|
||||
Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to `null`/`undefined`. Once a property is set, additional defaults of the same property will be ignored.
|
||||
Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to `undefined`. Once a property is set, additional defaults of the same property will be ignored.
|
||||
|
||||
#### Arguments
|
||||
1. `object` *(Object)*: The destination object.
|
||||
@@ -2322,7 +2322,7 @@ _.defaults(food, { 'name': 'banana', 'type': 'fruit' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_forinobject--callbackidentity-thisarg"></a>`_.forIn(object [, callback=identity, thisArg])`
|
||||
<a href="#_forinobject--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L886 "View in source") [Ⓣ][1]
|
||||
<a href="#_forinobject--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L879 "View in source") [Ⓣ][1]
|
||||
|
||||
Iterates over `object`'s own and inherited enumerable properties, 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`.
|
||||
|
||||
@@ -2358,7 +2358,7 @@ _.forIn(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#L911 "View in source") [Ⓣ][1]
|
||||
<a href="#_forownobject--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L904 "View in source") [Ⓣ][1]
|
||||
|
||||
Iterates over an object's own enumerable properties, 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`.
|
||||
|
||||
@@ -2386,7 +2386,7 @@ _.forOwn({ '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#L1279 "View in source") [Ⓣ][1]
|
||||
<a href="#_functionsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1282 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values.
|
||||
|
||||
@@ -2413,7 +2413,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#L1304 "View in source") [Ⓣ][1]
|
||||
<a href="#_hasobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1307 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if the specified object `property` exists and is a direct property, instead of an inherited property.
|
||||
|
||||
@@ -2438,7 +2438,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#L1321 "View in source") [Ⓣ][1]
|
||||
<a href="#_invertobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1324 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an object composed of the inverted keys and values of the given `object`.
|
||||
|
||||
@@ -2462,7 +2462,7 @@ _.invert({ 'first': 'moe', 'second': 'larry' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
|
||||
<a href="#_isargumentsvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L847 "View in source") [Ⓣ][1]
|
||||
<a href="#_isargumentsvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L840 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is an `arguments` object.
|
||||
|
||||
@@ -2489,7 +2489,7 @@ _.isArguments([1, 2, 3]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isarrayvalue"></a>`_.isArray(value)`
|
||||
<a href="#_isarrayvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L929 "View in source") [Ⓣ][1]
|
||||
<a href="#_isarrayvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L922 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is an array.
|
||||
|
||||
@@ -2516,7 +2516,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#L1347 "View in source") [Ⓣ][1]
|
||||
<a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1350 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a boolean value.
|
||||
|
||||
@@ -2540,7 +2540,7 @@ _.isBoolean(null);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isdatevalue"></a>`_.isDate(value)`
|
||||
<a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1364 "View in source") [Ⓣ][1]
|
||||
<a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1367 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a date.
|
||||
|
||||
@@ -2564,7 +2564,7 @@ _.isDate(new Date);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_iselementvalue"></a>`_.isElement(value)`
|
||||
<a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1381 "View in source") [Ⓣ][1]
|
||||
<a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1384 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a DOM element.
|
||||
|
||||
@@ -2588,7 +2588,7 @@ _.isElement(document.body);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
|
||||
<a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1406 "View in source") [Ⓣ][1]
|
||||
<a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1409 "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".
|
||||
|
||||
@@ -2618,7 +2618,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#L1465 "View in source") [Ⓣ][1]
|
||||
<a href="#_isequala-b--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1468 "View in source") [Ⓣ][1]
|
||||
|
||||
Performs a deep comparison between two values to determine if they are equivalent to each other. If `callback` is passed, 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)*.
|
||||
|
||||
@@ -2663,7 +2663,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#L1635 "View in source") [Ⓣ][1]
|
||||
<a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1638 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is, or can be coerced to, a finite number.
|
||||
|
||||
@@ -2701,7 +2701,7 @@ _.isFinite(Infinity);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
|
||||
<a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1652 "View in source") [Ⓣ][1]
|
||||
<a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1655 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a function.
|
||||
|
||||
@@ -2725,7 +2725,7 @@ _.isFunction(_);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isnanvalue"></a>`_.isNaN(value)`
|
||||
<a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1715 "View in source") [Ⓣ][1]
|
||||
<a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1718 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is `NaN`.
|
||||
|
||||
@@ -2760,7 +2760,7 @@ _.isNaN(undefined);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isnullvalue"></a>`_.isNull(value)`
|
||||
<a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1737 "View in source") [Ⓣ][1]
|
||||
<a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1740 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is `null`.
|
||||
|
||||
@@ -2787,7 +2787,7 @@ _.isNull(undefined);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isnumbervalue"></a>`_.isNumber(value)`
|
||||
<a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1754 "View in source") [Ⓣ][1]
|
||||
<a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1757 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a number.
|
||||
|
||||
@@ -2811,7 +2811,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#L1682 "View in source") [Ⓣ][1]
|
||||
<a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1685 "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('')`)*
|
||||
|
||||
@@ -2841,7 +2841,7 @@ _.isObject(1);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
|
||||
<a href="#_isplainobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1782 "View in source") [Ⓣ][1]
|
||||
<a href="#_isplainobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1785 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a given `value` is an object created by the `Object` constructor.
|
||||
|
||||
@@ -2876,7 +2876,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#L1807 "View in source") [Ⓣ][1]
|
||||
<a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1810 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a regular expression.
|
||||
|
||||
@@ -2900,7 +2900,7 @@ _.isRegExp(/moe/);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isstringvalue"></a>`_.isString(value)`
|
||||
<a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1824 "View in source") [Ⓣ][1]
|
||||
<a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1827 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is a string.
|
||||
|
||||
@@ -2924,7 +2924,7 @@ _.isString('moe');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
|
||||
<a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1841 "View in source") [Ⓣ][1]
|
||||
<a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1844 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if `value` is `undefined`.
|
||||
|
||||
@@ -2948,7 +2948,7 @@ _.isUndefined(void 0);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_keysobject"></a>`_.keys(object)`
|
||||
<a href="#_keysobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L948 "View in source") [Ⓣ][1]
|
||||
<a href="#_keysobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L941 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array composed of the own enumerable property names of `object`.
|
||||
|
||||
@@ -2972,7 +2972,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#L1901 "View in source") [Ⓣ][1]
|
||||
<a href="#_mergeobject--source1-source2--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1904 "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 propery assignments of previous sources. If a `callback` function is passed, 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)*.
|
||||
|
||||
@@ -3028,7 +3028,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#L2010 "View in source") [Ⓣ][1]
|
||||
<a href="#_omitobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2013 "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 passed, 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)*.
|
||||
|
||||
@@ -3059,7 +3059,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#L2044 "View in source") [Ⓣ][1]
|
||||
<a href="#_pairsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2047 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`.
|
||||
|
||||
@@ -3083,7 +3083,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#L2082 "View in source") [Ⓣ][1]
|
||||
<a href="#_pickobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2085 "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 passed, 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)*.
|
||||
|
||||
@@ -3114,7 +3114,7 @@ _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_valuesobject"></a>`_.values(object)`
|
||||
<a href="#_valuesobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2119 "View in source") [Ⓣ][1]
|
||||
<a href="#_valuesobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2122 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array composed of the own enumerable property values of `object`.
|
||||
|
||||
@@ -3145,7 +3145,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#L4436 "View in source") [Ⓣ][1]
|
||||
<a href="#_escapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4439 "View in source") [Ⓣ][1]
|
||||
|
||||
Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities.
|
||||
|
||||
@@ -3169,7 +3169,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#L4454 "View in source") [Ⓣ][1]
|
||||
<a href="#_identityvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4457 "View in source") [Ⓣ][1]
|
||||
|
||||
This function returns the first argument passed to it.
|
||||
|
||||
@@ -3194,7 +3194,7 @@ moe === _.identity(moe);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_mixinobject"></a>`_.mixin(object)`
|
||||
<a href="#_mixinobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4480 "View in source") [Ⓣ][1]
|
||||
<a href="#_mixinobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4483 "View in source") [Ⓣ][1]
|
||||
|
||||
Adds functions properties of `object` to the `lodash` function and chainable wrapper.
|
||||
|
||||
@@ -3224,7 +3224,7 @@ _('moe').capitalize();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_noconflict"></a>`_.noConflict()`
|
||||
<a href="#_noconflict">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4504 "View in source") [Ⓣ][1]
|
||||
<a href="#_noconflict">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4507 "View in source") [Ⓣ][1]
|
||||
|
||||
Reverts the '_' variable to its previous value and returns a reference to the `lodash` function.
|
||||
|
||||
@@ -3244,7 +3244,7 @@ var lodash = _.noConflict();
|
||||
<!-- 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#L4527 "View in source") [Ⓣ][1]
|
||||
<a href="#_randommin0-max1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4530 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a random number between `min` and `max` *(inclusive)*. If only one argument is passed, a number between `0` and the given number will be returned.
|
||||
|
||||
@@ -3272,7 +3272,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#L4565 "View in source") [Ⓣ][1]
|
||||
<a href="#_resultobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4568 "View in source") [Ⓣ][1]
|
||||
|
||||
Resolves the value of `property` on `object`. If `property` is a function, it will be invoked and its result returned, else the property value is returned. If `object` is falsey, then `null` is returned.
|
||||
|
||||
@@ -3307,7 +3307,7 @@ _.result(object, 'stuff');
|
||||
<!-- 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#L4653 "View in source") [Ⓣ][1]
|
||||
<a href="#_templatetext-data-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4656 "View in source") [Ⓣ][1]
|
||||
|
||||
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code.
|
||||
|
||||
@@ -3391,7 +3391,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#L4779 "View in source") [Ⓣ][1]
|
||||
<a href="#_timesn-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4782 "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)*.
|
||||
|
||||
@@ -3423,7 +3423,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#L4805 "View in source") [Ⓣ][1]
|
||||
<a href="#_unescapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4808 "View in source") [Ⓣ][1]
|
||||
|
||||
The opposite of `_.escape`, this method converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters.
|
||||
|
||||
@@ -3447,7 +3447,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#L4825 "View in source") [Ⓣ][1]
|
||||
<a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4828 "View in source") [Ⓣ][1]
|
||||
|
||||
Generates a unique ID. If `prefix` is passed, the ID will be appended to it.
|
||||
|
||||
@@ -3500,7 +3500,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#L5055 "View in source") [Ⓣ][1]
|
||||
<a href="#_version">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5058 "View in source") [Ⓣ][1]
|
||||
|
||||
*(String)*: The semantic version number.
|
||||
|
||||
|
||||
39
lodash.js
39
lodash.js
@@ -445,23 +445,16 @@
|
||||
);
|
||||
|
||||
/** Reusable iterator options for `assign` and `defaults` */
|
||||
var assignIteratorOptions = {
|
||||
var defaultsIteratorOptions = {
|
||||
'args': 'object, source, guard',
|
||||
'top':
|
||||
'var args = arguments,\n' +
|
||||
' argsIndex = 0,\n' +
|
||||
" argsLength = typeof guard == 'number' ? 2 : arguments.length;\n" +
|
||||
'if (argsLength > 2) {\n' +
|
||||
" if (typeof args[argsLength - 2] == 'function') {\n" +
|
||||
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
|
||||
" } else if (typeof args[argsLength - 1] == 'function') {\n" +
|
||||
' callback = args[--argsLength];\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
" argsLength = typeof guard == 'number' ? 2 : args.length;\n" +
|
||||
'while (++argsIndex < argsLength) {\n' +
|
||||
' iterable = arguments[argsIndex];\n' +
|
||||
' iterable = args[argsIndex];\n' +
|
||||
' if (iterable && objectTypes[typeof iterable]) {',
|
||||
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]',
|
||||
'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]",
|
||||
'bottom': ' }\n}'
|
||||
};
|
||||
|
||||
@@ -1063,7 +1056,20 @@
|
||||
* defaults(food, { 'name': 'banana', 'type': 'fruit' });
|
||||
* // => { 'name': 'apple', 'type': 'fruit' }
|
||||
*/
|
||||
var assign = createIterator(assignIteratorOptions);
|
||||
var assign = createIterator(defaultsIteratorOptions, {
|
||||
'top':
|
||||
defaultsIteratorOptions.top.replace(';',
|
||||
';\n' +
|
||||
'if (argsLength > 2) {\n' +
|
||||
" if (typeof args[argsLength - 2] == 'function') {\n" +
|
||||
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
|
||||
" } else if (typeof args[argsLength - 1] == 'function') {\n" +
|
||||
' callback = args[--argsLength];\n' +
|
||||
' }\n' +
|
||||
'}'
|
||||
),
|
||||
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]'
|
||||
});
|
||||
|
||||
/**
|
||||
* Creates a clone of `value`. If `deep` is `true`, nested objects will also
|
||||
@@ -1238,9 +1244,8 @@
|
||||
|
||||
/**
|
||||
* Assigns own enumerable properties of source object(s) to the destination
|
||||
* object for all destination properties that resolve to `null`/`undefined`.
|
||||
* Once a property is set, additional defaults of the same property will be
|
||||
* ignored.
|
||||
* object for all destination properties that resolve to `undefined`. Once a
|
||||
* property is set, additional defaults of the same property will be ignored.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -1257,9 +1262,7 @@
|
||||
* _.defaults(food, { 'name': 'banana', 'type': 'fruit' });
|
||||
* // => { 'name': 'apple', 'type': 'fruit' }
|
||||
*/
|
||||
var defaults = createIterator(assignIteratorOptions, {
|
||||
'loop': 'if (result[index] == null) ' + assignIteratorOptions.loop
|
||||
});
|
||||
var defaults = createIterator(defaultsIteratorOptions);
|
||||
|
||||
/**
|
||||
* Creates a sorted array of all enumerable properties, own and inherited,
|
||||
|
||||
31
test/test.js
31
test/test.js
@@ -529,6 +529,22 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.defaults');
|
||||
|
||||
(function() {
|
||||
test('should not overwrite `null` values', function() {
|
||||
var actual = _.defaults({ 'a': null }, { 'a': 1 });
|
||||
strictEqual(actual.a, null);
|
||||
});
|
||||
|
||||
test('should overwrite `undefined` values', function() {
|
||||
var actual = _.defaults({ 'a': undefined }, { 'a': 1 });
|
||||
strictEqual(actual.a, 1);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.difference');
|
||||
|
||||
(function() {
|
||||
@@ -868,14 +884,18 @@
|
||||
|
||||
QUnit.module('object assignments');
|
||||
|
||||
_.each(['assign', 'merge'], function(methodName) {
|
||||
_.each(['assign', 'defaults', 'merge'], function(methodName) {
|
||||
var func = _[methodName];
|
||||
|
||||
test('lodash.' + methodName + ' should merge problem JScript properties (test in IE < 9)', function() {
|
||||
test('lodash.' + methodName + ' should assign problem JScript properties (test in IE < 9)', function() {
|
||||
var object = {
|
||||
'constructor': 1,
|
||||
'hasOwnProperty': 2,
|
||||
'isPrototypeOf': 3
|
||||
'isPrototypeOf': 3,
|
||||
'propertyIsEnumerable': undefined,
|
||||
'toLocaleString': undefined,
|
||||
'toString': undefined,
|
||||
'valueOf': undefined
|
||||
};
|
||||
|
||||
var source = {
|
||||
@@ -909,6 +929,10 @@
|
||||
_.reduce(array, func, actual);
|
||||
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3});
|
||||
});
|
||||
});
|
||||
|
||||
_.each(['assign', 'merge'], function(methodName) {
|
||||
var func = _[methodName];
|
||||
|
||||
test('lodash.' + methodName + ' should pass the correct `callback` arguments', function() {
|
||||
var args;
|
||||
@@ -1627,7 +1651,6 @@
|
||||
});
|
||||
|
||||
test('should not assign `undefined` values', function() {
|
||||
var a
|
||||
var actual = _.merge({ 'a': 1 }, { 'a': undefined });
|
||||
strictEqual(actual.a, 1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user