diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 71d0d9181..69e340062 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -2147,34 +2147,6 @@ /*--------------------------------------------------------------------------*/ - /** - * Checks if `value` is an `arguments` object. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(1, 2, 3); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == argsClass || false; - } - // fallback for environments that can't detect `arguments` objects by [[Class]] - if (!support.argsClass) { - isArguments = function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; - }; - } - /** * A fallback implementation of `Object.keys` which creates an array of the * own enumerable property names of `object`. @@ -5258,6 +5230,33 @@ return memoized; } + /** + * Creates a function that negates the result of `func`. The `func` function + * is executed with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to negate. + * @returns {Function} Returns the new function. + * @example + * + * function isEven(num) { + * return num % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(func) { + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + return !func.apply(this, arguments); + }; + } + /** * 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 @@ -7826,33 +7825,6 @@ } } - /** - * Creates a function that negates the result of `func`. The `func` function - * is executed with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Function} func The function to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(num) { - * return num % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(func) { - if (!isFunction(func)) { - throw new TypeError; - } - return function() { - return !func.apply(this, arguments); - }; - } - /** * Reverts the '_' variable to its previous value and returns a reference to * the `lodash` function. diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 0837edc8e..bae2060d7 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -6,63 +6,63 @@ ;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202a(e,l)&&f.push(l);return f}function st(n,t){var r=-1,e=n,u=n?n.length:0;if(typeof u=="number")for(be.unindexedChars&&pr(e)&&(e=e.split(""));++ra(e,l)&&f.push(l);return f}function st(n,t){var r=-1,e=n,u=n?n.length:0;if(typeof u=="number")for(be.unindexedChars&&hr(e)&&(e=e.split(""));++ri(s,h)&&((u||f)&&s.push(h),c.push(p))}return c}function Ct(n,t){for(var r=-1,e=t(n),u=e.length,o=kr(u);++rr&&(r=0),s&&(a=[]),p&&(i=[]),h=[n,t,r,e,u,o,a,i],t==w||t==(w|k)?f(h):X(h)) -}function At(){var n=(n=u.indexOf)===Lt?t:n;return n}function St(n){return typeof n=="function"&&Ur.test(Xr.call(n))}function It(n){var t,r;return!n||qr.call(n)!=ut||!Zr.call(n,"constructor")&&(t=n.constructor,lr(t)&&!(t instanceof t))||!be.argsClass&&Rt(n)||!be.nodeClass&&p(n)?false:be.ownLast?(gt(n,function(n,t,e){return r=Zr.call(e,t),false},hr),false!==r):(gt(n,function(n,t){r=t},hr),typeof r=="undefined"||Zr.call(n,r))}function Rt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&qr.call(n)==H||false -}function Nt(n){for(var t=-1,r=hr(n),e=r.length,u=[];++te?fe(0,u+e):e||0;else if(e)return e=Dt(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function Wt(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var o=e,a=0; -for(t=u.createCallback(t,r,3);o--&&t(n[o],o,n);)a++}else a=null==t||r?1:t;return a=e-a,$t(n,0,0t?t=fe(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=fe(u+r,0):r>u&&(r=u),u=r-t||0,r=kr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!Ee(n)&&pr(n))return ee?ee.call(n,t,r):-1r?fe(0,e+r):r)||0,-1a&&(a=l)}else t=null==t&&pr(n)?e:u.createCallback(t,r,3),st(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function Jt(n,t,r,e){var o=3>arguments.length;if(t=u.createCallback(t,e,4),Ee(n)){var a=-1,i=n.length;for(o&&i&&(r=n[++a]);++aarguments.length;return t=u.createCallback(t,e,4),pt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u) -}),r}function nr(n){var t=-1,r=n?n.length:0,e=kr(typeof r=="number"?r:0);return st(n,function(n){var r=wt(0,++t);e[t]=e[r],e[r]=n}),e}function tr(n,t,r){var e;if(t=u.createCallback(t,r,3),Ee(n)){r=-1;for(var o=n.length;++rarguments.length)return Et(n,w,null,t);if(n)var r=n[A]?n[A][2]:n.length,e=$t(arguments,2),r=r-e.length;return Et(n,w|k,r,t,e)}function er(n,t,r){var e,u,o,a,i,l,f,c=0,s=false,p=true; -if(!lr(n))throw new Wr;if(t=0=r||r>t?(u&&Mr(u),r=f,u=l=f=_,r&&(c=Fe(),o=n.apply(i,e),l||u||(e=i=null))):l=Qr(g,r)},v=function(){l&&Mr(l),u=l=f=_,(p||s!==t)&&(c=Fe(),o=n.apply(i,e),l||u||(e=i=null))};return function(){if(e=arguments,a=Fe(),i=this,f=p&&(l||!h),false===s)var r=h&&!l;else{u||h||(c=a);var y=s-(a-c),m=0>=y||y>s;m?(u&&(u=Mr(u)),c=a,o=n.apply(i,e)):u||(u=Qr(v,y)) -}return m&&l?l=Mr(l):l||t===s||(l=Qr(g,t)),r&&(m=true,o=n.apply(i,e)),!m||l||u||(e=i=null),o}}function ur(n,t,r){if(!n)return n;var e=arguments,u=0,o=e.length,a=typeof r;if("number"!=a&&"string"!=a||!e[3]||e[3][r]!==t||(o=2),3t||null==n)return r;n=Lr(n);do t%2&&(r+=n),t=Vr(t/2),n+=n;while(0r&&(r=0),s&&(a=[]),p&&(i=[]),h=[n,t,r,e,u,o,a,i],t==w||t==(w|k)?f(h):X(h)) +}function At(){var n=(n=u.indexOf)===Tt?t:n;return n}function St(n){return typeof n=="function"&&Ur.test(Xr.call(n))}function It(n){var t,r;return!n||qr.call(n)!=ut||!Zr.call(n,"constructor")&&(t=n.constructor,fr(t)&&!(t instanceof t))||!be.argsClass&&ir(n)||!be.nodeClass&&p(n)?false:be.ownLast?(gt(n,function(n,t,e){return r=Zr.call(e,t),false},gr),false!==r):(gt(n,function(n,t){r=t},gr),typeof r=="undefined"||Zr.call(n,r))}function Rt(n){for(var t=-1,r=gr(n),e=r.length,u=[];++te?fe(0,u+e):e||0;else if(e)return e=$t(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function Lt(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var o=e,a=0;for(t=u.createCallback(t,r,3);o--&&t(n[o],o,n);)a++}else a=null==t||r?1:t; +return a=e-a,Pt(n,0,0t?t=fe(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=fe(u+r,0):r>u&&(r=u),u=r-t||0,r=kr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!Ee(n)&&hr(n))return ee?ee.call(n,t,r):-1r?fe(0,e+r):r)||0,-1a&&(a=l)}else t=null==t&&hr(n)?e:u.createCallback(t,r,3),st(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function Ht(n,t,r,e){var o=3>arguments.length;if(t=u.createCallback(t,e,4),Ee(n)){var a=-1,i=n.length;for(o&&i&&(r=n[++a]);++aarguments.length;return t=u.createCallback(t,e,4),pt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Qt(n){var t=-1,r=n?n.length:0,e=kr(typeof r=="number"?r:0); +return st(n,function(n){var r=wt(0,++t);e[t]=e[r],e[r]=n}),e}function nr(n,t,r){var e;if(t=u.createCallback(t,r,3),Ee(n)){r=-1;for(var o=n.length;++rarguments.length)return Et(n,w,null,t);if(n)var r=n[A]?n[A][2]:n.length,e=Pt(arguments,2),r=r-e.length;return Et(n,w|k,r,t,e)}function rr(n,t,r){var e,u,o,a,i,l,f,c=0,s=false,p=true;if(!fr(n))throw new Wr;if(t=0=r||r>t?(u&&Mr(u),r=f,u=l=f=_,r&&(c=Fe(),o=n.apply(i,e),l||u||(e=i=null))):l=Qr(g,r)},v=function(){l&&Mr(l),u=l=f=_,(p||s!==t)&&(c=Fe(),o=n.apply(i,e),l||u||(e=i=null))};return function(){if(e=arguments,a=Fe(),i=this,f=p&&(l||!h),false===s)var r=h&&!l;else{u||h||(c=a);var y=s-(a-c),m=0>=y||y>s;m?(u&&(u=Mr(u)),c=a,o=n.apply(i,e)):u||(u=Qr(v,y))}return m&&l?l=Mr(l):l||t===s||(l=Qr(g,t)),r&&(m=true,o=n.apply(i,e)),!m||l||u||(e=i=null),o}}function er(n){if(!fr(n))throw new Wr; +return function(){return!n.apply(this,arguments)}}function ur(n,t,r){if(!n)return n;var e=arguments,u=0,o=e.length,a=typeof r;if("number"!=a&&"string"!=a||!e[3]||e[3][r]!==t||(o=2),3t||null==n)return r;n=Lr(n);do t%2&&(r+=n),t=Vr(t/2),n+=n;while(0--n?t.apply(this,arguments):void 0}},u.assign=ur,u.at=function(n,t){var r=arguments,e=-1,u=ht(r,true,false,1),o=u.length,a=typeof t; -for("number"!=a&&"string"!=a||!r[2]||r[2][t]!==n||(o=1),be.unindexedChars&&pr(n)&&(n=n.split("")),r=kr(o);++earguments.length?Et(t,w|x,null,n):Et(t,w|x|k,null,n,$t(arguments,2))},u.chain=function(n){return n=new o(n),n.__chain__=true,n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t(h?r(h,c):i(f,c))){for(u=o,(h||f).push(c);--u;)if(h=a[u],0>(h?r(h,c):i(e[u],c)))continue n;p.push(c)}}return p},u.invert=function(n,t){for(var r=-1,e=Se(n),u=e.length,o={};++rr?fe(0,e+r):ce(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=wr,u.noConflict=function(){return n._=Br,this +try{be.dom=11===zr.createDocumentFragment().nodeType}catch(o){be.dom=false}try{be.nodeClass=!(qr.call(undefined)==ut&&!({toString:0}+""))}catch(a){be.nodeClass=true}}(1),u.templateSettings={escape:W,evaluate:F,interpolate:P,variable:"",imports:{_:u}},ue||(m=function(){function t(){}return function(r){if(cr(r)){t.prototype=r;var e=new t;t.prototype=null}return e||n.Object()}}());var _e=Jr&&function(n){var t=new Jr,r=n?n.length:0;for(t.push=t.add;r--;)t.push(n[r]);return t},we=re?function(n,t){ft.value=t,re(n,A,ft)}:Cr,xe=kt(function(n,t,r){Zr.call(n,r)?n[r]++:n[r]=1 +}),Ce=kt(function(n,t,r){Zr.call(n,r)?n[r].push(t):n[r]=[t]}),je=kt(function(n,t,r){n[r]=t}),ke=kt(function(n,t,r){n[r?0:1].push(t)},true),Oe=Zt;be.argsClass||(ir=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Zr.call(n,"callee")&&!Hr.call(n,"callee")||false});var Ee=oe||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&qr.call(n)==J||false};be.dom||(lr=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!Ae(n)||false}),fr(/x/)&&(fr=function(n){return typeof n=="function"&&qr.call(n)==rt +});var Ae=Yr?function(n){if(!n||qr.call(n)!=ut||!be.argsClass&&ir(n))return false;var t=n.valueOf,r=St(t)&&(r=Yr(t))&&Yr(r);return r?n==r||Yr(n)==r:It(n)}:It,Se=le?function(n){return be.enumPrototypes&&typeof n=="function"||be.nonEnumArgs&&n&&n.length&&ir(n)?Rt(n):cr(n)?le(n):[]}:Rt,Ie=l(function(n,t,r){return n+t.charAt(0)[r?"toUpperCase":"toLowerCase"]()+t.slice(1)}),Re=l(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Ne=l(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Te=ge?function(n,t){return null==n?"":null==t?ge.call(n):h(n,t) +}:h,Le=ve?function(n,t){return null==n?"":null==t?ve.call(n):g(n,t)}:g,We=ye?function(n,t){return null==n?"":null==t?ye.call(n):v(n,t)}:v,Fe=se||function(){return(new Er).getTime()},Pe=8==pe(Y+"08")?pe:function(n,t){return n=Te(n),pe(n,+t||(B.test(n)?16:10))};return u.after=function(n,t){if(!fr(t))throw new Wr;return function(){return 1>--n?t.apply(this,arguments):void 0}},u.assign=ur,u.at=function(n,t){var r=arguments,e=-1,u=ht(r,true,false,1),o=u.length,a=typeof t;for("number"!=a&&"string"!=a||!r[2]||r[2][t]!==n||(o=1),be.unindexedChars&&hr(n)&&(n=n.split("")),r=kr(o);++earguments.length?Et(t,w|x,null,n):Et(t,w|x|k,null,n,Pt(arguments,2))},u.chain=function(n){return n=new o(n),n.__chain__=true,n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t(h?r(h,c):i(f,c))){for(u=o,(h||f).push(c);--u;)if(h=a[u],0>(h?r(h,c):i(e[u],c)))continue n; +p.push(c)}}return p},u.invert=function(n,t){for(var r=-1,e=Se(n),u=e.length,o={};++rr?fe(0,e+r):ce(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=xr,u.noConflict=function(){return n._=Br,this },u.noop=Cr,u.now=Fe,u.pad=function(n,t,r){n=null==n?"":Lr(n),t=+t||0;var e=n.length;return en.length)return n;var o=r-e.length;if(1>o)return e;if(r=n.slice(0,o),null==u)return r+e;if(sr(u)){if(n.slice(o).search(u)){var a,i,l=n.slice(0,o);for(u.global||(u=Tr(u.source,(D.exec(u)||"")+"g")),u.lastIndex=0;a=u.exec(l);)i=a.index; -r=r.slice(0,null==i?o:i)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(T,d))},u.uniqueId=function(n){var t=++S;return Lr(null==n?"":n)+t},u.all=Mt,u.any=tr,u.detect=Xt,u.findWhere=Xt,u.foldl=Jt,u.foldr=Qt,u.include=Kt,u.inject=Jt,wr(function(){var n={};return mt(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),false),u.first=Tt,u.last=Ft,u.sample=function(n,t,r){return n&&typeof n.length!="number"?n=vr(n):be.unindexedChars&&pr(n)&&(n=n.split("")),null==t||r?n?n[wt(0,n.length-1)]:_:(n=nr(n),n.length=ce(fe(0,t),n.length),n) -},u.take=Tt,u.takeRight=Ft,u.takeRightWhile=Ft,u.takeWhile=Tt,u.head=Tt,mt(u,function(n,t){var r="sample"!==t;u.prototype[t]||(u.prototype[t]=function(t,e){var u=this.__chain__,a=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new o(a,u):a})}),u.VERSION=E,u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.toString=function(){return Lr(this.__wrapped__)},u.prototype.value=Ut,u.prototype.valueOf=Ut,st(["join","pop","shift"],function(n){var t=Fr[n];u.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments); +}catch(h){throw h.source=c,h}return t?p(t):(p.source=c,p)},u.trim=Te,u.trimLeft=Le,u.trimRight=We,u.truncate=function(n,t){var r=30,e="...";if(t&&cr(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?Lr(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":Lr(n),r>n.length)return n;var o=r-e.length;if(1>o)return e;if(r=n.slice(0,o),null==u)return r+e;if(pr(u)){if(n.slice(o).search(u)){var a,i,l=n.slice(0,o);for(u.global||(u=Tr(u.source,(D.exec(u)||"")+"g")),u.lastIndex=0;a=u.exec(l);)i=a.index; +r=r.slice(0,null==i?o:i)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(T,d))},u.uniqueId=function(n){var t=++S;return Lr(null==n?"":n)+t},u.all=Kt,u.any=nr,u.detect=Vt,u.findWhere=Vt,u.foldl=Ht,u.foldr=Jt,u.include=Ut,u.inject=Ht,xr(function(){var n={};return mt(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),false),u.first=Nt,u.last=Wt,u.sample=function(n,t,r){return n&&typeof n.length!="number"?n=yr(n):be.unindexedChars&&hr(n)&&(n=n.split("")),null==t||r?n?n[wt(0,n.length-1)]:_:(n=Qt(n),n.length=ce(fe(0,t),n.length),n) +},u.take=Nt,u.takeRight=Wt,u.takeRightWhile=Wt,u.takeWhile=Nt,u.head=Nt,mt(u,function(n,t){var r="sample"!==t;u.prototype[t]||(u.prototype[t]=function(t,e){var u=this.__chain__,a=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new o(a,u):a})}),u.VERSION=E,u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.toString=function(){return Lr(this.__wrapped__)},u.prototype.value=qt,u.prototype.valueOf=qt,st(["join","pop","shift"],function(n){var t=Fr[n];u.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments); return n?new o(r,n):r}}),st(["push","reverse","sort","unshift"],function(n){var t=Fr[n];u.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),st(["concat","splice"],function(n){var t=Fr[n];u.prototype[n]=function(){return new o(t.apply(this.__wrapped__,arguments),this.__chain__)}}),be.spliceObjects||st(["pop","shift","splice"],function(n){var t=Fr[n],r="splice"==n;u.prototype[n]=function(){var n=this.__chain__,e=this.__wrapped__,u=t.apply(e,arguments);return 0===e.length&&delete e[0],n||r?new o(u,n):u }}),u}var _,w=1,x=2,C=4,j=8,k=16,O=32,E="2.4.1",A="__lodash@"+E+"__",S=0,I=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,N=/(__e\(.*?\)|\b__t\))\+'';/g,T=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,W=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,P=/<%=([\s\S]+?)%>/g,$=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,D=/\w*$/,z=/^\s*function[ \n\r\t]+\w/,B=/^0[xX]/,q=/[\xC0-\xFF]/g,U=/($^)/,K=/[.*+?^${}()|[\]\\]/g,M=/\bthis\b/,V=/['\n\r\t\u2028\u2029\\]/g,X=/[a-zA-Z0-9][a-z0-9]*/g,Y=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",Z="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),G="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),H="[object Arguments]",J="[object Array]",Q="[object Boolean]",nt="[object Date]",tt="[object Error]",rt="[object Function]",et="[object Number]",ut="[object Object]",ot="[object RegExp]",at="[object String]",it={}; it[rt]=false,it[H]=it[J]=it[Q]=it[nt]=it[et]=it[ut]=it[ot]=it[at]=true;var lt={leading:false,maxWait:0,trailing:false},ft={configurable:false,enumerable:false,value:null,writable:false},ct={"&":"&","<":"<",">":">",'"':""","'":"'"},st={"&":"&","<":"<",">":">",""":'"',"'":"'"},pt={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":"","\xf7":""},ht={"function":true,object:true},gt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},vt=ht[typeof window]&&window||this,yt=ht[typeof exports]&&exports&&!exports.nodeType&&exports,ht=ht[typeof module]&&module&&!module.nodeType&&module,mt=yt&&ht&&typeof global=="object"&&global; diff --git a/dist/lodash.js b/dist/lodash.js index b70fed6a2..323b61ab8 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -599,7 +599,6 @@ getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, hasOwnProperty = objectProto.hasOwnProperty, push = arrayRef.push, - propertyIsEnumerable = objectProto.propertyIsEnumerable, Set = isNative(Set = context.Set) && Set, setTimeout = context.setTimeout, splice = arrayRef.splice, @@ -1973,27 +1972,6 @@ /*--------------------------------------------------------------------------*/ - /** - * Checks if `value` is an `arguments` object. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(1, 2, 3); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == argsClass || false; - } - /** * A fallback implementation of `Object.keys` which creates an array of the * own enumerable property names of `object`. @@ -5074,6 +5052,33 @@ return memoized; } + /** + * Creates a function that negates the result of `func`. The `func` function + * is executed with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to negate. + * @returns {Function} Returns the new function. + * @example + * + * function isEven(num) { + * return num % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(func) { + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + return !func.apply(this, arguments); + }; + } + /** * 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 @@ -5847,13 +5852,6 @@ return value && typeof value == 'object' && typeof value.length == 'number' && toString.call(value) == argsClass || false; } - // fallback for environments that can't detect `arguments` objects by [[Class]] - if (!support.argsClass) { - isArguments = function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; - }; - } /** * Checks if `value` is an array. @@ -7600,33 +7598,6 @@ } } - /** - * Creates a function that negates the result of `func`. The `func` function - * is executed with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Function} func The function to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(num) { - * return num % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(func) { - if (!isFunction(func)) { - throw new TypeError; - } - return function() { - return !func.apply(this, arguments); - }; - } - /** * Reverts the '_' variable to its previous value and returns a reference to * the `lodash` function. diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 72f480934..c5949577e 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -5,60 +5,60 @@ */ ;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202i(e,f)&&l.push(f);return l}function ft(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(;++ra(p,h)&&((u||l)&&p.push(h),c.push(s))}return c}function _t(n,t){for(var r=-1,e=t(n),u=e.length,o=jr(u);++rr&&(r=0),p&&(i=[]),s&&(a=[]),h=[n,t,r,e,u,o,i,a],t==_||t==(_|k)?l(h):V(h)) -}function Ct(){var n=(n=u.indexOf)===Nt?t:n;return n}function Ot(n){return typeof n=="function"&&Lr.test(Ur.call(n))}function At(n){var t,r;return n&&Dr.call(n)==tt&&(Kr.call(n,"constructor")||(t=n.constructor,!or(t)||t instanceof t))?(pt(n,function(n,t){r=t},cr),typeof r=="undefined"||Kr.call(n,r)):false}function It(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Dr.call(n)==Z||false}function Et(n){for(var t=-1,r=cr(n),e=r.length,u=[];++te?ue(0,u+e):e||0;else if(e)return e=$t(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function St(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var o=e,i=0;for(t=u.createCallback(t,r,3);o--&&t(n[o],o,n);)i++}else i=null==t||r?1:t;return i=e-i,Ft(n,0,0t?t=ue(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=ue(u+r,0):r>u&&(r=u),u=r-t||0,r=jr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!je(n)&&lr(n))return Jr?Jr.call(n,t,r):-1r?ue(0,e+r):r)||0,-1i&&(i=f)}else t=null==t&&lr(n)?e:u.createCallback(t,r,3),ft(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,i=n)});return i}function Zt(n,t,r,e){var o=3>arguments.length;t=u.createCallback(t,e,4);var i=-1,a=n?n.length:0;if(typeof a=="number")for(o&&a&&(r=n[++i]);++iarguments.length;return t=u.createCallback(t,e,4),lt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Ht(n){var t=-1,r=n?n.length:0,e=jr(typeof r=="number"?r:0); -return ft(n,function(n){var r=bt(0,++t);e[t]=e[r],e[r]=n}),e}function Jt(n,t,r){var e;t=u.createCallback(t,r,3),r=-1;var o=n?n.length:0;if(typeof o=="number"){for(;++rarguments.length)return kt(n,_,null,t);if(n)var r=n[A]?n[A][2]:n.length,e=Ft(arguments,2),r=r-e.length;return kt(n,_|k,r,t,e)}function nr(n,t,r){var e,u,o,i,a,f,l,c=0,p=false,s=true;if(!or(n))throw new Nr;if(t=0=r||r>t?(u&&Br(u),r=l,u=f=l=d,r&&(c=Ne(),o=n.apply(a,e),f||u||(e=a=null))):f=Yr(g,r)},v=function(){f&&Br(f),u=f=l=d,(s||p!==t)&&(c=Ne(),o=n.apply(a,e),f||u||(e=a=null))};return function(){if(e=arguments,i=Ne(),a=this,l=s&&(f||!h),false===p)var r=h&&!f;else{u||h||(c=i);var y=p-(i-c),m=0>=y||y>p;m?(u&&(u=Br(u)),c=i,o=n.apply(a,e)):u||(u=Yr(v,y))}return m&&f?f=Br(f):f||t===p||(f=Yr(g,t)),r&&(m=true,o=n.apply(a,e)),!m||f||u||(e=a=null),o -}}function tr(n,t,r){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof r;if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3t||null==n)return r;n=Rr(n);do t%2&&(r+=n),t=qr(t/2),n+=n;while(0--n?t.apply(this,arguments):void 0}},u.assign=tr,u.at=function(n,t){var r=arguments,e=-1,u=ct(r,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),r=jr(o);++earguments.length?kt(t,_|w,null,n):kt(t,_|w|k,null,n,Ft(arguments,2)) -},u.chain=function(n){return n=new o(n),n.__chain__=true,n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t(h?r(h,c):a(l,c))){for(u=o,(h||l).push(c);--u;)if(h=i[u],0>(h?r(h,c):a(e[u],c)))continue n;s.push(c)}}return s},u.invert=function(n,t){for(var r=-1,e=ke(n),u=e.length,o={};++rr?ue(0,e+r):oe(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=br,u.noConflict=function(){return n._=$r,this},u.noop=_r,u.now=Ne,u.pad=function(n,t,r){n=null==n?"":Rr(n),t=+t||0; -var e=n.length;return en.length)return n;var o=r-e.length;if(1>o)return e;if(r=n.slice(0,o),null==u)return r+e;if(fr(u)){if(n.slice(o).search(u)){var i,a,f=n.slice(0,o);for(u.global||(u=Er(u.source,(L.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(f);)a=i.index; -r=r.slice(0,null==a?o:a)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(S,m))},u.uniqueId=function(n){var t=++I;return Rr(null==n?"":n)+t},u.all=Ut,u.any=Jt,u.detect=Kt,u.findWhere=Kt,u.foldl=Zt,u.foldr=Gt,u.include=qt,u.inject=Zt,br(function(){var n={};return gt(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),false),u.first=Rt,u.last=Tt,u.sample=function(n,t,r){return n&&typeof n.length!="number"&&(n=sr(n)),null==t||r?n?n[bt(0,n.length-1)]:d:(n=Ht(n),n.length=oe(ue(0,t),n.length),n) -},u.take=Rt,u.takeRight=Tt,u.takeRightWhile=Tt,u.takeWhile=Rt,u.head=Rt,gt(u,function(n,t){var r="sample"!==t;u.prototype[t]||(u.prototype[t]=function(t,e){var u=this.__chain__,i=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new o(i,u):i})}),u.VERSION=O,u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.toString=function(){return Rr(this.__wrapped__)},u.prototype.value=Bt,u.prototype.valueOf=Bt,ft(["join","pop","shift"],function(n){var t=Sr[n];u.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments); -return n?new o(r,n):r}}),ft(["push","reverse","sort","unshift"],function(n){var t=Sr[n];u.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),ft(["concat","splice"],function(n){var t=Sr[n];u.prototype[n]=function(){return new o(t.apply(this.__wrapped__,arguments),this.__chain__)}}),u}var d,_=1,w=2,j=4,x=8,k=16,C=32,O="2.4.1",A="__lodash@"+O+"__",I=0,E=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,N=/(__e\(.*?\)|\b__t\))\+'';/g,S=/&(?:amp|lt|gt|quot|#39);/g,T=/[&<>"']/g,W=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,D=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,L=/\w*$/,z=/^\s*function[ \n\r\t]+\w/,B=/^0[xX]/,q=/[\xC0-\xFF]/g,U=/($^)/,P=/[.*+?^${}()|[\]\\]/g,K=/\bthis\b/,M=/['\n\r\t\u2028\u2029\\]/g,V=/[a-zA-Z0-9][a-z0-9]*/g,X=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",Y="Array Boolean Date Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Z="[object Arguments]",G="[object Array]",H="[object Boolean]",J="[object Date]",Q="[object Function]",nt="[object Number]",tt="[object Object]",rt="[object RegExp]",et="[object String]",ut={}; +}function v(n){for(var t=-1,r=n.length;++te||13e||8202r||13r||8202i(e,f)&&l.push(f);return l}function ft(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(;++ra(p,h)&&((u||l)&&p.push(h),c.push(s))}return c}function _t(n,t){for(var r=-1,e=t(n),u=e.length,o=xr(u);++rr&&(r=0),p&&(i=[]),s&&(a=[]),h=[n,t,r,e,u,o,i,a],t==_||t==(_|j)?l(h):V(h)) +}function Ct(){var n=(n=u.indexOf)===Rt?t:n;return n}function Ot(n){return typeof n=="function"&&Lr.test(Ur.call(n))}function At(n){var t,r;return n&&Dr.call(n)==tt&&(Kr.call(n,"constructor")||(t=n.constructor,!ir(t)||t instanceof t))?(pt(n,function(n,t){r=t},pr),typeof r=="undefined"||Kr.call(n,r)):false}function It(n){for(var t=-1,r=pr(n),e=r.length,u=[];++te?ee(0,u+e):e||0;else if(e)return e=Ft(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function Nt(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var o=e,i=0;for(t=u.createCallback(t,r,3);o--&&t(n[o],o,n);)i++}else i=null==t||r?1:t;return i=e-i,Wt(n,0,0t?t=ee(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=ee(u+r,0):r>u&&(r=u),u=r-t||0,r=xr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!we(n)&&cr(n))return Hr?Hr.call(n,t,r):-1r?ee(0,e+r):r)||0,-1i&&(i=f) +}else t=null==t&&cr(n)?e:u.createCallback(t,r,3),ft(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,i=n)});return i}function Yt(n,t,r,e){var o=3>arguments.length;t=u.createCallback(t,e,4);var i=-1,a=n?n.length:0;if(typeof a=="number")for(o&&a&&(r=n[++i]);++iarguments.length;return t=u.createCallback(t,e,4),lt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Gt(n){var t=-1,r=n?n.length:0,e=xr(typeof r=="number"?r:0); +return ft(n,function(n){var r=dt(0,++t);e[t]=e[r],e[r]=n}),e}function Ht(n,t,r){var e;t=u.createCallback(t,r,3),r=-1;var o=n?n.length:0;if(typeof o=="number"){for(;++rarguments.length)return jt(n,_,null,t);if(n)var r=n[A]?n[A][2]:n.length,e=Wt(arguments,2),r=r-e.length;return jt(n,_|j,r,t,e)}function Qt(n,t,r){var e,u,o,i,a,f,l,c=0,p=false,s=true;if(!ir(n))throw new Nr;if(t=0=r||r>t?(u&&Br(u),r=l,u=f=l=b,r&&(c=Re(),o=n.apply(a,e),f||u||(e=a=null))):f=Xr(g,r)},v=function(){f&&Br(f),u=f=l=b,(s||p!==t)&&(c=Re(),o=n.apply(a,e),f||u||(e=a=null))};return function(){if(e=arguments,i=Re(),a=this,l=s&&(f||!h),false===p)var r=h&&!f;else{u||h||(c=i);var y=p-(i-c),m=0>=y||y>p;m?(u&&(u=Br(u)),c=i,o=n.apply(a,e)):u||(u=Xr(v,y))}return m&&f?f=Br(f):f||t===p||(f=Xr(g,t)),r&&(m=true,o=n.apply(a,e)),!m||f||u||(e=a=null),o +}}function nr(n){if(!ir(n))throw new Nr;return function(){return!n.apply(this,arguments)}}function tr(n,t,r){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof r;if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3t||null==n)return r;n=Rr(n);do t%2&&(r+=n),t=qr(t/2),n+=n;while(0--n?t.apply(this,arguments):void 0 +}},u.assign=tr,u.at=function(n,t){var r=arguments,e=-1,u=ct(r,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),r=xr(o);++earguments.length?jt(t,_|w,null,n):jt(t,_|w|j,null,n,Wt(arguments,2))},u.chain=function(n){return n=new o(n),n.__chain__=true,n +},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t(h?r(h,c):a(l,c))){for(u=o,(h||l).push(c);--u;)if(h=i[u],0>(h?r(h,c):a(e[u],c)))continue n;s.push(c)}}return s},u.invert=function(n,t){for(var r=-1,e=ke(n),u=e.length,o={};++rr?ee(0,e+r):ue(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=br,u.noConflict=function(){return n._=$r,this},u.noop=_r,u.now=Re,u.pad=function(n,t,r){n=null==n?"":Rr(n),t=+t||0; +var e=n.length;return en.length)return n;var o=r-e.length;if(1>o)return e;if(r=n.slice(0,o),null==u)return r+e;if(lr(u)){if(n.slice(o).search(u)){var i,a,f=n.slice(0,o);for(u.global||(u=Er(u.source,(L.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(f);)a=i.index; +r=r.slice(0,null==a?o:a)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(S,m))},u.uniqueId=function(n){var t=++I;return Rr(null==n?"":n)+t},u.all=qt,u.any=Ht,u.detect=Pt,u.findWhere=Pt,u.foldl=Yt,u.foldr=Zt,u.include=Bt,u.inject=Yt,br(function(){var n={};return gt(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),false),u.first=Et,u.last=St,u.sample=function(n,t,r){return n&&typeof n.length!="number"&&(n=hr(n)),null==t||r?n?n[dt(0,n.length-1)]:b:(n=Gt(n),n.length=ue(ee(0,t),n.length),n) +},u.take=Et,u.takeRight=St,u.takeRightWhile=St,u.takeWhile=Et,u.head=Et,gt(u,function(n,t){var r="sample"!==t;u.prototype[t]||(u.prototype[t]=function(t,e){var u=this.__chain__,i=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new o(i,u):i})}),u.VERSION=O,u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.toString=function(){return Rr(this.__wrapped__)},u.prototype.value=zt,u.prototype.valueOf=zt,ft(["join","pop","shift"],function(n){var t=Sr[n];u.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments); +return n?new o(r,n):r}}),ft(["push","reverse","sort","unshift"],function(n){var t=Sr[n];u.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),ft(["concat","splice"],function(n){var t=Sr[n];u.prototype[n]=function(){return new o(t.apply(this.__wrapped__,arguments),this.__chain__)}}),u}var b,_=1,w=2,x=4,k=8,j=16,C=32,O="2.4.1",A="__lodash@"+O+"__",I=0,E=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,N=/(__e\(.*?\)|\b__t\))\+'';/g,S=/&(?:amp|lt|gt|quot|#39);/g,T=/[&<>"']/g,W=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,D=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,L=/\w*$/,z=/^\s*function[ \n\r\t]+\w/,B=/^0[xX]/,q=/[\xC0-\xFF]/g,U=/($^)/,P=/[.*+?^${}()|[\]\\]/g,K=/\bthis\b/,M=/['\n\r\t\u2028\u2029\\]/g,V=/[a-zA-Z0-9][a-z0-9]*/g,X=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",Y="Array Boolean Date Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Z="[object Arguments]",G="[object Array]",H="[object Boolean]",J="[object Date]",Q="[object Function]",nt="[object Number]",tt="[object Object]",rt="[object RegExp]",et="[object String]",ut={}; ut[Q]=false,ut[Z]=ut[G]=ut[H]=ut[J]=ut[nt]=ut[tt]=ut[rt]=ut[et]=true;var ot={leading:false,maxWait:0,trailing:false},it={configurable:false,enumerable:false,value:null,writable:false},at={"&":"&","<":"<",">":">",'"':""","'":"'"},ft={"&":"&","<":"<",">":">",""":'"',"'":"'"},lt={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":"","\xf7":""},ct={"function":true,object:true},pt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},st=ct[typeof window]&&window||this,ht=ct[typeof exports]&&exports&&!exports.nodeType&&exports,ct=ct[typeof module]&&module&&!module.nodeType&&module,gt=ht&&ct&&typeof global=="object"&&global; -!gt||gt.global!==gt&>.window!==gt&>.self!==gt||(st=gt);var gt=ct&&ct.exports===ht&&ht,vt=b();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(st._=vt, define(function(){return vt})):ht&&ct?gt?(ct.exports=vt)._=vt:ht._=vt:st._=vt}).call(this); \ No newline at end of file +!gt||gt.global!==gt&>.window!==gt&>.self!==gt||(st=gt);var gt=ct&&ct.exports===ht&&ht,vt=d();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(st._=vt, define(function(){return vt})):ht&&ct?gt?(ct.exports=vt)._=vt:ht._=vt:st._=vt}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 04347b7ba..5a8db0b31 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -1083,34 +1083,6 @@ /*--------------------------------------------------------------------------*/ - /** - * Checks if `value` is an `arguments` object. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(1, 2, 3); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == argsClass || false; - } - // fallback for environments that can't detect `arguments` objects by [[Class]] - if (!isArguments(arguments)) { - isArguments = function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; - }; - } - /** * A fallback implementation of `Object.keys` which creates an array of the * own enumerable property names of `object`. @@ -1370,6 +1342,7 @@ args.push(value); } } + argsLength = args.length var array = args[0], index = -1, indexOf = getIndexOf(), @@ -3436,6 +3409,33 @@ }; } + /** + * Creates a function that negates the result of `func`. The `func` function + * is executed with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to negate. + * @returns {Function} Returns the new function. + * @example + * + * function isEven(num) { + * return num % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(func) { + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + return !func.apply(this, arguments); + }; + } + /** * 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 @@ -3822,7 +3822,7 @@ toString.call(value) == argsClass || false; } // fallback for environments that can't detect `arguments` objects by [[Class]] - if (!support.argsClass) { + if (!isArguments(arguments)) { isArguments = function(value) { return value && typeof value == 'object' && typeof value.length == 'number' && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; @@ -4774,33 +4774,6 @@ } } - /** - * Creates a function that negates the result of `func`. The `func` function - * is executed with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Function} func The function to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(num) { - * return num % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(func) { - if (!isFunction(func)) { - throw new TypeError; - } - return function() { - return !func.apply(this, arguments); - }; - } - /** * Reverts the '_' variable to its previous value and returns a reference to * the `lodash` function. diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index f51c1a28b..9d8279971 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -3,38 +3,37 @@ * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.6.0 underscorejs.org/LICENSE * Build: `lodash underscore -o ./dist/lodash.underscore.js` */ -;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++te||typeof t=="undefined"){t=1;break n}if(tu(r,i)&&o.push(i)}return o}function p(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number")for(;++te||typeof t=="undefined"){t=1;break n}if(tu(r,i)&&o.push(i)}return o}function p(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number")for(;++to(f,c)&&(t&&f.push(c),i.push(a))}return i}function b(n,r){return function(t,e,u){var o=r?[[],[]]:{}; -e=Z(e,u,3),u=-1;var i=t?t.length:0;if(typeof i=="number")for(;++ue?Lr(0,u+e):e||0;else if(e)return e=S(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function E(n,r,t){return O(n,null==r||t?1:0r?r=Lr(u+r,0):r>u&&(r=u),typeof t=="undefined"?t=u:0>t?t=Lr(u+t,0):t>u&&(t=u),u=t-r||0,t=Array(u);++e>>1,t(n[e])u&&(u=t);else r=Z(r,t,3),p(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function M(n,r,t,e){var u=3>arguments.length;r=Z(r,e,4);var o=-1,i=n?n.length:0; -if(typeof i=="number")for(u&&i&&(t=n[++o]);++oarguments.length;return r=Z(r,e,4),s(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function W(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return p(n,function(n){var t;t=++r,t=0+Dr(Yr()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function z(n,r,t){var e;r=Z(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number"){for(;++targuments.length?_(n,ir,r):_(n,ir|fr,r,O(arguments,2))}function P(n,r,t){function e(){l&&clearTimeout(l),i=l=p=or,(h||g!==r)&&(s=ct(),f=n.apply(c,o),l||i||(o=c=null))}function u(){var t=r-(ct()-a);0>=t||t>r?(i&&clearTimeout(i),t=p,i=l=p=or,t&&(s=ct(),f=n.apply(c,o),l||i||(o=c=null))):l=setTimeout(u,t)}var o,i,f,a,c,l,p,s=0,g=false,h=true;if(!H(n))throw new TypeError;if(r=0=y||y>g;m?(i&&(i=clearTimeout(i)),s=a,f=n.apply(c,o)):i||(i=setTimeout(e,y))}return m&&l?l=clearTimeout(l):l||r===g||(l=setTimeout(u,r)),t&&(m=true,f=n.apply(c,o)),!m||l||i||(o=c=null),f}}function U(n,r,t){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof t;for("number"!=i&&"string"!=i||!e[3]||e[3][t]!==r||(o=2);++u"']/g,sr=/($^)/,gr=/[.*+?^${}()|[\]\\]/g,hr=/['\n\r\t\u2028\u2029\\]/g,vr="[object Arguments]",yr="[object Array]",mr="[object Boolean]",br="[object Date]",_r="[object Number]",dr="[object Object]",wr="[object RegExp]",jr="[object String]",xr={"&":"&","<":"<",">":">",'"':""","'":"'"},Ar={"&":"&","<":"<",">":">",""":'"',"'":"'"},Tr={"function":true,object:true},Er={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Or=Tr[typeof window]&&window||this,Sr=Tr[typeof exports]&&exports&&!exports.nodeType&&exports,kr=Tr[typeof module]&&module&&!module.nodeType&&module,Nr=Sr&&kr&&typeof global=="object"&&global; -!Nr||Nr.global!==Nr&&Nr.window!==Nr&&Nr.self!==Nr||(Or=Nr);var qr=kr&&kr.exports===Sr&&Sr,Fr=Array.prototype,Br=Object.prototype,Rr=Or._,$r=Br.toString,Ir=RegExp("^"+(null==$r?"":($r+"").replace(gr,"\\$&")).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mr=Math.ceil,Dr=Math.floor,Wr=Function.prototype.toString,zr=Br.hasOwnProperty,Cr=Fr.push,Pr=Br.propertyIsEnumerable,Ur=Fr.splice,Vr=w(Vr=Object.create)&&Vr,Gr=w(Gr=Array.isArray)&&Gr,Hr=Or.isFinite,Jr=Or.isNaN,Kr=w(Kr=Object.keys)&&Kr,Lr=Math.max,Qr=Math.min,Xr=w(Xr=Date.now)&&Xr,Yr=Math.random; -i.prototype=o.prototype;var Zr={};!function(){var n={0:1,length:1};Zr.spliceObjects=(Ur.call(n,0,1),!n[0])}(1),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Vr||(f=function(){function n(){}return function(r){if(J(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Or.Object()}}()),j(arguments)||(j=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&zr.call(n,"callee")&&!Pr.call(n,"callee")||false});var nt=E,rt=b(function(n,r,t){zr.call(n,t)?n[t]++:n[t]=1 -}),tt=b(function(n,r,t){zr.call(n,t)?n[t].push(r):n[t]=[r]}),et=b(function(n,r,t){n[t]=r}),ut=b(function(n,r,t){n[t?0:1].push(r)},true),ot=$,it=F;Zr.argsClass||(j=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&zr.call(n,"callee")&&!Pr.call(n,"callee")||false});var ft=Gr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&$r.call(n)==yr||false};H(/x/)&&(H=function(n){return typeof n=="function"&&"[object Function]"==$r.call(n)});var at=Kr?function(n){return J(n)?Kr(n):[] -}:x,ct=Xr||function(){return(new Date).getTime()};o.after=function(n,r){if(!H(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},o.bind=C,o.bindAll=function(n){for(var r=1i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},o.invert=function(n){for(var r=-1,t=at(n),e=t.length,u={};++rr?0:r);++nt?Lr(0,e+t):Qr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},o.mixin=tr,o.noConflict=function(){return Or._=Rr,this},o.now=ct,o.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Dr(Yr()*(r-n+1)) -},o.reduce=M,o.reduceRight=D,o.result=function(n,r){if(null!=n){var t=n[r];return H(t)?n[r]():t}},o.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:at(n).length},o.some=z,o.sortedIndex=S,o.template=function(n,r,t){var u=o,i=u.templateSettings;n=(null==n?"":n)+"",t=V({},t,i);var f=0,a="__p+='",i=t.variable;n.replace(RegExp((t.escape||sr).source+"|"+(t.interpolate||sr).source+"|"+(t.evaluate||sr).source+"|$","g"),function(r,t,u,o,i){return a+=n.slice(f,i).replace(hr,e),t&&(a+="'+_.escape("+t+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r -}),a+="';",i||(a="with(obj||{}){"+a+"}"),a="function("+(i||"obj")+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var c=Function("_","return "+a)(u)}catch(l){throw l.source=a,l}return r?c(r):(c.source=a,c)},o.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(lr,u))},o.uniqueId=function(n){var r=++cr+"";return n?n+r:r},o.all=q,o.any=z,o.detect=B,o.findWhere=B,o.foldl=M,o.foldr=D,o.include=N,o.inject=M,o.first=A,o.last=function(n,r,t){var e=n?n.length:0; -return null==r||t?n?n[e-1]:or:(r=e-r,O(n,0e?Lr(0,u+e):e||0;else if(e)return e=O(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function T(n,r,t){return E(n,null==r||t?1:0r?r=Lr(u+r,0):r>u&&(r=u),typeof t=="undefined"?t=u:0>t?t=Lr(u+t,0):t>u&&(t=u),u=t-r||0,t=Array(u);++e>>1,t(n[e])u&&(u=t);else r=nr(r,t,3),p(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function I(n,r,t,e){var u=3>arguments.length;r=nr(r,e,4);var o=-1,i=n?n.length:0; +if(typeof i=="number")for(u&&i&&(t=n[++o]);++oarguments.length;return r=nr(r,e,4),s(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function D(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return p(n,function(n){var t;t=++r,t=0+Dr(Yr()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function W(n,r,t){var e;r=nr(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number"){for(;++targuments.length?_(n,ir,r):_(n,ir|fr,r,E(arguments,2))}function C(n,r,t){function e(){l&&clearTimeout(l),i=l=p=or,(g||h!==r)&&(s=ct(),f=n.apply(c,o),l||i||(o=c=null))}function u(){var t=r-(ct()-a);0>=t||t>r?(i&&clearTimeout(i),t=p,i=l=p=or,t&&(s=ct(),f=n.apply(c,o),l||i||(o=c=null))):l=setTimeout(u,t)}var o,i,f,a,c,l,p,s=0,h=false,g=true;if(!J(n))throw new TypeError;if(r=0=y||y>h;m?(i&&(i=clearTimeout(i)),s=a,f=n.apply(c,o)):i||(i=setTimeout(e,y))}return m&&l?l=clearTimeout(l):l||r===h||(l=setTimeout(u,r)),t&&(m=true,f=n.apply(c,o)),!m||l||i||(o=c=null),f}}function P(n){if(!J(n))throw new TypeError;return function(){return!n.apply(this,arguments)}}function U(n,r,t){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof t;for("number"!=i&&"string"!=i||!e[3]||e[3][t]!==r||(o=2);++u"']/g,sr=/($^)/,hr=/[.*+?^${}()|[\]\\]/g,gr=/['\n\r\t\u2028\u2029\\]/g,vr="[object Arguments]",yr="[object Array]",mr="[object Boolean]",br="[object Date]",_r="[object Number]",dr="[object Object]",wr="[object RegExp]",jr="[object String]",xr={"&":"&","<":"<",">":">",'"':""","'":"'"},Ar={"&":"&","<":"<",">":">",""":'"',"'":"'"},Tr={"function":true,object:true},Er={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Or=Tr[typeof window]&&window||this,Sr=Tr[typeof exports]&&exports&&!exports.nodeType&&exports,kr=Tr[typeof module]&&module&&!module.nodeType&&module,Nr=Sr&&kr&&typeof global=="object"&&global; +!Nr||Nr.global!==Nr&&Nr.window!==Nr&&Nr.self!==Nr||(Or=Nr);var qr=kr&&kr.exports===Sr&&Sr,Fr=Array.prototype,Br=Object.prototype,Rr=Or._,$r=Br.toString,Ir=RegExp("^"+(null==$r?"":($r+"").replace(hr,"\\$&")).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mr=Math.ceil,Dr=Math.floor,Wr=Function.prototype.toString,zr=Br.hasOwnProperty,Cr=Fr.push,Pr=Br.propertyIsEnumerable,Ur=Fr.splice,Vr=w(Vr=Object.create)&&Vr,Gr=w(Gr=Array.isArray)&&Gr,Hr=Or.isFinite,Jr=Or.isNaN,Kr=w(Kr=Object.keys)&&Kr,Lr=Math.max,Qr=Math.min,Xr=w(Xr=Date.now)&&Xr,Yr=Math.random; +i.prototype=o.prototype;var Zr={};!function(){var n={0:1,length:1};Zr.spliceObjects=(Ur.call(n,0,1),!n[0])}(1),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Vr||(f=function(){function n(){}return function(r){if(K(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Or.Object()}}());var nt=T,rt=b(function(n,r,t){zr.call(n,t)?n[t]++:n[t]=1}),tt=b(function(n,r,t){zr.call(n,t)?n[t].push(r):n[t]=[r]}),et=b(function(n,r,t){n[t]=r +}),ut=b(function(n,r,t){n[t?0:1].push(r)},true),ot=R,it=q;H(arguments)||(H=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&zr.call(n,"callee")&&!Pr.call(n,"callee")||false});var ft=Gr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&$r.call(n)==yr||false};J(/x/)&&(J=function(n){return typeof n=="function"&&"[object Function]"==$r.call(n)});var at=Kr?function(n){return K(n)?Kr(n):[]}:j,ct=Xr||function(){return(new Date).getTime()};o.after=function(n,r){if(!J(r))throw new TypeError; +return function(){return 1>--n?r.apply(this,arguments):void 0}},o.bind=z,o.bindAll=function(n){for(var r=1i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},o.invert=function(n){for(var r=-1,t=at(n),e=t.length,u={};++rr?0:r);++nt?Lr(0,e+t):Qr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},o.mixin=er,o.noConflict=function(){return Or._=Rr,this},o.now=ct,o.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Dr(Yr()*(r-n+1))},o.reduce=I,o.reduceRight=M,o.result=function(n,r){if(null!=n){var t=n[r];return J(t)?n[r]():t}},o.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:at(n).length},o.some=W,o.sortedIndex=O,o.template=function(n,r,t){var u=o,i=u.templateSettings; +n=(null==n?"":n)+"",t=V({},t,i);var f=0,a="__p+='",i=t.variable;n.replace(RegExp((t.escape||sr).source+"|"+(t.interpolate||sr).source+"|"+(t.evaluate||sr).source+"|$","g"),function(r,t,u,o,i){return a+=n.slice(f,i).replace(gr,e),t&&(a+="'+_.escape("+t+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r}),a+="';",i||(a="with(obj||{}){"+a+"}"),a="function("+(i||"obj")+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}"; +try{var c=Function("_","return "+a)(u)}catch(l){throw l.source=a,l}return r?c(r):(c.source=a,c)},o.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(lr,u))},o.uniqueId=function(n){var r=++cr+"";return n?n+r:r},o.all=N,o.any=W,o.detect=F,o.findWhere=F,o.foldl=I,o.foldr=M,o.include=k,o.inject=I,o.first=x,o.last=function(n,r,t){var e=n?n.length:0;return null==r||t?n?n[e-1]:or:(r=e-r,E(n,0 true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == argsClass || false; - } - // fallback for environments that can't detect `arguments` objects by [[Class]] - if (!support.argsClass) { - isArguments = function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; - }; - } - /** * A fallback implementation of `Object.keys` which creates an array of the * own enumerable property names of `object`. @@ -5277,6 +5249,33 @@ return memoized; } + /** + * Creates a function that negates the result of `func`. The `func` function + * is executed with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to negate. + * @returns {Function} Returns the new function. + * @example + * + * function isEven(num) { + * return num % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(func) { + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + return !func.apply(this, arguments); + }; + } + /** * 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 @@ -7845,33 +7844,6 @@ } } - /** - * Creates a function that negates the result of `func`. The `func` function - * is executed with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Function} func The function to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(num) { - * return num % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(func) { - if (!isFunction(func)) { - throw new TypeError; - } - return function() { - return !func.apply(this, arguments); - }; - } - /** * Reverts the '_' variable to its previous value and returns a reference to * the `lodash` function.