diff --git a/build.js b/build.js index 5dd4461b6..e3c447ab4 100755 --- a/build.js +++ b/build.js @@ -124,7 +124,7 @@ 'memoize': [], 'merge': ['forOwn', 'isArray', 'isPlainObject'], 'min': ['forEach', 'isArray', 'isString'], - 'mixin': ['filter', 'forEach', 'functions'], + 'mixin': ['forEach', 'forOwn', 'functions'], 'noConflict': [], 'object': [], 'omit': ['forIn', 'indexOf'], @@ -366,6 +366,8 @@ .replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n') // remove lines with just whitespace and semicolons .replace(/^ *;\n/gm, '') + // consolidate multiple newlines + .replace(/\n{3,}/g, '\n\n') // consolidate consecutive horizontal rule comment separators .replace(/(?:\s*\/\*-+\*\/\s*){2,}/g, function(separators) { return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*')); @@ -439,7 +441,7 @@ * @returns {String} Returns the method assignments snippet. */ function getMethodAssignments(source) { - return (source.match(/lodash\.VERSION *= *[\s\S]+?\/\*-+\*\/\n/) || [''])[0]; + return (source.match(/\/\*-+\*\/\n(?:\s*\/\/.*)*\s*lodash\.\w+ *=[\s\S]+?lodash\.VERSION *=.+/) || [''])[0]; } /** @@ -1465,17 +1467,22 @@ ' }' ].join('\n')); - // add `__chain__` checks to `_.mixin` and Array function wrappers - source = source.replace(/^( *)forEach\([\s\S]+?\n\1}.+/gm, function(match) { - return match.replace(/^( *)return new lodash\(([^)]+)\).+/m, function(submatch, indent, varName) { - return indent + [ - 'if (this.__chain__) {', - ' varName = new lodash(varName);', - ' varName.__chain__ = true;', - '}', - 'return varName;' - ].join('\n' + indent) - .replace(/varName/g, varName); + // add `__chain__` checks to `_.mixin` and `Array` function wrappers + _.each([ + matchFunction(source, 'mixin'), + /(?:\s*\/\/.*)*\n( *)forEach\(\['[\s\S]+?\n\1}.+/g + ], function(pattern) { + source = source.replace(pattern, function(match) { + return match.replace(/( *)return new lodash\(([^)]+)\).+/, function(submatch, indent, varName) { + return indent + [ + 'if (this.__chain__) {', + ' varName = new lodash(varName);', + ' varName.__chain__ = true;', + '}', + 'return varName;' + ].join('\n' + indent) + .replace(/varName/g, varName); + }); }); }); @@ -1492,12 +1499,21 @@ }); // remove `lodash.prototype.toString` and `lodash.prototype.valueOf` assignments - source = source.replace(/ *lodash\.prototype\.(?:toString|valueOf) *=.+\n/g, ''); + source = source.replace(/^ *lodash\.prototype\.(?:toString|valueOf) *=.+\n/gm, ''); // remove `lodash.prototype` batch method assignments - source = source - .replace(/(?:\s*\/\/.*)*\n( *)forEach\(\['first'[\s\S]+?\n\1}.+/, '') - .replace(/(?:\s*\/\/.*)*\n( *)forEach\(filter[\s\S]+?lodash\.[\s\S]+?\n\1}.+/, ''); + source = source.replace(/(?:\s*\/\/.*)*\n( *)forOwn\(lodash, *function\(func, *methodName\)[\s\S]+?\n\1}.+/g, ''); + + // move `mixin(lodash)` to after the method assignments + source = source.replace(/(?:\s*\/\/.*)*\s*mixin\(lodash\).+/, ''); + source = source.replace(getMethodAssignments(source), function(match) { + return match + [ + '', + '', + ' // add functions to `lodash.prototype`', + ' mixin(lodash);' + ].join('\n'); + }); // remove unused features from `createBound` if (buildMethods.indexOf('partial') == -1) { @@ -1617,23 +1633,23 @@ modified = snippet; if (!exposeAssign) { - modified = modified.replace(/(?:\n *\/\/.*\s*)* *lodash\.assign *= *.+\n/, ''); + modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.assign *= *.+\n/m, ''); } if (!exposeForIn) { - modified = modified.replace(/(?:\n *\/\/.*\s*)* *lodash\.forIn *= *.+\n/, ''); + modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forIn *= *.+\n/m, ''); } if (!exposeForOwn) { - modified = modified.replace(/(?:\n *\/\/.*\s*)* *lodash\.forOwn *= *.+\n/, ''); + modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forOwn *= *.+\n/m, ''); } if (!exposeIsPlainObject) { - modified = modified.replace(/(?:\n *\/\/.*\s*)* *lodash\.isPlainObject *= *.+\n/, ''); + modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.isPlainObject *= *.+\n/m, ''); } source = source.replace(snippet, modified); }()); // replace `isArguments` and its fallback (function() { - var snippet = matchFunction(source, 'isArguments'); + var snippet = matchFunction(source, 'isArguments').trimRight(); snippet = snippet.replace(/function isArguments/, 'lodash.isArguments = function'); source = removeFunction(source, 'isArguments'); @@ -1819,6 +1835,8 @@ source = removeIsFunctionFallback(source); } if (isRemoved(source, 'mixin')) { + source = removeVar(source, 'hasObjectSpliceBug'); + // simplify the `lodash` function source = replaceFunction(source, 'lodash', [ ' function lodash() {', @@ -1826,17 +1844,17 @@ ' }' ].join('\n')); - // remove `lodash.prototype` additions - source = source.replace(/(?:\s*\/\/.*)*\s*mixin\(lodash\)[\s\S]+?\/\*-+\*\//, ''); - source = removeVar(source, 'hasObjectSpliceBug'); + // remove all `lodash.prototype` additions + source = source + .replace(/(?:\s*\/\/.*)*\n( *)forOwn\(lodash, *function\(func, *methodName\)[\s\S]+?\n\1}.+/g, '') + .replace(/(?:\s*\/\/.*)*\n( *)forEach\(\['[\s\S]+?\n\1}.+/g, '') + .replace(/(?:\s*\/\/.*)*\s*mixin\(lodash\).+\n/, '') + .replace(/(?:\s*\/\/.*)*\s*lodash\.prototype.+\n/, ''); } - // remove pseudo private properties - source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n'); - // assign debug source before further modifications that rely on the minifier // to remove unused variables and other dead code - debugSource = source; + debugSource = cleanupSource(source); // remove associated functions, variables, and code snippets that the minifier may miss if (isRemoved(source, 'clone')) { @@ -1889,6 +1907,8 @@ } } + source = cleanupSource(source); + /*------------------------------------------------------------------------*/ // used to specify creating a custom build diff --git a/doc/README.md b/doc/README.md index 8cd0114ad..3af09fdc6 100644 --- a/doc/README.md +++ b/doc/README.md @@ -3050,7 +3050,7 @@ _.uniqueId(); ### `_.VERSION` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4168 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4319 "View in source") [Ⓣ][1] *(String)*: The semantic version number. diff --git a/lodash.js b/lodash.js index fa85f7f19..4d99be395 100644 --- a/lodash.js +++ b/lodash.js @@ -4158,50 +4158,86 @@ /*--------------------------------------------------------------------------*/ - /** - * The semantic version number. - * - * @static - * @memberOf _ - * @type String - */ - lodash.VERSION = '1.0.0-rc.1'; - - // assign static methods + // add functions that return wrapped values when chaining lodash.assign = assign; - lodash.after = after; - lodash.bind = bind; lodash.bindAll = bindAll; - lodash.bindKey = bindKey; lodash.chain = chain; - lodash.clone = clone; - lodash.compact = compact; - lodash.compose = compose; - lodash.contains = contains; lodash.countBy = countBy; - lodash.debounce = debounce; lodash.defaults = defaults; - lodash.defer = defer; - lodash.delay = delay; lodash.difference = difference; - lodash.escape = escape; lodash.every = every; lodash.filter = filter; - lodash.find = find; - lodash.first = first; lodash.flatten = flatten; lodash.forEach = forEach; lodash.forIn = forIn; lodash.forOwn = forOwn; lodash.functions = functions; lodash.groupBy = groupBy; - lodash.has = has; - lodash.identity = identity; - lodash.indexOf = indexOf; lodash.initial = initial; lodash.intersection = intersection; lodash.invert = invert; lodash.invoke = invoke; + lodash.keys = keys; + lodash.map = map; + lodash.max = max; + lodash.merge = merge; + lodash.min = min; + lodash.mixin = mixin; + lodash.object = object; + lodash.omit = omit; + lodash.pairs = pairs; + lodash.pick = pick; + lodash.pluck = pluck; + lodash.range = range; + lodash.reject = reject; + lodash.rest = rest; + lodash.shuffle = shuffle; + lodash.some = some; + lodash.sortBy = sortBy; + lodash.sortedIndex = sortedIndex; + lodash.tap = tap; + lodash.times = times; + lodash.toArray = toArray; + lodash.union = union; + lodash.uniq = uniq; + lodash.values = values; + lodash.where = where; + lodash.without = without; + lodash.zip = zip; + + // add aliases + lodash.all = every; + lodash.any = some; + lodash.collect = map; + lodash.drop = rest; + lodash.each = forEach; + lodash.extend = assign; + lodash.methods = functions; + lodash.select = filter; + lodash.tail = rest; + lodash.unique = uniq; + + // add functions to `lodash.prototype` + mixin(lodash); + + /*--------------------------------------------------------------------------*/ + + // add functions that return unwrapped values when chaining + lodash.after = after; + lodash.bind = bind; + lodash.bindKey = bindKey; + lodash.clone = clone; + lodash.compact = compact; + lodash.compose = compose; + lodash.contains = contains; + lodash.debounce = debounce; + lodash.defer = defer; + lodash.delay = delay; + lodash.escape = escape; + lodash.find = find; + lodash.has = has; + lodash.identity = identity; + lodash.indexOf = indexOf; lodash.isArguments = isArguments; lodash.isArray = isArray; lodash.isBoolean = isBoolean; @@ -4219,120 +4255,84 @@ lodash.isRegExp = isRegExp; lodash.isString = isString; lodash.isUndefined = isUndefined; - lodash.keys = keys; - lodash.last = last; lodash.lastIndexOf = lastIndexOf; - lodash.map = map; - lodash.max = max; lodash.memoize = memoize; - lodash.merge = merge; - lodash.min = min; - lodash.mixin = mixin; lodash.noConflict = noConflict; - lodash.object = object; - lodash.omit = omit; lodash.once = once; - lodash.pairs = pairs; lodash.partial = partial; - lodash.pick = pick; - lodash.pluck = pluck; lodash.random = random; - lodash.range = range; lodash.reduce = reduce; lodash.reduceRight = reduceRight; - lodash.reject = reject; - lodash.rest = rest; lodash.result = result; - lodash.shuffle = shuffle; lodash.size = size; - lodash.some = some; - lodash.sortBy = sortBy; - lodash.sortedIndex = sortedIndex; - lodash.tap = tap; lodash.template = template; lodash.throttle = throttle; - lodash.times = times; - lodash.toArray = toArray; lodash.unescape = unescape; - lodash.union = union; - lodash.uniq = uniq; lodash.uniqueId = uniqueId; - lodash.values = values; - lodash.where = where; - lodash.without = without; lodash.wrap = wrap; - lodash.zip = zip; - // assign aliases - lodash.all = every; - lodash.any = some; - lodash.collect = map; + // add aliases lodash.detect = find; - lodash.drop = rest; - lodash.each = forEach; - lodash.extend = assign; lodash.foldl = reduce; lodash.foldr = reduceRight; - lodash.head = first; lodash.include = contains; lodash.inject = reduce; - lodash.methods = functions; - lodash.select = filter; - lodash.tail = rest; - lodash.take = first; - lodash.unique = uniq; - // add pseudo private property to be used and removed during the build process - lodash._iteratorTemplate = iteratorTemplate; + forOwn(lodash, function(func, methodName) { + if (!lodash.prototype[methodName]) { + lodash.prototype[methodName] = function() { + var args = [this.__wrapped__]; + push.apply(args, arguments); + return func.apply(lodash, args); + }; + } + }); /*--------------------------------------------------------------------------*/ - // add all static functions to `lodash.prototype` - mixin(lodash); + // add functions capable of returning wrapped and unwrapped values when chaining + lodash.first = first; + lodash.last = last; - // add `lodash.prototype.chain` after calling `mixin()` to avoid overwriting - // it with the wrapped `lodash.chain` + // add aliases + lodash.take = first; + lodash.head = first; + + forOwn(lodash, function(func, methodName) { + if (!lodash.prototype[methodName]) { + lodash.prototype[methodName]= function(n, guard) { + var result = func(this.__wrapped__, n, guard); + return (n == null || guard) ? result : new lodash(result); + }; + } + }); + + /*--------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type String + */ + lodash.VERSION = '1.0.0-rc.1'; + + // add "Chaining" functions to the wrapper lodash.prototype.chain = wrapperChain; lodash.prototype.toString = wrapperToString; lodash.prototype.value = wrapperValueOf; lodash.prototype.valueOf = wrapperValueOf; - // add methods that are capable of returning wrapped and unwrapped values - forEach(['first', 'last'], function(methodName) { - var func = lodash[methodName]; - if (func) { - lodash.prototype[methodName] = function(n, guard) { - var result = func(this.__wrapped__, n, guard); - return (n == null || guard) - ? result - : new lodash(result); - }; - } - }); - - // add all methods that return unwrapped values - forEach(filter(functions(lodash), function(methodName) { - return /^(?:bind|contains|every|find|has|is[A-Z].+|reduce.*|some)$/.test(methodName); - }), function(methodName) { - var func = lodash[methodName]; - - lodash.prototype[methodName] = function() { - var args = [this.__wrapped__]; - push.apply(args, arguments); - return func.apply(lodash, args); - }; - }); - - // add all mutator Array functions to the wrapper. + // add mutator `Array` functions to the wrapper forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { var func = arrayRef[methodName]; - lodash.prototype[methodName] = function() { var value = this.__wrapped__; func.apply(value, arguments); - // avoid array-like object bugs with `Array#shift` and `Array#splice` in - // Firefox < 10 and IE < 9 + // avoid array-like object bugs with `Array#shift` and `Array#splice` + // in Firefox < 10 and IE < 9 if (hasObjectSpliceBug && value.length === 0) { delete value[0]; } @@ -4340,10 +4340,9 @@ }; }); - // add all accessor Array functions to the wrapper. + // add accessor `Array` functions to the wrapper forEach(['concat', 'join', 'slice'], function(methodName) { var func = arrayRef[methodName]; - lodash.prototype[methodName] = function() { var value = this.__wrapped__, result = func.apply(value, arguments); @@ -4352,6 +4351,9 @@ }; }); + // add pseudo private property to be used and removed during the build process + lodash._iteratorTemplate = iteratorTemplate; + /*--------------------------------------------------------------------------*/ // expose Lo-Dash diff --git a/lodash.min.js b/lodash.min.js index 19c70c791..54b897139 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -22,20 +22,20 @@ n)r=(0>n?Dt(0,i+n):n||0)-1;else if(n)return r=V(e,t),e[r]===t?r:-1;for(;++r/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:vt,variable:""};if(Xt||Vt||!Wt)o=Function;var an={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a":">",'"':""","'":"'"},vn=T(dn),mn=h(an,{g:"if(t[i]==null)"+an.g}),gn=At||function(e){return kt.call(e)==jt};C(/x/)&&(C=function(e){return"[object Function]"==kt.call(e)});var yn=xt?function(e){if(!e||"object"!=typeof -e)return i;var t=e.valueOf,n="function"==typeof t&&(n=xt(t))&&xt(n);return n?e==n||xt(e)==n&&!b(e):w(e)}:w,bn=_t?function(e){return"function"==typeof e&&Ct.call(e,"prototype")?E(e):k(e)?_t(e):[]}:E,wn=h(fn);s.VERSION="1.0.0-rc.1",s.assign=cn,s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=J,s.bindAll=function(e){for(var t=arguments,n=1W(i,e)){for(var s=n;--s;)if(! -(r[s]||(r[s]=u(t[s])))(e))return;i.push(e)}}),i},s.invert=T,s.invoke=function(e,t){var n=g(arguments,2),r="function"==typeof t,i=[];return wn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.isArguments=b,s.isArray=gn,s.isBoolean=function(e){return e===n||e===i||kt.call(e)==Ft},s.isDate=function(e){return kt.call(e)==It},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=kt.call(e),s=e.length;return r==jt||r==zt||r==Bt||Zt&&b(e)||r==Rt&&"number"==typeof -s&&C(e.splice)?!s:(pn(e,function(){return t=i}),t)},s.isEqual=N,s.isFinite=function(e){return Ot(e)&&!Mt(parseFloat(e))},s.isFunction=C,s.isNaN=function(e){return L(e)&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=L,s.isObject=k,s.isPlainObject=yn,s.isRegExp=function(e){return kt.call(e)==Ut},s.isString=A,s.isUndefined=function(e){return"undefined"==typeof e},s.keys=bn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:g(e,Dt(0,i-t))}},s.lastIndexOf=function(e,t,n){var r=e? -e.length:0;for("number"==typeof n&&(r=(0>n?Dt(0,r+n):Pt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.map=B,s.max=j,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Tt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=O,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!gn(e))t=!t&&A(e)?a:c(t,n),wn(e,function(e,n,i){n=t(e,n,i),nW(s,n,1))i[n]=e}),i},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.pairs=function(e){var t=[];return pn(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return l -(e,g(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=Et.apply(et,arguments),o=s.length;++i=l?(clearTimeout(u),u=r,a=f,s=e.apply(o,i)):u||(u=setTimeout(n,l)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++rW(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=u(t[s])))(e))return;i.push(e)}}),i},s.invert=T,s.invoke=function(e,t){var n=g(arguments,2),r="function"==typeof t,i=[];return wn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.keys=bn,s.map=B,s.max=j,s.merge=O,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!gn(e))t=!t&&A(e)?a:c(t,n),wn(e,function(e,n,i){n=t(e,n,i),nW(s,n,1))i[n]=e}),i},s.pairs=function(e){var t=[];return pn(e,function(e,n){t.push([n,e])}),t},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=Et.apply(et,arguments),o=s.length;++ie?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=J,s.bindKey=function(e,t){return l(e,t,g(arguments,2))},s.clone=S,s.compact=function( +e){for(var t=-1,n=e?e.length:0,r=[];++tn?Dt(0,r+n):Pt +(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Tt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.noConflict=function(){return e._=st,this},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.partial=function(e){return l(e,g(arguments,1))},s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+St(Ht()*((+t||0)-e+1))},s.reduce=I, +s.reduceRight=q,s.result=function(e,t){var n=e?e[t]:r;return C(n)?e[t]():n},s.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:bn(e).length},s.template=function(e,t,n){e||(e=""),n||(n={});var r,i,u=s.templateSettings,a=0,f=n.interpolate||u.interpolate||mt,l="__p+='",c=n.variable||u.variable,h=c;e.replace(RegExp((n.escape||u.escape||mt).source+"|"+f.source+"|"+(f===vt?dt:mt).source+"|"+(n.evaluate||u.evaluate||mt).source+"|$","g"),function(t,n,i,s,o,u){return i||(i=s),l+=e.slice(a,u) +.replace(yt,p),n&&(l+="'+__e("+n+")+'"),o&&(l+="';"+o+";__p+='"),i&&(l+="'+((__t=("+i+"))==null?'':__t)+'"),r||(r=o||ot.test(n||i)),a=u+t.length,t}),l+="';\n",h||(c="obj",r?l="with("+c+"){"+l+"}":(n=RegExp("(\\(\\s*)"+c+"\\."+c+"\\b","g"),l=l.replace(ht,"$&"+c+".").replace(n,"$1__d"))),l=(r?l.replace(at,""):l).replace(ft,"$1").replace(lt,"$1;"),l="function("+c+"){"+(h?"":c+"||("+c+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":( +h?"":",__d="+c+"."+c+"||"+c)+";")+l+"return __p}";try{i=o("_","return "+l)(s)}catch(d){throw d.source=l,d}return t?i(t):(i.source=l,i)},s.throttle=function(e,t){function n(){a=new Date,u=r,s=e.apply(o,i)}var i,s,o,u,a=0;return function(){var f=new Date,l=t-(f-a);return i=arguments,o=this,0>=l?(clearTimeout(u),u=r,a=f,s=e.apply(o,i)):u||(u=setTimeout(n,l)),s}},s.unescape=function(e){return e==r?"":(e+"").replace(ut,y)},s.uniqueId=function(e){return(e==r?"":e+"")+ ++nt},s.wrap=function(e,t){return function( +){var n=[e];return Nt.apply(n,arguments),t.apply(this,n)}},s.detect=H,s.foldl=I,s.foldr=q,s.include=_,s.inject=I,pn(s,function(e,t){s.prototype[t]||(s.prototype[t]=function(){var t=[this.__wrapped__];return Nt.apply(t,arguments),e.apply(s,t)})}),s.first=U,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:g(e,Dt(0,i-t))}},s.take=U,s.head=U,pn(s,function(e,t){s.prototype[t]||(s.prototype[t]=function(t,n){var i=e(this.__wrapped__,t,n);return t==r||n?i:new s(i)})}),s.VERSION="1.0.0-rc.1" +,s.prototype.chain=function(){return this},s.prototype.toString=function(){return""+this.__wrapped__},s.prototype.value=G,s.prototype.valueOf=G,wn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=et[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Gt&&e.length===0&&delete e[0],this}}),wn(["concat","join","slice"],function(e){var t=et[e];s.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return new s(e)}}),typeof define=="function"&&typeof +define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):Y?"object"==typeof module&&module&&module.exports==Y?(module.exports=s)._=s:Y._=s:e._=s})(this); \ No newline at end of file diff --git a/lodash.underscore.js b/lodash.underscore.js index 64759cb5f..43c658d32 100644 --- a/lodash.underscore.js +++ b/lodash.underscore.js @@ -133,7 +133,6 @@ var hasObjectSpliceBug = (hasObjectSpliceBug = { '0': 1, 'length': 1 }, arrayRef.splice.call(hasObjectSpliceBug, 0, 1), hasObjectSpliceBug[0]); - /** * Detect lack of support for accessing string characters by index: * @@ -615,7 +614,6 @@ for (index in iteratee) { if (callback(iteratee[index], index, collection) === indicatorObject) return result; } - ; return result }; @@ -649,7 +647,6 @@ if (callback(iteratee[index], index, collection) === indicatorObject) return result; } } - ; return result }; @@ -765,6 +762,7 @@ ? (isArray(value) ? slice(value) : assign({}, value)) : value } + /** * Assigns own enumerable properties of source object(s) to the `destination` * object for all `destination` properties that resolve to `null`/`undefined`. @@ -799,6 +797,7 @@ } return object; } + /** * Creates a sorted array of all enumerable properties, own and inherited, * of `object` that have function values. @@ -970,6 +969,7 @@ } return true; } + /** * Performs a deep comparison between two values to determine if they are * equivalent to each other. @@ -1140,8 +1140,9 @@ * // => false */ function isFinite(value) { - return nativeIsFinite(value) && toString.call(value) == numberClass; + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); } + /** * Checks if `value` is a function. * @@ -1365,6 +1366,7 @@ }); return result; } + /** * Creates a two dimensional array of the given object's key-value pairs, * i.e. `[[key1, value1], [key2, value2]]`. @@ -1426,6 +1428,7 @@ } return result; } + /** * Creates an array composed of the own enumerable property values of `object`. * @@ -1488,6 +1491,7 @@ } return result; } + /** * Creates an object composed of keys returned from running each element of * `collection` through a `callback`. The corresponding value of each key is @@ -1677,7 +1681,6 @@ } } } - ; }; @@ -2252,6 +2255,7 @@ } return result } + /** * Gets the first element of the `array`. Pass `n` to return the first `n` * elements of the `array`. @@ -2417,6 +2421,7 @@ }); return result; } + /** * Gets the last element of the `array`. Pass `n` to return the last `n` * elements of the `array`. @@ -2691,6 +2696,11 @@ result = [], seen = result; + if (typeof isSorted == 'function') { + thisArg = callback; + callback = isSorted; + isSorted = false; + } if (callback) { seen = []; callback = createCallback(callback, thisArg); @@ -2711,6 +2721,7 @@ } return result; } + /** * Creates an array with all occurrences of the passed values removed using * strict equality for comparisons, i.e. `===`. @@ -2739,6 +2750,7 @@ } return result } + /** * Groups the elements of each array at their corresponding indexes. Useful for * separate data sources that are coordinated through matching array indexes. @@ -3411,6 +3423,7 @@ result.source = source; return result; } + /** * Executes the `callback` function `n` times, returning an array of the results * of each `callback` execution. The `callback` is bound to `thisArg` and invoked @@ -3481,9 +3494,10 @@ * // => '105' */ function uniqueId(prefix) { - var id = idCounter++; + var id = ++idCounter + ''; return prefix ? prefix + id : id; } + /*--------------------------------------------------------------------------*/ /** @@ -3513,6 +3527,7 @@ value.__chain__ = true; return value; } + /** * 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, @@ -3561,6 +3576,7 @@ this.__chain__ = true; return this; } + /** * Produces the `toString` result of the wrapped value. * @@ -3596,44 +3612,77 @@ /*--------------------------------------------------------------------------*/ - /** - * The semantic version number. - * - * @static - * @memberOf _ - * @type String - */ - lodash.VERSION = '1.0.0-rc.1'; - lodash.after = after; - lodash.bind = bind; lodash.bindAll = bindAll; lodash.chain = chain; - lodash.clone = clone; - lodash.compact = compact; - lodash.compose = compose; - lodash.contains = contains; lodash.countBy = countBy; - lodash.debounce = debounce; lodash.defaults = defaults; - lodash.defer = defer; - lodash.delay = delay; lodash.difference = difference; - lodash.escape = escape; lodash.every = every; lodash.filter = filter; - lodash.find = find; - lodash.first = first; lodash.flatten = flatten; lodash.forEach = forEach; lodash.functions = functions; lodash.groupBy = groupBy; - lodash.has = has; - lodash.identity = identity; - lodash.indexOf = indexOf; lodash.initial = initial; lodash.intersection = intersection; lodash.invert = invert; lodash.invoke = invoke; + lodash.keys = keys; + lodash.map = map; + lodash.max = max; + lodash.min = min; + lodash.mixin = mixin; + lodash.object = object; + lodash.omit = omit; + lodash.pairs = pairs; + lodash.pick = pick; + lodash.pluck = pluck; + lodash.range = range; + lodash.reject = reject; + lodash.rest = rest; + lodash.shuffle = shuffle; + lodash.some = some; + lodash.sortBy = sortBy; + lodash.sortedIndex = sortedIndex; + lodash.tap = tap; + lodash.times = times; + lodash.toArray = toArray; + lodash.union = union; + lodash.uniq = uniq; + lodash.values = values; + lodash.where = where; + lodash.without = without; + lodash.zip = zip; + + // add aliases + lodash.all = every; + lodash.any = some; + lodash.collect = map; + lodash.drop = rest; + lodash.each = forEach; + lodash.extend = assign; + lodash.methods = functions; + lodash.select = filter; + lodash.tail = rest; + lodash.unique = uniq; + + /*--------------------------------------------------------------------------*/ + + // add functions that return unwrapped values when chaining + lodash.after = after; + lodash.bind = bind; + lodash.clone = clone; + lodash.compact = compact; + lodash.compose = compose; + lodash.contains = contains; + lodash.debounce = debounce; + lodash.defer = defer; + lodash.delay = delay; + lodash.escape = escape; + lodash.find = find; + lodash.has = has; + lodash.identity = identity; + lodash.indexOf = indexOf; lodash.isArray = isArray; lodash.isBoolean = isBoolean; lodash.isDate = isDate; @@ -3649,87 +3698,65 @@ lodash.isRegExp = isRegExp; lodash.isString = isString; lodash.isUndefined = isUndefined; - lodash.keys = keys; - lodash.last = last; lodash.lastIndexOf = lastIndexOf; - lodash.map = map; - lodash.max = max; lodash.memoize = memoize; - lodash.min = min; - lodash.mixin = mixin; lodash.noConflict = noConflict; - lodash.object = object; - lodash.omit = omit; lodash.once = once; - lodash.pairs = pairs; - lodash.pick = pick; - lodash.pluck = pluck; lodash.random = random; - lodash.range = range; lodash.reduce = reduce; lodash.reduceRight = reduceRight; - lodash.reject = reject; - lodash.rest = rest; lodash.result = result; - lodash.shuffle = shuffle; lodash.size = size; - lodash.some = some; - lodash.sortBy = sortBy; - lodash.sortedIndex = sortedIndex; - lodash.tap = tap; lodash.template = template; lodash.throttle = throttle; - lodash.times = times; - lodash.toArray = toArray; lodash.unescape = unescape; - lodash.union = union; - lodash.uniq = uniq; lodash.uniqueId = uniqueId; - lodash.values = values; - lodash.where = where; - lodash.without = without; lodash.wrap = wrap; - lodash.zip = zip; - // assign aliases - lodash.all = every; - lodash.any = some; - lodash.collect = map; + // add aliases lodash.detect = find; - lodash.drop = rest; - lodash.each = forEach; - lodash.extend = assign; lodash.foldl = reduce; lodash.foldr = reduceRight; - lodash.head = first; lodash.include = contains; lodash.inject = reduce; - lodash.methods = functions; - lodash.select = filter; - lodash.tail = rest; - lodash.take = first; - lodash.unique = uniq; /*--------------------------------------------------------------------------*/ - // add all static functions to `lodash.prototype` + // add functions capable of returning wrapped and unwrapped values when chaining + lodash.first = first; + lodash.last = last; + + // add aliases + lodash.take = first; + lodash.head = first; + + /*--------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type String + */ + lodash.VERSION = '1.0.0-rc.1'; + + // add functions to `lodash.prototype` mixin(lodash); - // add `lodash.prototype.chain` after calling `mixin()` to avoid overwriting - // it with the wrapped `lodash.chain` + // add "Chaining" functions to the wrapper lodash.prototype.chain = wrapperChain; lodash.prototype.value = wrapperValueOf; - // add all mutator Array functions to the wrapper. + // add mutator `Array` functions to the wrapper forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { var func = arrayRef[methodName]; - lodash.prototype[methodName] = function() { var value = this.__wrapped__; func.apply(value, arguments); - // avoid array-like object bugs with `Array#shift` and `Array#splice` in - // Firefox < 10 and IE < 9 + // avoid array-like object bugs with `Array#shift` and `Array#splice` + // in Firefox < 10 and IE < 9 if (hasObjectSpliceBug && value.length === 0) { delete value[0]; } @@ -3737,10 +3764,9 @@ }; }); - // add all accessor Array functions to the wrapper. + // add accessor `Array` functions to the wrapper forEach(['concat', 'join', 'slice'], function(methodName) { var func = arrayRef[methodName]; - lodash.prototype[methodName] = function() { var value = this.__wrapped__, result = func.apply(value, arguments); diff --git a/lodash.underscore.min.js b/lodash.underscore.min.js index b0bf235eb..77a981999 100644 --- a/lodash.underscore.min.js +++ b/lodash.underscore.min.js @@ -4,30 +4,30 @@ Underscore.js 1.4.2 underscorejs.org/LICENSE */ ;(function(e,t){function n(e){if(e&&"object"==typeof e&&e.__wrapped__)return e;if(!(this instanceof n))return new n(e);this.__wrapped__=e}function r(e,t){var n=e.b,r=t.b,e=e.a,t=t.a;if(e!==t){if(e>t||"undefined"==typeof e)return 1;if(en?0:n);++rr&&(r=n,u=e)});else for(;++iu&&(u=e[i]);return u}function L(e,t){return C(e,t+"")}function A(e,t,n,r){var i=3>arguments.length;return t||(t=I),Lt(e,function(e,s,o){n=i?(i=!1,e):t.call(r,n,e,s,o)}),n}function O(e,t,n,r){var i=e?e.length:0,s=3>arguments.length;if("number"!=typeof i)var o=kt(e),i=o.length;return t||(t=I -),Lt(e,function(u,a,f){a=o?o[--i]:--i,n=s?(s=!1,e[a]):t.call(r,n,e[a],a,f)}),n}function M(e,t,n){var r,t=s(t,n);if(Ct(e))for(var n=-1,i=e.length;++nn?at -(0,i+n):n||0)-1;else if(n)return r=B(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])P(a,f))n&&a.push(f),u.push(r)}return u}function F(e,t){return yt||it&&2"']/g,G=/['\n\r\t\u2028\u2029\\]/g,Y=Math.ceil,Z=z.concat,et=Math.floor,tt=U.hasOwnProperty,nt=z.push,rt=U.toString,it=J.test(it=f.bind)&&it,st=J.test(st=Array.isArray)&&st,ot=e.isFinite,ut=J.test(ut=Object.keys)&&ut,at=Math.max,ft=Math.min,lt=Math.random,ct="[object Array]",ht="[object Boolean]",pt="[object Date]",dt="[object Number]",vt="[object Object]",mt="[object RegExp]",gt="[object String]",U=!!e.attachEvent,U=it&&!/\n|true/.test(it+U),yt=it&&!U,bt=(bt={0:1,length -:1},z.splice.call(bt,0,1),bt[0]),wt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,"undefined":!1},Et={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},n.isArguments=function(e){return"[object Arguments]"==rt.call(e)},n.isArguments(arguments)||(n.isArguments=function(e){return e?tt.call(e,"callee"):!1});var St=function(e,t){var n;if(!e)return e -;t||(t=I);for(n in e)if(t(e[n],n,e)===X)break;return e},xt=function(e,t){var n;if(!e)return e;t||(t=I);for(n in e)if(tt.call(e,n)&&t(e[n],n,e)===X)break;return e},Tt={"&":"&","<":"<",">":">",'"':""","'":"'"},Nt=v(Tt),Ct=st||function(e){return rt.call(e)==ct};g(/x/)&&(g=function(e){return"[object Function]"==rt.call(e)});var kt=ut?function(e){return y(e)?ut(e):[]}:h,Lt=function(e,t,n){if(!e)return e;var t=t&&"undefined"==typeof n?t:s(t,n),r=e.length,n=-1;if("number"==typeof r){ -for(;++ne?t():function(){if(1>--e)return t.apply(this,arguments)}},n.bind=F,n.bindAll=function(e){for(var t=arguments,n=1P(r,s,n)&&i.push(s)}return i},n.escape=function(e){return null==e?"":(e+"").replace(Q,u)},n.every=x,n.filter=T,n.find=N,n.first=_,n.flatten=D,n.forEach=Lt,n.functions=d,n.groupBy=function(e,t,n){var r={ -},t=s(t,n);return Lt(e,function(e,n,i){n=t(e,n,i),(tt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},n.has=function(e,t){return e?tt.call(e,t):!1},n.identity=I,n.indexOf=P,n.initial=function(e,t,n){if(!e)return[];var r=e.length;return f(e,0,ft(at(0,r-(null==t||n?1:t||0)),r))},n.intersection=function(e){var t=arguments,n=t.length,r=[];return Lt(e,function(e){if(0>P(r,e)){for(var i=n;--i;)if(0>P(t[i],e))return;r.push(e)}}),r},n.invert=v,n.invoke=function(e,t){var n=f(arguments,2),r="function"==typeof t,i=[]; -return Lt(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},n.isArray=Ct,n.isBoolean=function(e){return!0===e||!1===e||rt.call(e)==ht},n.isDate=function(e){return rt.call(e)==pt},n.isElement=function(e){return e?1===e.nodeType:!1},n.isEmpty=function(e){if(!e)return!0;if(Ct(e)||w(e))return!e.length;for(var t in e)if(tt.call(e,t))return!1;return!0},n.isEqual=m,n.isFinite=function(e){return ot(e)&&rt.call(e)==dt},n.isFunction=g,n.isNaN=function(e){return b(e)&&e!=+e},n.isNull=function(e){return null=== -e},n.isNumber=b,n.isObject=y,n.isRegExp=function(e){return rt.call(e)==mt},n.isString=w,n.isUndefined=function(e){return"undefined"==typeof e},n.keys=kt,n.last=function(e,t,n){if(e){var r=e.length;return null==t||n?e[r-1]:f(e,at(0,r-t))}},n.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?at(0,r+n):ft(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},n.map=C,n.max=k,n.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return tt -.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},n.min=function(e,t,n){var r=Infinity,i=-1,o=e?e.length:0,u=r;if(t||!Ct(e))t=s(t,n),Lt(e,function(e,n,i){n=t(e,n,i),nP(t,r,1)&&(n[r]=e)}),n},n.once=function( -e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}},n.pairs=function(e){var t=[];return xt(e,function(e,n){t.push([n,e])}),t},n.pick=function(e){for(var t=0,n=Z.apply(z,arguments),r=n.length,i={};++t=f?(clearTimeout(o),o=null,u=a,i=e.apply(s,r)):o||(o=setTimeout(n,f)),i}},n.times=function(e,t,n){for(var e=+ -e||0,r=-1,i=Array(e);++rP(arguments,i,1)&&r.push(i)}return r},n.wrap=function(e,t){return function(){var n=[e];return nt.apply(n,arguments),t.apply(this,n)}},n.zip=function(e){for(var t=-1,n=e?k(L(arguments,"length")):0,r=Array(n);++tn?0:n);++rr&&(r=n,u=e)});else for(;++iu&&(u=e[i]);return u}function L(e,t){return C(e,t+"")}function A(e,t,n,r){var i=3>arguments.length;return t||(t=I),At(e,function(e,s,o){n=i?(i=!1,e):t.call(r,n,e,s,o)}),n}function O(e,t,n,r){var i=e?e.length:0,s=3>arguments.length;if("number"!=typeof i)var o=Lt(e),i=o.length;return t||(t=I +),At(e,function(u,a,f){a=o?o[--i]:--i,n=s?(s=!1,e[a]):t.call(r,n,e[a],a,f)}),n}function M(e,t,n){var r,t=s(t,n);if(kt(e))for(var n=-1,i=e.length;++nn?ft +(0,i+n):n||0)-1;else if(n)return r=B(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])P(a,f))n&&a.push(f),u.push(r)}return u}function F(e,t){return bt|| +it&&2"']/g,G=/['\n\r\t\u2028\u2029\\]/g,Y=Math.ceil,Z=z.concat,et=Math.floor,tt=U.hasOwnProperty,nt=z.push,rt=U.toString,it=J.test(it=f.bind)&&it,st=J.test(st=Array.isArray)&&st,ot=e.isFinite,ut=e.isNaN,at=J.test(at=Object.keys)&&at,ft=Math.max,lt=Math.min,ct=Math.random,ht="[object Array]",pt="[object Boolean]",dt="[object Date]",vt="[object Number]",mt="[object Object]",gt="[object RegExp]",yt="[object String]",U=!!e.attachEvent,U=it&&!/\n|true/ +.test(it+U),bt=it&&!U,wt=(wt={0:1,length:1},z.splice.call(wt,0,1),wt[0]),Et={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,"undefined":!1},St={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},n.isArguments=function(e){return"[object Arguments]"==rt.call(e)},n.isArguments(arguments)||(n.isArguments=function(e){return e?tt.call(e,"callee"):!1} +);var xt=function(e,t){var n;if(!e)return e;t||(t=I);for(n in e)if(t(e[n],n,e)===X)break;return e},Tt=function(e,t){var n;if(!e)return e;t||(t=I);for(n in e)if(tt.call(e,n)&&t(e[n],n,e)===X)break;return e},Nt={"&":"&","<":"<",">":">",'"':""","'":"'"},Ct=v(Nt),kt=st||function(e){return rt.call(e)==ht};g(/x/)&&(g=function(e){return"[object Function]"==rt.call(e)});var Lt=at?function(e){return y(e)?at(e):[]}:h,At=function(e,t,n){if(!e)return e;var t=t&&"undefined"==typeof n?t:s(t +,n),r=e.length,n=-1;if("number"==typeof r){for(;++nP(r,s,n)&&i.push(s)}return i},n.every=x,n.filter=T,n.flatten=D,n.forEach=At,n.functions=d,n.groupBy=function(e,t,n){var r={},t=s(t,n);return At(e,function(e,n,i){n=t(e,n,i),(tt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},n.initial=function(e,t,n){if(!e)return[];var r=e.length;return f(e,0,lt(ft(0,r-(null==t||n?1:t||0)),r))},n.intersection=function(e){var t=arguments,n=t.length,r=[];return At(e,function(e){if(0>P(r,e)){for(var i=n;--i;)if(0>P(t[i],e))return; +r.push(e)}}),r},n.invert=v,n.invoke=function(e,t){var n=f(arguments,2),r="function"==typeof t,i=[];return At(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},n.keys=Lt,n.map=C,n.max=k,n.min=function(e,t,n){var r=Infinity,i=-1,o=e?e.length:0,u=r;if(t||!kt(e))t=s(t,n),At(e,function(e,n,i){n=t(e,n,i),nP(t,r,1)&&(n[r]=e)}),n},n.pairs=function(e){var t=[];return Tt(e,function(e,n){t.push([n,e])}),t},n.pick=function(e){for(var t=0,n=Z.apply(z,arguments),r=n.length,i={};++tP(arguments,i,1)&&r.push(i)}return r},n.zip=function(e){for(var t=-1,n=e?k(L(arguments,"length")):0,r=Array(n);++te?t():function(){if(1>--e)return t.apply(this,arguments)}},n.bind=F,n.clone=function(e){return e&&Et[typeof e]?kt(e)?f(e):c({},e):e},n.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++tn?ft(0,r+n):lt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},n.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return tt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},n.noConflict=function(){return e._=V,this},n.once=function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}},n.random=function(e,t){return null==e&&null==t&&(t=1),e=+e||0,null==t&&(t=e, +e=0),e+et(ct()*((+t||0)-e+1))},n.reduce=A,n.reduceRight=O,n.result=function(e,t){var n=e?e[t]:null;return g(n)?e[t]():n},n.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:Lt(e).length},n.template=function(e,t,r){e||(e="");var r=p({},r,n.templateSettings),i=0,s="__p+='",u=r.variable;e.replace(RegExp((r.escape||K).source+"|"+(r.interpolate||K).source+"|"+(r.evaluate||K).source+"|$","g"),function(t,n,r,u,a){s+=e.slice(i,a).replace(G,o),s+=n?"'+_['escape']("+n+")+'":u?"';"+u+";__p+='": +r?"'+((__t=("+r+"))==null?'':__t)+'":"",i=a+t.length}),s+="';\n",u||(u="obj",s="with("+u+"||{}){"+s+"}"),s="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+s+"return __p}";try{var a=Function("_","return "+s)(n)}catch(f){throw f.source=s,f}return t?a(t):(a.source=s,a)},n.throttle=function(e,t){function n(){u=new Date,o=null,i=e.apply(s,r)}var r,i,s,o,u=0;return function(){var a=new Date,f=t-(a-u);return r=arguments,s=this,0>=f?(clearTimeout(o) +,o=null,u=a,i=e.apply(s,r)):o||(o=setTimeout(n,f)),i}},n.unescape=function(e){return null==e?"":(e+"").replace($,l)},n.uniqueId=function(e){var t=++W+"";return e?e+t:t},n.wrap=function(e,t){return function(){var n=[e];return nt.apply(n,arguments),t.apply(this,n)}},n.detect=N,n.foldl=A,n.foldr=O,n.include=S,n.inject=A,n.first=_,n.last=function(e,t,n){if(e){var r=e.length;return null==t||n?e[r-1]:f(e,ft(0,r-t))}},n.take=_,n.head=_,n.VERSION="1.0.0-rc.1",q(n),n.prototype.chain=function(){return this +.__chain__=!0,this},n.prototype.value=function(){return this.__wrapped__},At("pop push reverse shift sort splice unshift".split(" "),function(e){var t=z[e];n.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),wt&&e.length===0&&delete e[0],this}}),At(["concat","join","slice"],function(e){var t=z[e];n.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new n(e),e.__chain__=!0),e}}),R?"object"==typeof module&&module&&module.exports==R?( +module.exports=n)._=n:R._=n:e._=n})(this); \ No newline at end of file