Add "customization callback" support to _.assign.

Former-commit-id: 5f0c7b72942ba0c40960072b11936f0683909043
This commit is contained in:
John-David Dalton
2013-02-13 01:17:51 -08:00
parent fe1eb92196
commit a3464780a1
9 changed files with 393 additions and 307 deletions

View File

@@ -7,6 +7,7 @@
/** Used to minify variables embedded in compiled strings */
var compiledVars = [
'args',
'argsIndex',
'argsLength',
'callback',

53
dist/lodash.compat.js vendored
View File

@@ -441,12 +441,20 @@
var assignIteratorOptions = {
'args': 'object, source, guard',
'top':
'var argsIndex = 0,\n' +
'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] = iterable[index]',
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]',
'bottom': ' }\n}'
};
@@ -1019,9 +1027,11 @@
/*--------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources will overwrite propery assignments of previous
* sources.
* 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).
*
* @static
* @memberOf _
@@ -1030,13 +1040,21 @@
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @param- {Object} [guard] Internally used to allow working with `_.reduce`
* without using its callback's `key and `object` arguments as sources.
* @param {Function} [callback] The function to customize assigning values.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the destination object.
* @example
*
* _.assign({ 'name': 'moe' }, { 'age': 40 });
* // => { 'name': 'moe', 'age': 40 }
*
* var defaults = _.partialRight(_.assign, function(a, b) {
* return typeof a == 'undefined' ? b : a;
* });
*
* var food = { 'name': 'apple' };
* defaults(food, { 'name': 'banana', 'type': 'fruit' });
* // => { 'name': 'apple', 'type': 'fruit' }
*/
var assign = createIterator(assignIteratorOptions);
@@ -1212,8 +1230,8 @@
}
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* object for all `destination` properties that resolve to `null`/`undefined`.
* 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.
*
@@ -1228,9 +1246,9 @@
* @returns {Object} Returns the destination object.
* @example
*
* var iceCream = { 'flavor': 'chocolate' };
* _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
* // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
* var food = { 'name': 'apple' };
* _.defaults(food, { 'name': 'banana', 'type': 'fruit' });
* // => { 'name': 'apple', 'type': 'fruit' }
*/
var defaults = createIterator(assignIteratorOptions, {
'loop': 'if (result[index] == null) ' + assignIteratorOptions.loop
@@ -1819,7 +1837,7 @@
/**
* Recursively merges own enumerable properties of the source object(s), that
* don't resolve to `undefined`, into the `destination` object. Subsequent sources
* 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
@@ -1885,8 +1903,7 @@
var callback = args[3],
stackA = args[4],
stackB = args[5];
}
else {
} else {
stackA = [];
stackB = [];
@@ -1894,6 +1911,8 @@
// using their `callback` arguments, `index|key` and `collection`
if (typeof deepIndicator != 'number') {
length = args.length;
}
if (length > 2) {
if (typeof args[length - 2] == 'function') {
callback = createCallback(args[--length - 1], args[length--], 2);
} else if (typeof args[length - 1] == 'function') {
@@ -4293,16 +4312,14 @@
* @returns {Function} Returns the new partially applied function.
* @example
*
* _.mixin({
* 'defaultsDeep': _.partialRight(_.merge, _.defaults)
* });
* var defaultsDeep = _.partialRight(_.merge, _.defaults);
*
* var options = {
* 'variable': 'data',
* 'imports': { 'jq': $ }
* };
*
* _.defaultsDeep(options, _.templateSettings);
* defaultsDeep(options, _.templateSettings);
*
* options.variable
* // => 'data'

View File

@@ -5,38 +5,38 @@
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
;(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=j(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=w(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:dt,b:"k(m)",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 i,m="+t.d+",t=m;if(!m)return t;"+t.l+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",t.j&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.h+"}}else{"):t.i&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.h+"}}else{"),t.f&&(r+="var u=typeof m=='function';"),t.g&&t.m?(r+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];",t.f&&(r+="if(!(u&&i=='prototype')){"),r+=t.h+"",t.f&&(r+="}")):(r+="for(i in m){",(t.f||t.m)&&(r+="if(",t.f&&(r+="!(u&&i=='prototype')"),t.f&&t.m&&(r+="&&"),t.m&&(r+="h.call(m,i)"),r+="){"),r+=t.h+";",(t.f||t.m)&&(r+="}")),r+="}",t.e)for(r+="var f=m.constructor;",e=0;7>e;e++)r+="i='"+t.k[e]+"';if(","constructor"==t.k[e]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.h+"}";
return(t.b||t.i)&&(r+="}"),r+=t.c+";return t",Function("e,h,j,k,l,q,o","return function("+n+"){"+r+"}")(f,Ot,h,lr,A,rr,Rt)}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;
var r=n.constructor;return!j(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 _(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?$:cr)(c?a:n,function(n,u){a[u]=_(n,r,e,t,o,i)}),a}function d(n){var t=[];return ar(n,function(n,r){j(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 w(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 w(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&&(!j(l)||!(l instanceof l&&j(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=w(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)&&w(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 j(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,"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])?$: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?$t(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 q(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 N(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 R(n,t,r){var e;return t=f(t,r),$(n,function(n,r,u){return t(n,r,u)?(e=n,W):void 0}),e}function $(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 F(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),$(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,Ft($t(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?$t(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:$t(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){$(d(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,_t=/['\n\r\t\u2028\u2029\\]/g,dt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),bt=Math.ceil,wt=rt.concat,jt=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,qt=n.isFinite,Nt=n.isNaN,Rt=vt.test(Rt=Object.keys)&&Rt,$t=Math.max,Ft=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=Rt&&(Lt||Ut),Ht=(Ht={0:1,length:1},rt.splice.call(Ht,0,1),Ht[0]),Jt=J;
}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;
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
}),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)
}),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:"p,v,g",l:"var a=0,b=typeof g=='number'?2:arguments.length;while(++a<b){m=arguments[a];if(m&&q[typeof m]){",h:"t[i]=m[i]",c:"}}"},or={a:"d,c,w",l:"c=c&&typeof w=='undefined'?c:e(c,w)",b:"typeof n=='number'",h:"if(c(m[i],i,d)===false)return t"},ir={l:"if(!q[typeof m])return t;"+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=Rt?function(n){return x(n)?nt&&typeof n=="function"||Jt&&n.length&&h(n)?m(n):Rt(n):[]}:m,sr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vr=b(sr),gr=a(ur),hr=a(ur,{h:"if(t[i]==null)"+ur.h});j(/x/)&&(j=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=F,_r=N;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=wt.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=wt.apply(rt,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},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),$(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=wt.apply(rt,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=N,r.flatten=P,r.forEach=$,r.forIn=ar,r.forOwn=cr,r.functions=d,r.groupBy=function(n,t,r){var e={};return t=f(t,r),$(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,Ft($t(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 $(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=pr,r.map=F,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=wt.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=wt.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=$t(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),N(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 $(n,function(n){var r=jt(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),$(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(wt.apply(rt,arguments))},r.uniq=L,r.values=E,r.where=_r,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=F,r.drop=C,r.each=$,r.extend=gr,r.methods=d,r.select=N,r.tail=C,r.unique=L,G(r),r.clone=_,r.cloneDeep=function(n,t,r){return _(n,J,t,r)},r.contains=k,r.escape=function(n){return n==Q?"":(n+"").replace(mt,l)},r.every=q,r.find=R,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"&&j(n.splice)?!e:(cr(n,function(){return t=W}),t)},r.isEqual=w,r.isFinite=function(n){return qt(n)&&!Nt(parseFloat(n))},r.isFunction=j,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?$t(0,e+r):Ft(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+jt(Dt()*((+t||0)-n+1))},r.reduce=I,r.reduceRight=T,r.result=function(n,r){var e=n?n[r]:t;return j(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(_t,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=q,r.any=B,r.detect=R,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,$t(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)
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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},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}";
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
})):X?typeof module=="object"&&module&&module.exports==X?(module.exports=r)._=r:X._=r:n._=r})(this);

53
dist/lodash.js vendored
View File

@@ -323,12 +323,20 @@
var assignIteratorOptions = {
'args': 'object, source, guard',
'top':
'var argsIndex = 0,\n' +
'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] = iterable[index]',
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]',
'bottom': ' }\n}'
};
@@ -876,9 +884,11 @@
/*--------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources will overwrite propery assignments of previous
* sources.
* 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).
*
* @static
* @memberOf _
@@ -887,13 +897,21 @@
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @param- {Object} [guard] Internally used to allow working with `_.reduce`
* without using its callback's `key and `object` arguments as sources.
* @param {Function} [callback] The function to customize assigning values.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the destination object.
* @example
*
* _.assign({ 'name': 'moe' }, { 'age': 40 });
* // => { 'name': 'moe', 'age': 40 }
*
* var defaults = _.partialRight(_.assign, function(a, b) {
* return typeof a == 'undefined' ? b : a;
* });
*
* var food = { 'name': 'apple' };
* defaults(food, { 'name': 'banana', 'type': 'fruit' });
* // => { 'name': 'apple', 'type': 'fruit' }
*/
var assign = createIterator(assignIteratorOptions);
@@ -1069,8 +1087,8 @@
}
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* object for all `destination` properties that resolve to `null`/`undefined`.
* 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.
*
@@ -1085,9 +1103,9 @@
* @returns {Object} Returns the destination object.
* @example
*
* var iceCream = { 'flavor': 'chocolate' };
* _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
* // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
* var food = { 'name': 'apple' };
* _.defaults(food, { 'name': 'banana', 'type': 'fruit' });
* // => { 'name': 'apple', 'type': 'fruit' }
*/
var defaults = createIterator(assignIteratorOptions, {
'loop': 'if (result[index] == null) ' + assignIteratorOptions.loop
@@ -1676,7 +1694,7 @@
/**
* Recursively merges own enumerable properties of the source object(s), that
* don't resolve to `undefined`, into the `destination` object. Subsequent sources
* 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
@@ -1742,8 +1760,7 @@
var callback = args[3],
stackA = args[4],
stackB = args[5];
}
else {
} else {
stackA = [];
stackB = [];
@@ -1751,6 +1768,8 @@
// using their `callback` arguments, `index|key` and `collection`
if (typeof deepIndicator != 'number') {
length = args.length;
}
if (length > 2) {
if (typeof args[length - 2] == 'function') {
callback = createCallback(args[--length - 1], args[length--], 2);
} else if (typeof args[length - 1] == 'function') {
@@ -4143,16 +4162,14 @@
* @returns {Function} Returns the new partially applied function.
* @example
*
* _.mixin({
* 'defaultsDeep': _.partialRight(_.merge, _.defaults)
* });
* var defaultsDeep = _.partialRight(_.merge, _.defaults);
*
* var options = {
* 'variable': 'data',
* 'imports': { 'jq': $ }
* };
*
* _.defaultsDeep(options, _.templateSettings);
* defaultsDeep(options, _.templateSettings);
*
* options.variable
* // => 'data'

64
dist/lodash.min.js vendored
View File

@@ -4,36 +4,36 @@
* Build: `lodash modern -o ./dist/lodash.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
;(function(n,t){function r(n){if(!n||typeof n!="object")return Q;var t=n.valueOf,r=typeof t=="function"&&(r=dt(t))&&dt(r);if(r)n=n==r||dt(n)==r&&!h(n);else{var e=Q;!n||typeof n!="object"||h(n)?n=e:(t=n.constructor,!w(t)||t instanceof t?(Wt(n,function(n,t){e=t}),n=e===Q||_t.call(n,e)):n=e)}return n}function e(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof e?(this.__wrapped__=n,void 0):new e(n)}function u(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||rt);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";
(_t.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return _t.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function o(n){return n.charCodeAt(0)}function i(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 a(n,t,r,e){function u(){var f=arguments,c=i?this:t;return o||(n=t[a]),r.length&&(f=f.length?(f=v(f),e?f.concat(r):r.concat(f)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=L,f=n.apply(c,f),j(f)?f:c):n.apply(c,f)
}var o=w(n),i=!r,a=t;return i&&(r=t),o||(t=n),u}function f(n,t,r){if(n==L)return V;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Zt(n);return function(t){for(var r=u.length,e=Q;r--&&(e=b(t[u[r]],n[u[r]],tt)););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 c(){for(var n,t={g:Ct,b:"k(m)",c:"",h:"",l:"",m:J},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];
return n=t.a,t.d=/^[^,]+/.exec(n)[0],r="var i,m="+t.d+",t=m;if(!m)return t;"+t.l+";",t.b&&(r+="var n=m.length;i=-1;if("+t.b+"){while(++i<n){"+t.h+"}}else{"),t.g&&t.m?r+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];"+t.h+"}":(r+="for(i in m){",t.m&&(r+="if(",t.m&&(r+="h.call(m,i)"),r+="){"),r+=t.h+";",t.m&&(r+="}"),r+="}"),t.b&&(r+="}"),r+=t.c+";return t",Function("e,h,j,k,l,q,o","return function("+n+"){"+r+"}")(f,_t,h,Yt,A,Vt,Et)}function l(n){return"\\"+Gt[n]}function p(n){return nr[n]
}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 tr[n]}function h(n){return wt.call(n)==Nt}function y(n){var t=[];return Xt(n,function(n,r){t.push(r)}),t}function m(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=Q),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=j(a)){var l=wt.call(a);if(!Kt[l])return a;var p=Yt(a)
}if(!u||!r)return u&&!c?p?v(a):rr({},a):a;switch(u=Ut[l],l){case $t:case Ft:return c?a:new u(+a);case Dt:case It:return c?a:new u(a);case Bt:return c?a:u(a.source,ft.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=p?u(a.length):{},p&&(_t.call(n,"index")&&(a.index=n.index),_t.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(p?R:Xt)(c?a:n,function(n,u){a[u]=m(n,r,e,t,o,i)}),a}function d(n){var t=[];return Wt(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Zt(n),e=r.length,u={};++t<e;){var o=r[t];
u[n[o]]=o}return u}function b(n,t,r,e,u,o){var i=r===tt;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 Q;if(n==L||t==L)return n===t;if(l=wt.call(n),c=wt.call(t),l==Nt&&(l=Tt),c==Nt&&(c=Tt),l!=c)return Q;switch(l){case $t:case Ft:return+n==+t;case Dt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Bt:case It:return n==t+""
}if(c=l==Rt,!c){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=Tt)return Q;var l=n.constructor,p=t.constructor;if(l!=p&&(!w(l)||!(l instanceof l&&w(p)&&p instanceof p)))return Q}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var s=0,a=J;if(u.push(n),o.push(t),c){if(s=t.length,a=i||s==n.length)for(;s--&&(a=b(n[s],t[s],r,e,u,o)););return a}return Wt(t,function(t,i,f){return _t.call(f,i)?(s++,a=_t.call(n,i)&&b(n[i],t,r,e,u,o)):void 0}),a&&!i&&Wt(n,function(n,t,r){return _t.call(r,t)?a=-1<--s:void 0
}),a}function w(n){return typeof n=="function"}function j(n){return n?Vt[typeof n]:Q}function x(n){return typeof n=="number"||wt.call(n)==Dt}function A(n){return typeof n=="string"||wt.call(n)==It}function O(n,t,e){var u=arguments,o=0,i=2;if(!j(n))return n;if(e===tt)var a=u[3],c=u[4],l=u[5];else c=[],l=[],typeof e!="number"&&(i=u.length,"function"==typeof u[i-2]?a=f(u[--i-1],u[i--],2):"function"==typeof u[i-1]&&(a=u[--i]));for(;++o<i;)(Yt(u[o])?R:Xt)(u[o],function(t,e){var u,o,i=t,f=n[e];if(t&&((o=Yt(t))||r(t))){for(i=c.length;i--;)if(u=c[i]==t){f=l[i];
break}u||(f=o?Yt(f)?f:[]:r(f)?f:{},a&&(i=a(f,t),typeof i!="undefined"&&(f=i)),c.push(t),l.push(f),a||(f=O(f,t,tt,a,c,l)))}else a&&(i=a(f,t),typeof i=="undefined"&&(i=t)),typeof i!="undefined"&&(f=i);n[e]=f});return n}function E(n){for(var t=-1,r=Zt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,t,r){var e=-1,u=n?n.length:0,o=Q;return r=(0>r?St(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):Qt(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function q(n,t,r){var e=J;
if(t=f(t,r),Yt(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Qt(n,function(n,r,u){return e=!!t(n,r,u)});return e}function k(n,t,r){var e=[];if(t=f(t,r),Yt(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Qt(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function N(n,t,r){var e;return t=f(t,r),R(n,function(n,r,u){return t(n,r,u)?(e=n,Q):void 0}),e}function R(n,t,r){if(t&&typeof r=="undefined"&&Yt(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==Q;);}else Qt(n,t,r);
return n}function $(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),Yt(n))for(;++e<u;)o[e]=t(n[e],e,n);else Qt(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function F(n,t,r){var e=-1/0,u=e;if(!t&&Yt(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>u&&(u=a)}}else t=!t&&A(n)?o:f(t,r),Qt(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});return u}function D(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),Yt(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else Qt(n,function(n,e,o){r=u?(u=Q,n):t(r,n,e,o)
});return r}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Zt(n),u=i.length;return t=f(t,e,4),R(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=Q,n[a]):t(r,n[a],a,f)}),r}function B(n,t,r){var e;if(t=f(t,r),Yt(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Qt(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function I(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=L){var o=-1;for(t=f(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==L||r)return n[0];
return v(n,0,qt(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=f(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?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 K(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;typeof t=="function"&&(e=r,r=t,t=Q);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=_t.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 Pt||jt&&2<arguments.length?jt.call.apply(jt,arguments):a(n,t,v(arguments,2))}function V(n){return n}function G(n){R(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,at=/(__e\(.*?\)|\b__t\))\+'';/g,ft=/\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,wt=Z.toString,jt=ct.test(jt=v.bind)&&jt,xt=ct.test(xt=Array.isArray)&&xt,At=n.isFinite,Ot=n.isNaN,Et=ct.test(Et=Object.keys)&&Et,St=Math.max,qt=Math.min,kt=Math.random,Nt="[object Arguments]",Rt="[object Array]",$t="[object Boolean]",Ft="[object Date]",Dt="[object Number]",Tt="[object Object]",Bt="[object RegExp]",It="[object String]",Mt=!!n.attachEvent,zt=jt&&!/\n|true/.test(jt+Mt),Pt=jt&&!zt,Ct=Et&&(Mt||zt),Kt={"[object Function]":Q};
Kt[Nt]=Kt[Rt]=Kt[$t]=Kt[Ft]=Kt[Dt]=Kt[Tt]=Kt[Bt]=Kt[It]=J;var Ut={};Ut[Rt]=Array,Ut[$t]=Boolean,Ut[Ft]=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:"p,v,g",l:"var a=0,b=typeof g=='number'?2:arguments.length;while(++a<b){m=arguments[a];if(m&&q[typeof m]){",h:"t[i]=m[i]",c:"}}"},Jt={a:"d,c,w",l:"c=c&&typeof w=='undefined'?c:e(c,w)",b:"typeof n=='number'",h:"if(c(m[i],i,d)===false)return t"},Lt={l:"if(!q[typeof m])return t;"+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||wt.call(n)==Rt
},Zt=Et?function(n){return j(n)?Et(n):[]}:y,nr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tr=_(nr),rr=c(Ht),er=c(Ht,{h:"if(t[i]==null)"+Ht.h});w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==wt.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 a(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=f(t,r),R(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(){a=L,r||(o=n.apply(i,u))}var u,o,i,a;return function(){var f=r&&!a;
return u=arguments,i=this,clearTimeout(a),a=setTimeout(e,t),f&&(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=k,e.flatten=M,e.forEach=R,e.forIn=Wt,e.forOwn=Xt,e.functions=d,e.groupBy=function(n,t,r){var e={};
return t=f(t,r),R(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=f(t,r);o--&&t(n[o],o,n);)e++}else e=t==L||r?1:t||e;return v(n,0,qt(St(0,u-e),u))},e.intersection=function(n){var t=arguments,r=t.length,e={0:{}},o=-1,i=n?n.length:0,a=100<=i,f=[],c=f;n:for(;++o<i;){var l=n[o];if(a)var p=l+"",p=_t.call(e[0],p)?!(c=e[0][p]):c=e[0][p]=[];if(p||0>z(c,l)){a&&c.push(l);for(var s=r;--s;)if(!(e[s]||(e[s]=u(t[s],0,100)))(l))continue n;
f.push(l)}}return f},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 R(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},e.keys=Zt,e.map=$,e.max=F,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 a=n[r];a<u&&(u=a)
}}else t=!t&&A(n)?o:f(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=f(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 a(n,v(arguments,1))},e.partialRight=function(n){return a(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=j(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),Wt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},e.pluck=$,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=f(t,r),k(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 R(n,function(n){var r=mt(kt()*(++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=f(t,r),R(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(){a=new Date,i=L,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,c=t-(f-a);
return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=L,a=f,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=k,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?F($(arguments,"length")):0,e=Array(r);++t<r;)e[t]=$(arguments,t);return e},e.collect=$,e.drop=P,e.each=R,e.extend=rr,e.methods=d,e.select=k,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=q,e.find=N,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||wt.call(n)==$t
},e.isDate=function(n){return n instanceof Date||wt.call(n)==Ft},e.isElement=function(n){return n?1===n.nodeType:Q},e.isEmpty=function(n){var t=J;if(!n)return t;var r=wt.call(n),e=n.length;return r==Rt||r==It||r==Nt||r==Tt&&typeof e=="number"&&w(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=w,e.isNaN=function(n){return x(n)&&n!=+n},e.isNull=function(n){return n===L},e.isNumber=x,e.isObject=j,e.isPlainObject=r,e.isRegExp=function(n){return n instanceof RegExp||wt.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):qt(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(kt()*((+t||0)-n+1))},e.reduce=D,e.reduceRight=T,e.result=function(n,r){var e=n?n[r]:t;return w(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,a=er({},u.imports,o.imports),o=Zt(a),a=E(a),f=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,a){return e||(e=u),p+=n.slice(f,a).replace(gt,l),r&&(p+="'+__e("+r+")+'"),o&&(i=J,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),f=a+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(at,"$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,a)}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=q,e.any=B,e.detect=N,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=f(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)}
;(function(n,t){function r(n){if(!n||typeof n!="object")return Q;var t=n.valueOf,r=typeof t=="function"&&(r=dt(t))&&dt(r);if(r)n=n==r||dt(n)==r&&!h(n);else{var e=Q;!n||typeof n!="object"||h(n)?n=e:(t=n.constructor,!j(t)||t instanceof t?(Wt(n,function(n,t){e=t}),n=e===Q||_t.call(n,e)):n=e)}return n}function e(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof e?(this.__wrapped__=n,void 0):new e(n)}function u(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||rt);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";
(_t.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return _t.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function o(n){return n.charCodeAt(0)}function i(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 f(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=L,a=n.apply(c,a),w(a)?a:c):n.apply(c,a)
}var o=j(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function a(n,t,r){if(n==L)return V;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Zt(n);return function(t){for(var r=u.length,e=Q;r--&&(e=b(t[u[r]],n[u[r]],tt)););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 c(){for(var n,t={g:Ct,b:"l(n)",c:"",h:"",l:"",m:J},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];
return 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+"){while(++j<o){"+t.h+"}}else{"),t.g&&t.m?r+="var s=-1,t=r[typeof n]?p(n):[],o=t.length;while(++s<o){j=t[s];"+t.h+"}":(r+="for(j in n){",t.m&&(r+="if(",t.m&&(r+="i.call(n,j)"),r+="){"),r+=t.h+";",t.m&&(r+="}"),r+="}"),t.b&&(r+="}"),r+=t.c+";return u",Function("f,i,k,l,m,r,p","return function("+n+"){"+r+"}")(a,_t,h,Yt,A,Vt,Et)}function l(n){return"\\"+Gt[n]}function p(n){return nr[n]
}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 tr[n]}function h(n){return jt.call(n)==$t}function y(n){var t=[];return Xt(n,function(n,r){t.push(r)}),t}function m(n,r,e,u,o,i){var f=n;if(typeof r=="function"&&(u=e,e=r,r=Q),typeof e=="function"){e=typeof u=="undefined"?e:a(e,u,1);var f=e(f),c=typeof f!="undefined";c||(f=n)}if(u=w(f)){var l=jt.call(f);if(!Kt[l])return f;var p=Yt(f)
}if(!u||!r)return u&&!c?p?v(f):rr({},f):f;switch(u=Ut[l],l){case kt:case qt:return c?f:new u(+f);case Dt:case It:return c?f:new u(f);case Bt:return c?f:u(f.source,at.exec(f))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(f=p?u(f.length):{},p&&(_t.call(n,"index")&&(f.index=n.index),_t.call(n,"input")&&(f.input=n.input))),o.push(n),i.push(f),(p?F:Xt)(c?f:n,function(n,u){f[u]=m(n,r,e,t,o,i)}),f}function d(n){var t=[];return Wt(n,function(n,r){j(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Zt(n),e=r.length,u={};++t<e;){var o=r[t];
u[n[o]]=o}return u}function b(n,t,r,e,u,o){var i=r===tt;if(r&&!i){r=typeof e=="undefined"?r:a(r,e,2);var f=r(n,t);if(typeof f!="undefined")return!!f}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 Q;if(n==L||t==L)return n===t;if(l=jt.call(n),c=jt.call(t),l==$t&&(l=Tt),c==$t&&(c=Tt),l!=c)return Q;switch(l){case kt:case qt:return+n==+t;case Dt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Bt:case It:return n==t+""
}if(c=l==Ft,!c){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=Tt)return Q;var l=n.constructor,p=t.constructor;if(l!=p&&(!j(l)||!(l instanceof l&&j(p)&&p instanceof p)))return Q}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var s=0,f=J;if(u.push(n),o.push(t),c){if(s=t.length,f=i||s==n.length)for(;s--&&(f=b(n[s],t[s],r,e,u,o)););return f}return Wt(t,function(t,i,a){return _t.call(a,i)?(s++,f=_t.call(n,i)&&b(n[i],t,r,e,u,o)):void 0}),f&&!i&&Wt(n,function(n,t,r){return _t.call(r,t)?f=-1<--s:void 0
}),f}function j(n){return typeof n=="function"}function w(n){return n?Vt[typeof n]:Q}function x(n){return typeof n=="number"||jt.call(n)==Dt}function A(n){return typeof n=="string"||jt.call(n)==It}function O(n,t,e){var u=arguments,o=0,i=2;if(!w(n))return n;if(e===tt)var f=u[3],c=u[4],l=u[5];else c=[],l=[],typeof e!="number"&&(i=u.length),2<i&&("function"==typeof u[i-2]?f=a(u[--i-1],u[i--],2):"function"==typeof u[i-1]&&(f=u[--i]));for(;++o<i;)(Yt(u[o])?F:Xt)(u[o],function(t,e){var u,o,i=t,a=n[e];if(t&&((o=Yt(t))||r(t))){for(i=c.length;i--;)if(u=c[i]==t){a=l[i];
break}u||(a=o?Yt(a)?a:[]:r(a)?a:{},f&&(i=f(a,t),typeof i!="undefined"&&(a=i)),c.push(t),l.push(a),f||(a=O(a,t,tt,f,c,l)))}else f&&(i=f(a,t),typeof i=="undefined"&&(i=t)),typeof i!="undefined"&&(a=i);n[e]=a});return n}function E(n){for(var t=-1,r=Zt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,t,r){var e=-1,u=n?n.length:0,o=Q;return r=(0>r?St(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):Qt(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function N(n,t,r){var e=J;
if(t=a(t,r),Yt(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Qt(n,function(n,r,u){return e=!!t(n,r,u)});return e}function R(n,t,r){var e=[];if(t=a(t,r),Yt(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Qt(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function $(n,t,r){var e;return t=a(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,Q):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&Yt(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==Q;);}else Qt(n,t,r);
return n}function k(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=a(t,r),Yt(n))for(;++e<u;)o[e]=t(n[e],e,n);else Qt(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function q(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}function D(n,t,r,e){var u=3>arguments.length;if(t=a(t,e,4),Yt(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else Qt(n,function(n,e,o){r=u?(u=Q,n):t(r,n,e,o)
});return r}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Zt(n),u=i.length;return t=a(t,e,4),F(n,function(e,f,a){f=i?i[--u]:--u,r=o?(o=Q,n[f]):t(r,n[f],f,a)}),r}function B(n,t,r){var e;if(t=a(t,r),Yt(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Qt(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function I(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=L){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==L||r)return n[0];
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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},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);

View File

@@ -242,12 +242,20 @@
var assignIteratorOptions = {
'args': 'object, source, guard',
'top':
'var argsIndex = 0,\n' +
'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] = iterable[index]',
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]',
'bottom': ' }\n}'
};
@@ -752,9 +760,11 @@
/*--------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources will overwrite propery assignments of previous
* sources.
* 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).
*
* @static
* @memberOf _
@@ -763,13 +773,21 @@
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @param- {Object} [guard] Internally used to allow working with `_.reduce`
* without using its callback's `key and `object` arguments as sources.
* @param {Function} [callback] The function to customize assigning values.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the destination object.
* @example
*
* _.assign({ 'name': 'moe' }, { 'age': 40 });
* // => { 'name': 'moe', 'age': 40 }
*
* var defaults = _.partialRight(_.assign, function(a, b) {
* return typeof a == 'undefined' ? b : a;
* });
*
* var food = { 'name': 'apple' };
* defaults(food, { 'name': 'banana', 'type': 'fruit' });
* // => { 'name': 'apple', 'type': 'fruit' }
*/
function assign(object) {
if (!object) {
@@ -835,8 +853,8 @@
}
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* object for all `destination` properties that resolve to `null`/`undefined`.
* 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.
*
@@ -851,9 +869,9 @@
* @returns {Object} Returns the destination object.
* @example
*
* var iceCream = { 'flavor': 'chocolate' };
* _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
* // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
* var food = { 'name': 'apple' };
* _.defaults(food, { 'name': 'banana', 'type': 'fruit' });
* // => { 'name': 'apple', 'type': 'fruit' }
*/
function defaults(object) {
if (!object) {

View File

@@ -107,11 +107,11 @@
<!-- div -->
## `Objects`
* [`_.assign`](#_assignobject--source1-source2-)
* [`_.assign`](#_assignobject--source1-source2--callback-thisarg)
* [`_.clone`](#_clonevalue--deepfalse-callback-thisarg)
* [`_.cloneDeep`](#_clonedeepvalue--callback-thisarg)
* [`_.defaults`](#_defaultsobject--source1-source2-)
* [`_.extend`](#_assignobject--source1-source2-)
* [`_.extend`](#_assignobject--source1-source2--callback-thisarg)
* [`_.forIn`](#_forinobject--callbackidentity-thisarg)
* [`_.forOwn`](#_forownobject--callbackidentity-thisarg)
* [`_.functions`](#_functionsobject)
@@ -197,7 +197,7 @@
<!-- div -->
### <a id="_compactarray"></a>`_.compact(array)`
<a href="#_compactarray">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3134 "View in source") [&#x24C9;][1]
<a href="#_compactarray">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3153 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3164 "View in source") [&#x24C9;][1]
<a href="#_differencearray--array1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3183 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3235 "View in source") [&#x24C9;][1]
<a href="#_firstarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3254 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3274 "View in source") [&#x24C9;][1]
<a href="#_flattenarray-shallow">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3293 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3316 "View in source") [&#x24C9;][1]
<a href="#_indexofarray-value--fromindex0">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3335 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3389 "View in source") [&#x24C9;][1]
<a href="#_initialarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3408 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3423 "View in source") [&#x24C9;][1]
<a href="#_intersectionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3442 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3513 "View in source") [&#x24C9;][1]
<a href="#_lastarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3532 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3554 "View in source") [&#x24C9;][1]
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3573 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3584 "View in source") [&#x24C9;][1]
<a href="#_objectkeys--values">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3603 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3628 "View in source") [&#x24C9;][1]
<a href="#_rangestart0-end--step1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3647 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3705 "View in source") [&#x24C9;][1]
<a href="#_restarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3724 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3769 "View in source") [&#x24C9;][1]
<a href="#_sortedindexarray-value--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3788 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3801 "View in source") [&#x24C9;][1]
<a href="#_unionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3820 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3848 "View in source") [&#x24C9;][1]
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3867 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3907 "View in source") [&#x24C9;][1]
<a href="#_withoutarray--value1-value2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3926 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3938 "View in source") [&#x24C9;][1]
<a href="#_ziparray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3957 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4836 "View in source") [&#x24C9;][1]
<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4853 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4853 "View in source") [&#x24C9;][1]
<a href="#_prototypetostring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4870 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4870 "View in source") [&#x24C9;][1]
<a href="#_prototypevalueof">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4887 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2135 "View in source") [&#x24C9;][1]
<a href="#_atcollection--index1-index2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2154 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2177 "View in source") [&#x24C9;][1]
<a href="#_containscollection-target--fromindex0">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2196 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2231 "View in source") [&#x24C9;][1]
<a href="#_countbycollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2250 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2283 "View in source") [&#x24C9;][1]
<a href="#_everycollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2302 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2344 "View in source") [&#x24C9;][1]
<a href="#_filtercollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2363 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2411 "View in source") [&#x24C9;][1]
<a href="#_findcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2430 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2446 "View in source") [&#x24C9;][1]
<a href="#_foreachcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2465 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2496 "View in source") [&#x24C9;][1]
<a href="#_groupbycollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2515 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2529 "View in source") [&#x24C9;][1]
<a href="#_invokecollection-methodname--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2548 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2581 "View in source") [&#x24C9;][1]
<a href="#_mapcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2600 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2638 "View in source") [&#x24C9;][1]
<a href="#_maxcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2657 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2707 "View in source") [&#x24C9;][1]
<a href="#_mincollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2726 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2757 "View in source") [&#x24C9;][1]
<a href="#_pluckcollection-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2776 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2789 "View in source") [&#x24C9;][1]
<a href="#_reducecollection--callbackidentity-accumulator-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2808 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2832 "View in source") [&#x24C9;][1]
<a href="#_reducerightcollection--callbackidentity-accumulator-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2851 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2892 "View in source") [&#x24C9;][1]
<a href="#_rejectcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2911 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2913 "View in source") [&#x24C9;][1]
<a href="#_shufflecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2932 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2946 "View in source") [&#x24C9;][1]
<a href="#_sizecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2965 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2993 "View in source") [&#x24C9;][1]
<a href="#_somecollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3012 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3049 "View in source") [&#x24C9;][1]
<a href="#_sortbycollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3068 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3084 "View in source") [&#x24C9;][1]
<a href="#_toarraycollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3103 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3116 "View in source") [&#x24C9;][1]
<a href="#_wherecollection-properties">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3135 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3971 "View in source") [&#x24C9;][1]
<a href="#_aftern-func">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3990 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4004 "View in source") [&#x24C9;][1]
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4023 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4035 "View in source") [&#x24C9;][1]
<a href="#_bindallobject--methodname1-methodname2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4054 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4081 "View in source") [&#x24C9;][1]
<a href="#_bindkeyobject-key--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4100 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4104 "View in source") [&#x24C9;][1]
<a href="#_composefunc1-func2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4123 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4137 "View in source") [&#x24C9;][1]
<a href="#_debouncefunc-wait-immediate">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4156 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4201 "View in source") [&#x24C9;][1]
<a href="#_deferfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4220 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4181 "View in source") [&#x24C9;][1]
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4200 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4225 "View in source") [&#x24C9;][1]
<a href="#_memoizefunc--resolver">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4244 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4252 "View in source") [&#x24C9;][1]
<a href="#_oncefunc">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4271 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4287 "View in source") [&#x24C9;][1]
<a href="#_partialfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4306 "View in source") [&#x24C9;][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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4320 "View in source") [&#x24C9;][1]
<a href="#_partialrightfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4337 "View in source") [&#x24C9;][1]
This method is similar to `_.partial`, except that `partial` arguments are appended to those passed to the new function.
@@ -2080,16 +2080,14 @@ This method is similar to `_.partial`, except that `partial` arguments are appen
#### Example
```js
_.mixin({
'defaultsDeep': _.partialRight(_.merge, _.defaults)
});
var defaultsDeep = _.partialRight(_.merge, _.defaults);
var options = {
'variable': 'data',
'imports': { 'jq': $ }
};
_.defaultsDeep(options, _.templateSettings);
defaultsDeep(options, _.templateSettings);
options.variable
// => 'data'
@@ -2106,7 +2104,7 @@ options.imports
<!-- div -->
### <a id="_throttlefunc-wait"></a>`_.throttle(func, wait)`
<a href="#_throttlefunc-wait">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4342 "View in source") [&#x24C9;][1]
<a href="#_throttlefunc-wait">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4359 "View in source") [&#x24C9;][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.
@@ -2131,7 +2129,7 @@ jQuery(window).on('scroll', throttled);
<!-- div -->
### <a id="_wrapvalue-wrapper"></a>`_.wrap(value, wrapper)`
<a href="#_wrapvalue-wrapper">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4395 "View in source") [&#x24C9;][1]
<a href="#_wrapvalue-wrapper">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4412 "View in source") [&#x24C9;][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.
@@ -2166,10 +2164,10 @@ hello();
<!-- div -->
### <a id="_assignobject--source1-source2-"></a>`_.assign(object [, source1, source2, ...])`
<a href="#_assignobject--source1-source2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1048 "View in source") [&#x24C9;][1]
### <a id="_assignobject--source1-source2--callback-thisarg"></a>`_.assign(object [, source1, source2, ..., callback, thisArg])`
<a href="#_assignobject--source1-source2--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1066 "View in source") [&#x24C9;][1]
Assigns own enumerable properties of source object(s) to the `destination` object. Subsequent sources will overwrite propery assignments of previous sources.
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)*.
#### Aliases
*extend*
@@ -2177,6 +2175,8 @@ Assigns own enumerable properties of source object(s) to the `destination` objec
#### Arguments
1. `object` *(Object)*: The destination object.
2. `[source1, source2, ...]` *(Object)*: The source objects.
3. `[callback]` *(Function)*: The function to customize assigning values.
4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`.
#### Returns
*(Object)*: Returns the destination object.
@@ -2185,6 +2185,14 @@ Assigns own enumerable properties of source object(s) to the `destination` objec
```js
_.assign({ 'name': 'moe' }, { 'age': 40 });
// => { 'name': 'moe', 'age': 40 }
var defaults = _.partialRight(_.assign, function(a, b) {
return typeof a == 'undefined' ? b : a;
});
var food = { 'name': 'apple' };
defaults(food, { 'name': 'banana', 'type': 'fruit' });
// => { 'name': 'apple', 'type': 'fruit' }
```
* * *
@@ -2195,7 +2203,7 @@ _.assign({ 'name': 'moe' }, { 'age': 40 });
<!-- div -->
### <a id="_clonevalue--deepfalse-callback-thisarg"></a>`_.clone(value [, deep=false, callback, thisArg])`
<a href="#_clonevalue--deepfalse-callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1092 "View in source") [&#x24C9;][1]
<a href="#_clonevalue--deepfalse-callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1110 "View in source") [&#x24C9;][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)*.
@@ -2242,7 +2250,7 @@ clone.childNodes.length;
<!-- div -->
### <a id="_clonedeepvalue--callback-thisarg"></a>`_.cloneDeep(value [, callback, thisArg])`
<a href="#_clonedeepvalue--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1217 "View in source") [&#x24C9;][1]
<a href="#_clonedeepvalue--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1235 "View in source") [&#x24C9;][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)*.
@@ -2288,9 +2296,9 @@ clone.node == view.node;
<!-- div -->
### <a id="_defaultsobject--source1-source2-"></a>`_.defaults(object [, source1, source2, ...])`
<a href="#_defaultsobject--source1-source2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1242 "View in source") [&#x24C9;][1]
<a href="#_defaultsobject--source1-source2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1260 "View in source") [&#x24C9;][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 `null`/`undefined`. Once a property is set, additional defaults of the same property will be ignored.
#### Arguments
1. `object` *(Object)*: The destination object.
@@ -2301,9 +2309,9 @@ Assigns own enumerable properties of source object(s) to the `destination` objec
#### Example
```js
var iceCream = { 'flavor': 'chocolate' };
_.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
// => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
var food = { 'name': 'apple' };
_.defaults(food, { 'name': 'banana', 'type': 'fruit' });
// => { 'name': 'apple', 'type': 'fruit' }
```
* * *
@@ -2314,7 +2322,7 @@ _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
<!-- div -->
### <a id="_forinobject--callbackidentity-thisarg"></a>`_.forIn(object [, callback=identity, thisArg])`
<a href="#_forinobject--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L878 "View in source") [&#x24C9;][1]
<a href="#_forinobject--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L886 "View in source") [&#x24C9;][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`.
@@ -2350,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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L903 "View in source") [&#x24C9;][1]
<a href="#_forownobject--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L911 "View in source") [&#x24C9;][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`.
@@ -2378,7 +2386,7 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
<!-- div -->
### <a id="_functionsobject"></a>`_.functions(object)`
<a href="#_functionsobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1261 "View in source") [&#x24C9;][1]
<a href="#_functionsobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1279 "View in source") [&#x24C9;][1]
Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values.
@@ -2405,7 +2413,7 @@ _.functions(_);
<!-- div -->
### <a id="_hasobject-property"></a>`_.has(object, property)`
<a href="#_hasobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1286 "View in source") [&#x24C9;][1]
<a href="#_hasobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1304 "View in source") [&#x24C9;][1]
Checks if the specified object `property` exists and is a direct property, instead of an inherited property.
@@ -2430,7 +2438,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
<!-- div -->
### <a id="_invertobject"></a>`_.invert(object)`
<a href="#_invertobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1303 "View in source") [&#x24C9;][1]
<a href="#_invertobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1321 "View in source") [&#x24C9;][1]
Creates an object composed of the inverted keys and values of the given `object`.
@@ -2454,7 +2462,7 @@ _.invert({ 'first': 'moe', 'second': 'larry' });
<!-- div -->
### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
<a href="#_isargumentsvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L839 "View in source") [&#x24C9;][1]
<a href="#_isargumentsvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L847 "View in source") [&#x24C9;][1]
Checks if `value` is an `arguments` object.
@@ -2481,7 +2489,7 @@ _.isArguments([1, 2, 3]);
<!-- div -->
### <a id="_isarrayvalue"></a>`_.isArray(value)`
<a href="#_isarrayvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L921 "View in source") [&#x24C9;][1]
<a href="#_isarrayvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L929 "View in source") [&#x24C9;][1]
Checks if `value` is an array.
@@ -2508,7 +2516,7 @@ _.isArray([1, 2, 3]);
<!-- div -->
### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
<a href="#_isbooleanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1329 "View in source") [&#x24C9;][1]
<a href="#_isbooleanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1347 "View in source") [&#x24C9;][1]
Checks if `value` is a boolean value.
@@ -2532,7 +2540,7 @@ _.isBoolean(null);
<!-- div -->
### <a id="_isdatevalue"></a>`_.isDate(value)`
<a href="#_isdatevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1346 "View in source") [&#x24C9;][1]
<a href="#_isdatevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1364 "View in source") [&#x24C9;][1]
Checks if `value` is a date.
@@ -2556,7 +2564,7 @@ _.isDate(new Date);
<!-- div -->
### <a id="_iselementvalue"></a>`_.isElement(value)`
<a href="#_iselementvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1363 "View in source") [&#x24C9;][1]
<a href="#_iselementvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1381 "View in source") [&#x24C9;][1]
Checks if `value` is a DOM element.
@@ -2580,7 +2588,7 @@ _.isElement(document.body);
<!-- div -->
### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
<a href="#_isemptyvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1388 "View in source") [&#x24C9;][1]
<a href="#_isemptyvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1406 "View in source") [&#x24C9;][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".
@@ -2610,7 +2618,7 @@ _.isEmpty('');
<!-- div -->
### <a id="_isequala-b--callback-thisarg"></a>`_.isEqual(a, b [, callback, thisArg])`
<a href="#_isequala-b--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1447 "View in source") [&#x24C9;][1]
<a href="#_isequala-b--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1465 "View in source") [&#x24C9;][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)*.
@@ -2655,7 +2663,7 @@ _.isEqual(words, otherWords, function(a, b) {
<!-- div -->
### <a id="_isfinitevalue"></a>`_.isFinite(value)`
<a href="#_isfinitevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1617 "View in source") [&#x24C9;][1]
<a href="#_isfinitevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1635 "View in source") [&#x24C9;][1]
Checks if `value` is, or can be coerced to, a finite number.
@@ -2693,7 +2701,7 @@ _.isFinite(Infinity);
<!-- div -->
### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
<a href="#_isfunctionvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1634 "View in source") [&#x24C9;][1]
<a href="#_isfunctionvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1652 "View in source") [&#x24C9;][1]
Checks if `value` is a function.
@@ -2717,7 +2725,7 @@ _.isFunction(_);
<!-- div -->
### <a id="_isnanvalue"></a>`_.isNaN(value)`
<a href="#_isnanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1697 "View in source") [&#x24C9;][1]
<a href="#_isnanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1715 "View in source") [&#x24C9;][1]
Checks if `value` is `NaN`.
@@ -2752,7 +2760,7 @@ _.isNaN(undefined);
<!-- div -->
### <a id="_isnullvalue"></a>`_.isNull(value)`
<a href="#_isnullvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1719 "View in source") [&#x24C9;][1]
<a href="#_isnullvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1737 "View in source") [&#x24C9;][1]
Checks if `value` is `null`.
@@ -2779,7 +2787,7 @@ _.isNull(undefined);
<!-- div -->
### <a id="_isnumbervalue"></a>`_.isNumber(value)`
<a href="#_isnumbervalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1736 "View in source") [&#x24C9;][1]
<a href="#_isnumbervalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1754 "View in source") [&#x24C9;][1]
Checks if `value` is a number.
@@ -2803,7 +2811,7 @@ _.isNumber(8.4 * 5);
<!-- div -->
### <a id="_isobjectvalue"></a>`_.isObject(value)`
<a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1664 "View in source") [&#x24C9;][1]
<a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1682 "View in source") [&#x24C9;][1]
Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)*
@@ -2833,7 +2841,7 @@ _.isObject(1);
<!-- div -->
### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
<a href="#_isplainobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1764 "View in source") [&#x24C9;][1]
<a href="#_isplainobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1782 "View in source") [&#x24C9;][1]
Checks if a given `value` is an object created by the `Object` constructor.
@@ -2868,7 +2876,7 @@ _.isPlainObject({ 'name': 'moe', 'age': 40 });
<!-- div -->
### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
<a href="#_isregexpvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1789 "View in source") [&#x24C9;][1]
<a href="#_isregexpvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1807 "View in source") [&#x24C9;][1]
Checks if `value` is a regular expression.
@@ -2892,7 +2900,7 @@ _.isRegExp(/moe/);
<!-- div -->
### <a id="_isstringvalue"></a>`_.isString(value)`
<a href="#_isstringvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1806 "View in source") [&#x24C9;][1]
<a href="#_isstringvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1824 "View in source") [&#x24C9;][1]
Checks if `value` is a string.
@@ -2916,7 +2924,7 @@ _.isString('moe');
<!-- div -->
### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
<a href="#_isundefinedvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1823 "View in source") [&#x24C9;][1]
<a href="#_isundefinedvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1841 "View in source") [&#x24C9;][1]
Checks if `value` is `undefined`.
@@ -2940,7 +2948,7 @@ _.isUndefined(void 0);
<!-- div -->
### <a id="_keysobject"></a>`_.keys(object)`
<a href="#_keysobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L940 "View in source") [&#x24C9;][1]
<a href="#_keysobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L948 "View in source") [&#x24C9;][1]
Creates an array composed of the own enumerable property names of `object`.
@@ -2964,9 +2972,9 @@ _.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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1883 "View in source") [&#x24C9;][1]
<a href="#_mergeobject--source1-source2--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1901 "View in source") [&#x24C9;][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)*.
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)*.
#### Arguments
1. `object` *(Object)*: The destination object.
@@ -3020,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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1991 "View in source") [&#x24C9;][1]
<a href="#_omitobject-callback-prop1-prop2--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2010 "View in source") [&#x24C9;][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)*.
@@ -3051,7 +3059,7 @@ _.omit({ 'name': 'moe', 'age': 40 }, function(value) {
<!-- div -->
### <a id="_pairsobject"></a>`_.pairs(object)`
<a href="#_pairsobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2025 "View in source") [&#x24C9;][1]
<a href="#_pairsobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2044 "View in source") [&#x24C9;][1]
Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`.
@@ -3075,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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2063 "View in source") [&#x24C9;][1]
<a href="#_pickobject-callback-prop1-prop2--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2082 "View in source") [&#x24C9;][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)*.
@@ -3106,7 +3114,7 @@ _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) {
<!-- div -->
### <a id="_valuesobject"></a>`_.values(object)`
<a href="#_valuesobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2100 "View in source") [&#x24C9;][1]
<a href="#_valuesobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2119 "View in source") [&#x24C9;][1]
Creates an array composed of the own enumerable property values of `object`.
@@ -3137,7 +3145,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 });
<!-- div -->
### <a id="_escapestring"></a>`_.escape(string)`
<a href="#_escapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4419 "View in source") [&#x24C9;][1]
<a href="#_escapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4436 "View in source") [&#x24C9;][1]
Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities.
@@ -3161,7 +3169,7 @@ _.escape('Moe, Larry & Curly');
<!-- div -->
### <a id="_identityvalue"></a>`_.identity(value)`
<a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4437 "View in source") [&#x24C9;][1]
<a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4454 "View in source") [&#x24C9;][1]
This function returns the first argument passed to it.
@@ -3186,7 +3194,7 @@ moe === _.identity(moe);
<!-- div -->
### <a id="_mixinobject"></a>`_.mixin(object)`
<a href="#_mixinobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4463 "View in source") [&#x24C9;][1]
<a href="#_mixinobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4480 "View in source") [&#x24C9;][1]
Adds functions properties of `object` to the `lodash` function and chainable wrapper.
@@ -3216,7 +3224,7 @@ _('moe').capitalize();
<!-- div -->
### <a id="_noconflict"></a>`_.noConflict()`
<a href="#_noconflict">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4487 "View in source") [&#x24C9;][1]
<a href="#_noconflict">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4504 "View in source") [&#x24C9;][1]
Reverts the '_' variable to its previous value and returns a reference to the `lodash` function.
@@ -3236,7 +3244,7 @@ var lodash = _.noConflict();
<!-- div -->
### <a id="_randommin0-max1"></a>`_.random([min=0, max=1])`
<a href="#_randommin0-max1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4510 "View in source") [&#x24C9;][1]
<a href="#_randommin0-max1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4527 "View in source") [&#x24C9;][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.
@@ -3264,7 +3272,7 @@ _.random(5);
<!-- div -->
### <a id="_resultobject-property"></a>`_.result(object, property)`
<a href="#_resultobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4548 "View in source") [&#x24C9;][1]
<a href="#_resultobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4565 "View in source") [&#x24C9;][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.
@@ -3299,7 +3307,7 @@ _.result(object, 'stuff');
<!-- div -->
### <a id="_templatetext-data-options"></a>`_.template(text, data, options)`
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4636 "View in source") [&#x24C9;][1]
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4653 "View in source") [&#x24C9;][1]
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code.
@@ -3383,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> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4762 "View in source") [&#x24C9;][1]
<a href="#_timesn-callback--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4779 "View in source") [&#x24C9;][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)*.
@@ -3415,7 +3423,7 @@ _.times(3, function(n) { this.cast(n); }, mage);
<!-- div -->
### <a id="_unescapestring"></a>`_.unescape(string)`
<a href="#_unescapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4788 "View in source") [&#x24C9;][1]
<a href="#_unescapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4805 "View in source") [&#x24C9;][1]
The opposite of `_.escape`, this method converts the HTML entities `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their corresponding characters.
@@ -3439,7 +3447,7 @@ _.unescape('Moe, Larry &amp; Curly');
<!-- div -->
### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix])`
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4808 "View in source") [&#x24C9;][1]
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4825 "View in source") [&#x24C9;][1]
Generates a unique ID. If `prefix` is passed, the ID will be appended to it.
@@ -3492,7 +3500,7 @@ A reference to the `lodash` function.
<!-- div -->
### <a id="_version"></a>`_.VERSION`
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5038 "View in source") [&#x24C9;][1]
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5055 "View in source") [&#x24C9;][1]
*(String)*: The semantic version number.

View File

@@ -448,12 +448,20 @@
var assignIteratorOptions = {
'args': 'object, source, guard',
'top':
'var argsIndex = 0,\n' +
'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] = iterable[index]',
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]',
'bottom': ' }\n}'
};
@@ -1026,9 +1034,11 @@
/*--------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources will overwrite propery assignments of previous
* sources.
* 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).
*
* @static
* @memberOf _
@@ -1037,13 +1047,21 @@
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @param- {Object} [guard] Internally used to allow working with `_.reduce`
* without using its callback's `key and `object` arguments as sources.
* @param {Function} [callback] The function to customize assigning values.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the destination object.
* @example
*
* _.assign({ 'name': 'moe' }, { 'age': 40 });
* // => { 'name': 'moe', 'age': 40 }
*
* var defaults = _.partialRight(_.assign, function(a, b) {
* return typeof a == 'undefined' ? b : a;
* });
*
* var food = { 'name': 'apple' };
* defaults(food, { 'name': 'banana', 'type': 'fruit' });
* // => { 'name': 'apple', 'type': 'fruit' }
*/
var assign = createIterator(assignIteratorOptions);
@@ -1219,8 +1237,8 @@
}
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* object for all `destination` properties that resolve to `null`/`undefined`.
* 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.
*
@@ -1235,9 +1253,9 @@
* @returns {Object} Returns the destination object.
* @example
*
* var iceCream = { 'flavor': 'chocolate' };
* _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
* // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
* var food = { 'name': 'apple' };
* _.defaults(food, { 'name': 'banana', 'type': 'fruit' });
* // => { 'name': 'apple', 'type': 'fruit' }
*/
var defaults = createIterator(assignIteratorOptions, {
'loop': 'if (result[index] == null) ' + assignIteratorOptions.loop
@@ -1826,7 +1844,7 @@
/**
* Recursively merges own enumerable properties of the source object(s), that
* don't resolve to `undefined`, into the `destination` object. Subsequent sources
* 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
@@ -1892,8 +1910,7 @@
var callback = args[3],
stackA = args[4],
stackB = args[5];
}
else {
} else {
stackA = [];
stackB = [];
@@ -1901,6 +1918,8 @@
// using their `callback` arguments, `index|key` and `collection`
if (typeof deepIndicator != 'number') {
length = args.length;
}
if (length > 2) {
if (typeof args[length - 2] == 'function') {
callback = createCallback(args[--length - 1], args[length--], 2);
} else if (typeof args[length - 1] == 'function') {
@@ -4300,16 +4319,14 @@
* @returns {Function} Returns the new partially applied function.
* @example
*
* _.mixin({
* 'defaultsDeep': _.partialRight(_.merge, _.defaults)
* });
* var defaultsDeep = _.partialRight(_.merge, _.defaults);
*
* var options = {
* 'variable': 'data',
* 'imports': { 'jq': $ }
* };
*
* _.defaultsDeep(options, _.templateSettings);
* defaultsDeep(options, _.templateSettings);
*
* options.variable
* // => 'data'

View File

@@ -196,28 +196,6 @@
ok(false);
}
});
test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() {
function Foo() {}
Foo.prototype.c = 3;
Foo.a = 1;
Foo.b = 2;
var expected = { 'a': 1, 'b': 2 };
deepEqual(_.assign({}, Foo), expected);
Foo.prototype = { 'c': 3 };
deepEqual(_.assign({}, Foo), expected);
});
test('should work with `_.reduce`', function() {
var actual = { 'a': 1 },
array = [{ 'b': 2 }, { 'c': 3 }];
_.reduce(array, _.assign, actual);
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3 });
});
}());
/*--------------------------------------------------------------------------*/
@@ -858,7 +836,7 @@
/*--------------------------------------------------------------------------*/
QUnit.module('object iteration bugs');
QUnit.module('collection iteration bugs');
_.each(['forEach', 'forIn', 'forOwn'], function(methodName) {
var func = _[methodName];
@@ -888,6 +866,79 @@
/*--------------------------------------------------------------------------*/
QUnit.module('object assignments');
_.each(['assign', 'merge'], function(methodName) {
var func = _[methodName];
test('lodash.' + methodName + ' should merge problem JScript properties (test in IE < 9)', function() {
var object = {
'constructor': 1,
'hasOwnProperty': 2,
'isPrototypeOf': 3
};
var source = {
'propertyIsEnumerable': 4,
'toLocaleString': 5,
'toString': 6,
'valueOf': 7
};
deepEqual(func(object, source), shadowed);
});
test('lodash.' + methodName + ' skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() {
function Foo() {}
Foo.prototype.c = 3;
Foo.a = 1;
Foo.b = 2;
var expected = { 'a': 1, 'b': 2 };
deepEqual(func({}, Foo), expected);
Foo.prototype = { 'c': 3 };
deepEqual(func({}, Foo), expected);
});
test('lodash.' + methodName + ' should work with `_.reduce`', function() {
var actual = { 'a': 1},
array = [{ 'b': 2 }, { 'c': 3 }];
_.reduce(array, func, actual);
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3});
});
test('lodash.' + methodName + ' should pass the correct `callback` arguments', function() {
var args;
func({ 'a': 1 }, { 'a': 2 }, function() {
args || (args = slice.call(arguments));
});
deepEqual(args, [1, 2]);
});
test('lodash.' + methodName + ' should correct set the `this` binding', function() {
var actual = func({}, { 'a': 0 }, function(a, b) {
return this[b];
}, [2]);
deepEqual(actual, { 'a': 2 });
});
test('lodash.' + methodName + ' should not treat a function as a `callback` if less than two arguments are passed', function() {
function callback() {}
callback.b = 2;
var actual = func({ 'a': 1 }, callback);
deepEqual(actual, { 'a': 1, 'b': 2 });
});
});
/*--------------------------------------------------------------------------*/
QUnit.module('exit early');
_.each(['forEach', 'forIn', 'forOwn'], function(methodName) {
@@ -1552,23 +1603,6 @@
ok(actual.bar.b === actual.foo.b && actual.foo.b.foo.c === actual.foo.b.foo.c.foo.b.foo.c);
});
test('should merge problem JScript properties (test in IE < 9)', function() {
var object = {
'constructor': 1,
'hasOwnProperty': 2,
'isPrototypeOf': 3
};
var source = {
'propertyIsEnumerable': 4,
'toLocaleString': 5,
'toString': 6,
'valueOf': 7
};
deepEqual(_.merge(object, source), shadowed);
});
test('should not treat `arguments` objects as plain objects', function() {
var object = {
'args': args
@@ -1587,14 +1621,6 @@
deepEqual(_.merge({ 'a': 1 }, { 'a': 2 }, { 'a': 3 }, expected), expected);
});
test('should work with `_.reduce`', function() {
var actual = { 'a': 1},
array = [{ 'b': 2 }, { 'c': 3 }];
_.reduce(array, _.merge, actual);
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3});
});
test('should assign `null` values', function() {
var actual = _.merge({ 'a': 1 }, { 'a': null });
strictEqual(actual.a, null);
@@ -1606,24 +1632,6 @@
strictEqual(actual.a, 1);
});
test('should pass the correct `callback` arguments', function() {
var args;
_.merge({ 'a': 1 }, { 'a': 2 }, function() {
args || (args = slice.call(arguments));
});
deepEqual(args, [1, 2]);
});
test('should correct set the `this` binding', function() {
var actual = _.merge({}, { 'a': 0 }, function(a, b) {
return this[b];
}, [2]);
deepEqual(actual, { 'a': 2 });
});
test('should handle merging if `callback` returns `undefined`', function() {
var actual = _.merge({ 'a': 1 }, { 'a': 2 }, function() { });
deepEqual(actual, { 'a': 2 });