From b9d314e64ca33ea727977387de6efe733ac52c43 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 5 Feb 2014 22:21:47 -0800 Subject: [PATCH] Rebuild dist/docs. --- dist/lodash.compat.js | 9 +++++---- dist/lodash.compat.min.js | 8 ++++---- dist/lodash.js | 9 +++++---- dist/lodash.min.js | 7 ++++--- dist/lodash.underscore.js | 5 +++-- dist/lodash.underscore.min.js | 2 +- doc/README.md | 26 +++++++++++++------------- 7 files changed, 35 insertions(+), 31 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index ed828e82a..b84b54d9b 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -6960,8 +6960,9 @@ */ function createCallback(func, thisArg, argCount) { var type = typeof func; - if (func == null || type == 'function') { - return baseCreateCallback(func, thisArg, argCount); + if (type == 'function' || func == null) { + return (typeof thisArg == 'undefined' || !('prototype' in func)) && + func || baseCreateCallback(func, thisArg, argCount); } // handle "_.pluck" and "_.where" style callback shorthands return type != 'object' ? property(func) : match(func); @@ -7321,10 +7322,10 @@ * // => 'slate' */ function result(object, key, defaultValue) { - if (object == null || typeof object[key] == 'undefined') { + var value = object == null ? undefined : object[key]; + if (typeof value == 'undefined') { return defaultValue; } - var value = object[key]; return isFunction(value) ? object[key]() : value; } diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 7a6eec863..080fb89f8 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -32,9 +32,9 @@ else ht(n,function(n,r,u){a[++e]=t(n,r,u)});return a}function Gt(n,t,r){var o=-1 return Ot(n,j|O,r,t,e)}function nr(n,t,r){var e,u,o,a,i,l,f,c=0,p=false,s=true;if(!or(n))throw new kr;if(t=Zr(0,t)||0,true===r)var g=true,s=false;else ar(r)&&(g=r.leading,p="maxWait"in r&&(Zr(t,r.maxWait)||0),s="trailing"in r?r.trailing:s);var h=function(){var r=t-(Ce()-a);0=y;m?(u&&(u=qr(u)),c=a,o=n.apply(i,e)):u||(u=Kr(v,y))}return m&&l?l=qr(l):l||t===p||(l=Kr(h,t)),r&&(m=true,o=n.apply(i,e)),!m||l||u||(e=i=null),o}}function tr(n,t,r){var e=arguments,u=0,o=e.length,a=typeof r;if("number"!=a&&"string"!=a||!e[3]||e[3][r]!==t||(o=2),3r?Zr(0,e+r):ne(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=gr,u.noConflict=function(){return n._=Nr,this},u.noop=hr,u.now=Ce,u.parseInt=ke,u.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=ee(),ne(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):xt(n,t) -},u.reduce=Ht,u.reduceRight=Jt,u.result=function(n,t,r){return null==n||"undefined"==typeof n[t]?r:(r=n[t],or(r)?n[t]():r)},u.runInContext=_,u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:_e(n).length},u.some=Yt,u.sortedIndex=Ft,u.template=function(n,t,r){var e=u.templateSettings;n=Cr(n||""),r=rr({},r,e);var o,a=rr({},r.imports,e.imports),e=_e(a),a=fr(a),i=0,l=r.interpolate||U,c="__p+='",l=xr((r.escape||U).source+"|"+l.source+"|"+(l===D?W:U).source+"|"+(r.evaluate||U).source+"|$","g"); +},u.reduce=Ht,u.reduceRight=Jt,u.result=function(n,t,r){var e=null==n?w:n[t];return typeof e=="undefined"?r:or(e)?n[t]():e},u.runInContext=_,u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:_e(n).length},u.some=Yt,u.sortedIndex=Ft,u.template=function(n,t,r){var e=u.templateSettings;n=Cr(n||""),r=rr({},r,e);var o,a=rr({},r.imports,e.imports),e=_e(a),a=fr(a),i=0,l=r.interpolate||U,c="__p+='",l=xr((r.escape||U).source+"|"+l.source+"|"+(l===D?W:U).source+"|"+(r.evaluate||U).source+"|$","g"); n.replace(l,function(t,r,e,u,a,l){return e||(e=u),c+=n.slice(i,l).replace(X,f),r&&(c+="'+__e("+r+")+'"),a&&(o=true,c+="';"+a+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t}),c+="';",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(o?c.replace(T,""):c).replace(P,"$1").replace(q,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var p=br(e,"return "+c).apply(w,a) }catch(s){throw s.source=c,s}return t?p(t):(p.source=c,p)},u.trim=we,u.trimLeft=je,u.trimRight=xe,u.unescape=function(n){return null==n?"":(n=Cr(n),0>n.indexOf(";")?n:n.replace(F,b))},u.uniqueId=function(n){var t=++R;return Cr(null==n?"":n)+t},u.all=zt,u.any=Yt,u.detect=Mt,u.findWhere=Mt,u.foldl=Ht,u.foldr=Jt,u.include=Wt,u.inject=Ht,gr(function(){var n={};return dt(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),false),u.first=Rt,u.last=function(n,t,r){var e=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=o; for(t=u.createCallback(t,r,3);a--&&t(n[a],a,n);)e++}else if(e=t,null==e||r)return n?n[o-1]:w;return e=o-e,qt(n,0 'slate' */ function result(object, key, defaultValue) { - if (object == null || typeof object[key] == 'undefined') { + var value = object == null ? undefined : object[key]; + if (typeof value == 'undefined') { return defaultValue; } - var value = object[key]; return isFunction(value) ? object[key]() : value; } diff --git a/dist/lodash.min.js b/dist/lodash.min.js index afbd819fd..14c936b82 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -31,8 +31,9 @@ return ht(n,function(n){var r=kt(0,++t);e[t]=e[r],e[r]=n}),e}function Jt(n,t,r){ 0=y;m?(i&&(i=Ir(i)),s=f,a=n.apply(l,o)):i||(i=Wr(e,y))}return m&&c?c=Ir(c):c||t===g||(c=Wr(u,t)),r&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a }}function Zt(n,t,r){var e=arguments,u=0,o=e.length,i=typeof r;if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3r?Hr(0,e+r):Jr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},y.mixin=pr,y.noConflict=function(){return n._=Sr,this},y.noop=sr,y.now=be,y.parseInt=de,y.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Zr(),Jr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):kt(n,t) -},y.reduce=Xt,y.reduceRight=Gt,y.result=function(n,t,r){return null==n||"undefined"==typeof n[t]?r:(r=n[t],er(r)?n[t]():r)},y.runInContext=d,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:he(n).length},y.some=Jt,y.sortedIndex=Ft,y.template=function(n,t,r){var e=y.templateSettings;n=kr(n||""),r=nr({},r,e);var u,o=nr({},r.imports,e.imports),e=he(o),o=ar(o),i=0,a=r.interpolate||M,f="__p+='",a=wr((r.escape||M).source+"|"+a.source+"|"+(a===W?z:M).source+"|"+(r.evaluate||M).source+"|$","g"); +},y.reduce=Xt,y.reduceRight=Gt,y.result=function(n,t,r){var e=null==n?_:n[t];return typeof e=="undefined"?r:er(e)?n[t]():e},y.runInContext=d,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:he(n).length},y.some=Jt,y.sortedIndex=Ft,y.template=function(n,t,r){var e=y.templateSettings;n=kr(n||""),r=nr({},r,e);var u,o=nr({},r.imports,e.imports),e=he(o),o=ar(o),i=0,a=r.interpolate||M,f="__p+='",a=wr((r.escape||M).source+"|"+a.source+"|"+(a===W?z:M).source+"|"+(r.evaluate||M).source+"|$","g"); n.replace(a,function(t,r,e,o,a,c){return e||(e=o),f+=n.slice(i,c).replace(V,l),r&&(f+="'+__e("+r+")+'"),a&&(u=true,f+="';"+a+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=c+t.length,t}),f+="';",a=r=r.variable,a||(r="obj",f="with("+r+"){"+f+"}"),f=(u?f.replace(I,""):f).replace(T,"$1").replace(F,"$1;"),f="function("+r+"){"+(a?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=mr(e,"return "+f).apply(_,o) }catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},y.trim=ve,y.trimLeft=ye,y.trimRight=me,y.unescape=function(n){return null==n?"":(n=kr(n),0>n.indexOf(";")?n:n.replace($,b))},y.uniqueId=function(n){var t=++R;return kr(null==n?"":n)+t},y.all=zt,y.any=Jt,y.detect=Pt,y.findWhere=Pt,y.foldl=Xt,y.foldr=Gt,y.include=Wt,y.inject=Xt,pr(function(){var n={};return bt(y,function(t,r){y.prototype[r]||(n[r]=t)}),n}(),false),y.first=Nt,y.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u; for(t=y.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:_;return e=u-e,Tt(n,0arguments.length)return b(n,er,null,r);if(n)var t=n[lr]?n[lr][2]:n.length,e=A(arguments,2),t=t-e.length;return b(n,er|fr,t,r,e)}function C(n,r,t){var e,u,o,i,f,a,l,c=0,p=false,s=true;if(!H(n))throw new TypeError;if(r=Qr(0,r)||0,true===t)var g=true,s=false;else J(t)&&(g=t.leading,p="maxWait"in t&&(Qr(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);var v=function(){var t=r-(lt()-i);0=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(h,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(v,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function P(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,vr=/($^)/,hr=/['\n\r\t\u2028\u2029\\]/g,yr="[object Arguments]",mr="[object Array]",br="[object Boolean]",_r="[object Date]",dr="[object Number]",wr="[object Object]",jr="[object RegExp]",xr="[object String]",Tr={"&":"&","<":"<",">":">",'"':""","'":"'"},Ar={"&":"&","<":"<",">":">",""":'"',"'":"'"},Er={"function":true,object:true},Or={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Sr=Er[typeof window]&&window||this,kr=Er[typeof exports]&&exports&&!exports.nodeType&&exports,Nr=Er[typeof module]&&module&&!module.nodeType&&module,qr=kr&&Nr&&typeof global=="object"&&global; !qr||qr.global!==qr&&qr.window!==qr&&qr.self!==qr||(Sr=qr);var Fr=Nr&&Nr.exports===kr&&kr,Br=Array.prototype,Rr=Object.prototype,$r=Sr._,Ir=Rr.toString,Mr=RegExp("^"+(Ir+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dr=Math.ceil,Wr=Math.floor,zr=Function.prototype.toString,Cr=Rr.hasOwnProperty,Pr=Br.push,Ur=Rr.propertyIsEnumerable,Vr=Br.splice,Gr=d(Gr=Object.create)&&Gr,Hr=d(Hr=Array.isArray)&&Hr,Jr=Sr.isFinite,Kr=Sr.isNaN,Lr=d(Lr=Object.keys)&&Lr,Qr=Math.max,Xr=Math.min,Yr=d(Yr=Date.now)&&Yr,Zr=Math.random; i.prototype=o.prototype;var nt={};!function(){var n={0:1,length:1};nt.spliceObjects=(Vr.call(n,0,1),!n[0])}(1),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Gr||(a=function(){function n(){}return function(r){if(J(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Sr.Object()}}()),w(arguments)||(w=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Cr.call(n,"callee")&&!Ur.call(n,"callee")||false});var rt=function(n,r){if(!J(n))return n; diff --git a/doc/README.md b/doc/README.md index d9676a2d4..9f0a2583b 100644 --- a/doc/README.md +++ b/doc/README.md @@ -4325,7 +4325,7 @@ _.unescape('fred, barney & pebbles'); ### `_.now` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7187 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7188 "View in source") [Ⓣ][1] *(unknown)*: Gets the number of milliseconds that have elapsed since the Unix epoch *(1 January `1970 00`:00:00 UTC)*. @@ -4412,7 +4412,7 @@ _.filter(characters, 'age__gt38'); ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7001 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7002 "View in source") [Ⓣ][1] This method returns the first argument provided to it. @@ -4437,7 +4437,7 @@ _.identity(object) === object; ### `_.match(props)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7030 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7031 "View in source") [Ⓣ][1] Creates a "_.where" style function, which performs a deep comparison between a given object and the `props` object, returning `true` if the given object has equivalent property values, else `false`. @@ -4471,7 +4471,7 @@ _.find(characters, matchAge); ### `_.mixin([object=lodash], source, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7093 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7094 "View in source") [Ⓣ][1] Adds function properties of a source object to the destination object. If `object` is a function methods will be added to its prototype as well. @@ -4509,7 +4509,7 @@ _('fred').vowels(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7153 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7154 "View in source") [Ⓣ][1] Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. @@ -4529,7 +4529,7 @@ var lodash = _.noConflict(); ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7170 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7171 "View in source") [Ⓣ][1] A no-operation function. @@ -4548,7 +4548,7 @@ _.noop(object) === undefined; ### `_.parseInt(value, [radix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7211 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7212 "View in source") [Ⓣ][1] Converts `value` to an integer of the specified radix. If `radix` is `undefined` or `0` a `radix` of `10` is used unless the `value` is a hexadecimal, in which case a `radix` of `16` is used. @@ -4575,7 +4575,7 @@ _.parseInt('08'); ### `_.property(key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7242 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7243 "View in source") [Ⓣ][1] Creates a "_.pluck" style function, which returns the `key` value of a given object. @@ -4609,7 +4609,7 @@ _.sortBy(characters, getName); ### `_.random([min=0], [max=1], [floating=false])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7275 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7276 "View in source") [Ⓣ][1] Produces a random number between `min` and `max` *(inclusive)*. If only one argument is provided a number between `0` and the given number will be returned. If `floating` is truey or either `min` or `max` are floats a floating-point number will be returned instead of an integer. @@ -4644,7 +4644,7 @@ _.random(1.2, 5.2); ### `_.result(object, key, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7340 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7341 "View in source") [Ⓣ][1] Resolves the value of property `key` on `object`. If `key` is a function it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is `null` or `undefined` then `undefined` is returned. If a default value is provided it will be returned if the property value resolves to `undefined`. @@ -4701,7 +4701,7 @@ Create a new `lodash` function using the given context object. ### `_.times(n, callback, [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7371 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7372 "View in source") [Ⓣ][1] Executes the callback `n` times, returning an array of the results of each callback execution. The callback is bound to `thisArg` and invoked with one argument; *(index)*. @@ -4733,7 +4733,7 @@ _.times(3, function(n) { this.cast(n); }, mage); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7399 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7400 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is provided the ID will be appended to it. @@ -4786,7 +4786,7 @@ A reference to the `lodash` function. ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7607 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7608 "View in source") [Ⓣ][1] *(string)*: The semantic version number.