diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 989a02a35..171c8782f 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -802,7 +802,8 @@ /** * Detect if functions can be decompiled by `Function#toString` - * (all but PS3 and older Opera mobile browsers; forced `false` for Windows 8 apps). + * (all but Firefox OS certified apps, older Opera mobile browsers, and + * the PlayStation 3; forced `false` for Windows 8 apps). * * @memberOf _.support * @type boolean @@ -5415,20 +5416,15 @@ * @returns {Function} Returns the new partially applied function. * @example * - * var defaultsDeep = _.partialRight(_.merge, _.defaults); + * var defaultsDeep = _.partialRight(_.merge, function deep(value, other) { + * return _.merge(value, other, deep); + * }); * - * var options = { - * 'variable': 'data', - * 'imports': { 'jq': $ } - * }; + * var object = { 'a': { 'b': { 'c': 1 } } }, + * source = { 'a': { 'b': { 'c': 2, 'd': 2 } } }; * - * defaultsDeep(options, _.templateSettings); - * - * options.variable - * // => 'data' - * - * options.imports - * // => { '_': _, 'jq': $ } + * defaultsDeep(object, source); + * // => { 'a': { 'b': { 'c': 1, 'd': 2 } } } */ function partialRight(func) { if (func) { @@ -5731,6 +5727,9 @@ * object for all destination properties that resolve to `undefined`. Once a * property is set, additional defaults of the same property will be ignored. * + * Note: See the [documentation example of `_.partialRight`](http://lodash.com/docs#partialRight) + * for a deep version of this method. + * * @static * @memberOf _ * @category Objects @@ -7791,7 +7790,7 @@ function createCallback(func, thisArg, argCount) { var type = typeof func; if (type == 'function' || func == null) { - return (typeof thisArg == 'undefined' || !('prototype' in func)) && + return (typeof thisArg == 'undefined' || !(func && 'prototype' in func)) && func || baseCreateCallback(func, thisArg, argCount); } // handle "_.pluck" and "_.where" style callback shorthands diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index b34d68d50..381b63ae1 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -32,8 +32,8 @@ if(t=c.createCallback(t,e,4),$e(n)){var o=-1,i=n.length;for(u&&i&&(r=n[++o]);++o var u=0,o=e.length,i=typeof r;if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3>>0,e=n.constructor,u=-1,o=e&&n===e.prototype,i=r-1,e=Pr(r),a=0t||null==n||!_e(t))return r;n=Vr(n);do t%2&&(r+=n),t=ie(t/2),n+=n;while(t);return r}function Rr(n,t){return(n=null==n?"":Vr(n))?null==t?n.slice(h(n),v(n)+1):(t=Vr(t),n.slice(o(n,t),i(n,t)+1)):n}function Nr(n,t,r){var e=typeof n;return"function"==e||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||ht(n,t,r):"object"==e?Lr(n):$r(n)}function Tr(n){return n}function Lr(n){var t=ze(n),r=t.length,e=t[0],u=r&&n[e]; -return 1!=r||u!==u||xr(u)?function(e){var u=r;if(u&&!e)return false;for(var o=true;u--&&(o=t[u],o=fe.call(e,o)&&At(e[o],n[o],null,true)););return o}:function(n){return n&&fe.call(n,e)?(n=n[e],u===n&&(0!==u||1/u==1/n)):false}}function Wr(n,t,r){var e=true,u=t&&dr(t);t&&(r||u.length)||(null==r&&(r=t),t=n,n=this,u=dr(t)),false===r?e=false:xr(r)&&"chain"in r&&(e=r.chain),r=-1;for(var o=wr(n),i=u?u.length:0;++rt||null==n||!_e(t))return r;n=Vr(n);do t%2&&(r+=n),t=ie(t/2),n+=n;while(t);return r}function Rr(n,t){return(n=null==n?"":Vr(n))?null==t?n.slice(h(n),v(n)+1):(t=Vr(t),n.slice(o(n,t),i(n,t)+1)):n}function Nr(n,t,r){var e=typeof n;return"function"==e||null==n?(typeof t=="undefined"||!(n&&"prototype"in n))&&n||ht(n,t,r):"object"==e?Lr(n):$r(n)}function Tr(n){return n +}function Lr(n){var t=ze(n),r=t.length,e=t[0],u=r&&n[e];return 1!=r||u!==u||xr(u)?function(e){var u=r;if(u&&!e)return false;for(var o=true;u--&&(o=t[u],o=fe.call(e,o)&&At(e[o],n[o],null,true)););return o}:function(n){return n&&fe.call(n,e)?(n=n[e],u===n&&(0!==u||1/u==1/n)):false}}function Wr(n,t,r){var e=true,u=t&&dr(t);t&&(r||u.length)||(null==r&&(r=t),t=n,n=this,u=dr(t)),false===r?e=false:xr(r)&&"chain"in r&&(e=r.chain),r=-1;for(var o=wr(n),i=u?u.length:0;++r 'data' - * - * options.imports - * // => { '_': _, 'jq': $ } + * defaultsDeep(object, source); + * // => { 'a': { 'b': { 'c': 1, 'd': 2 } } } */ function partialRight(func) { if (func) { @@ -5552,6 +5548,9 @@ * object for all destination properties that resolve to `undefined`. Once a * property is set, additional defaults of the same property will be ignored. * + * Note: See the [documentation example of `_.partialRight`](http://lodash.com/docs#partialRight) + * for a deep version of this method. + * * @static * @memberOf _ * @category Objects @@ -7575,7 +7574,7 @@ function createCallback(func, thisArg, argCount) { var type = typeof func; if (type == 'function' || func == null) { - return (typeof thisArg == 'undefined' || !('prototype' in func)) && + return (typeof thisArg == 'undefined' || !(func && 'prototype' in func)) && func || baseCreateCallback(func, thisArg, argCount); } // handle "_.pluck" and "_.where" style callback shorthands diff --git a/dist/lodash.min.js b/dist/lodash.min.js index daf0fb0a9..f39a58989 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -31,7 +31,7 @@ a>o&&(o=a)}else t=null==t&&ke(n)?u:c.createCallback(t,e,3),mt(n,function(n,e,u){ }}function he(n){if(!be(n))throw new Ke(O);return function(){return!n.apply(this,arguments)}}function ge(n,t,e){var r=arguments;if(!n||2>r.length)return n;var u=0,o=r.length,i=typeof e;if("number"!=i&&"string"!=i||!r[3]||r[3][e]!==t||(o=2),3>>0,r=n.constructor,u=-1,r=r&&n===r.prototype,o=e-1,i=$e(e),a=0t||null==n||!yr(t))return e;n=Pe(n);do t%2&&(e+=n),t=er(t/2),n+=n;while(t);return e}function Ie(n,t){return(n=null==n?"":Pe(n))?null==t?n.slice(h(n),g(n)+1):(t=Pe(t),n.slice(o(n,t),i(n,t)+1)):n}function Re(n,t,e){var r=typeof n;return"function"==r||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||st(n,t,e):"object"==r?Se(n):Fe(n) +}else t=c.createCallback(t,e,3),kt(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r}function Oe(n){return Rt(n,Wr)}function Ae(n){return null==n?"":Pe(n).replace(Z,"\\$&")}function Ee(n,t){var e="";if(t=+t,1>t||null==n||!yr(t))return e;n=Pe(n);do t%2&&(e+=n),t=er(t/2),n+=n;while(t);return e}function Ie(n,t){return(n=null==n?"":Pe(n))?null==t?n.slice(h(n),g(n)+1):(t=Pe(t),n.slice(o(n,t),i(n,t)+1)):n}function Re(n,t,e){var r=typeof n;return"function"==r||null==n?(typeof t=="undefined"||!(n&&"prototype"in n))&&n||st(n,t,e):"object"==r?Se(n):Fe(n) }function Ne(n){return n}function Se(n){var t=Wr(n),e=t.length,r=t[0],u=e&&n[r];return 1!=e||u!==u||_e(u)?function(r){var u=e;if(u&&!r)return false;for(var o=true;u--&&(o=t[u],o=or.call(r,o)&&Ot(r[o],n[o],null,true)););return o}:function(n){return n&&or.call(n,r)?(n=n[r],u===n&&(0!==u||1/u==1/n)):false}}function Te(n,t,e){var r=true,u=t&&ye(t);t&&(e||u.length)||(null==e&&(e=t),t=n,n=this,u=ye(t)),false===e?r=false:_e(e)&&"chain"in e&&(r=e.chain),e=-1;for(var o=be(n),i=u?u.length:0;++earguments.length?x(n,pr,r):x(n,pr|gr,r,N(arguments,2))}function H(n,r,t){function e(){l&&clearTimeout(l),i=l=p=lr,(h||g!==r)&&(s=yt(),f=n.apply(c,o),l||i||(o=c=null))}function u(){var t=r-(yt()-a);0>=t||t>r?(i&&clearTimeout(i),t=p,i=l=p=lr,t&&(s=yt(),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(!Y(n))throw new TypeError(vr);if(r=0>r?0:r,true===t)var v=true,h=false;else Z(t)&&(v=t.leading,g="maxWait"in t&&et(r,+t.maxWait||0),h="trailing"in t?t.trailing:h); return function(){if(o=arguments,a=yt(),c=this,p=h&&(l||!v),false===g)var t=v&&!l;else{i||v||(s=a);var y=g-(a-s),m=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 J(n){if(!Y(n))throw new TypeError(vr);return function(){return!n.apply(this,arguments)}}function K(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,dr=/($^)/,_r=/[.*+?^${}()|[\]\/\\]/g,wr=/['\n\r\u2028\u2029\\]/g,jr="[object Arguments]",xr="[object Array]",Tr="[object Boolean]",Ar="[object Date]",Er="[object Number]",Or="[object Object]",kr="[object RegExp]",Sr="[object String]",Nr={"&":"&","<":"<",">":">",'"':""","'":"'"},qr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Fr={"function":true,object:true},Br={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Mr=Fr[typeof window]&&window||this,Rr=Fr[typeof exports]&&exports&&!exports.nodeType&&exports,$r=Fr[typeof module]&&module&&!module.nodeType&&module,Ir=Rr&&$r&&typeof global=="object"&&global; !Ir||Ir.global!==Ir&&Ir.window!==Ir&&Ir.self!==Ir||(Mr=Ir);var Dr=$r&&$r.exports===Rr&&Rr,Wr=Array.prototype,zr=Object.prototype,Cr=Mr._,Pr=Math.pow(2,53)-1,Ur=zr.toString,Vr=RegExp("^"+(null==Ur?"":(Ur+"").replace(_r,"\\$&")).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gr=Math.ceil,Hr=Math.floor,Jr=Function.prototype.toString,Kr=zr.hasOwnProperty,Lr=Wr.push,Qr=zr.propertyIsEnumerable,Xr=Wr.splice,Yr=A(Yr=Object.create)&&Yr,Zr=A(Zr=Array.isArray)&&Zr,nt=Mr.isFinite,rt=Mr.isNaN,tt=A(tt=Object.keys)&&tt,et=Math.max,ut=Math.min,ot=A(ot=Date.now)&&ot,it=Math.random; i.prototype=o.prototype;var ft={};!function(){var n={0:1,length:1};ft.spliceObjects=(Xr.call(n,0,1),!n[0])}(0,0),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Yr||(c=function(){function n(){}return function(r){if(Z(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Mr.Object()}}());var at=S,ct=O,lt=j(function(n,r,t){Kr.call(n,t)?n[t]++:n[t]=1}),pt=j(function(n,r,t){Kr.call(n,t)?n[t].push(r):n[t]=[r]}),st=j(function(n,r,t){n[t]=r