diff --git a/.editorconfig b/.editorconfig index 2dfda64b33..b889a368c1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,5 @@ charset = utf-8 end_of_line = lf indent_size = 2 indent_style = space -trim_trailing_whitespace = true - -[**.{html,js,json,md}] insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.jscsrc b/.jscsrc index 88be91a007..9af0673853 100644 --- a/.jscsrc +++ b/.jscsrc @@ -77,7 +77,6 @@ "disallowKeywords": ["with"], "disallowMixedSpacesAndTabs": true, "disallowMultipleLineBreaks": true, - "disallowMultipleLineStrings": true, "disallowNewlineBeforeBlockStatements": true, "disallowSpaceAfterObjectKeys": true, "disallowSpaceAfterPrefixUnaryOperators": true, diff --git a/.travis.yml b/.travis.yml index 8165ca11f5..1b4e30f9db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,8 @@ notifications: on_failure: always before_install: - "nvm use $TRAVIS_NODE_VERSION" - - "npm config set loglevel error" + - "npm set loglevel error" + - "npm set progress false" - "npm i -g npm@\"^2.0.0\"" - | PATTERN[0]="|\s*if\s*\(isHostObject\b[\s\S]+?\}(?=\n)|" diff --git a/README.md b/README.md index 5edbd55c39..50edc6245d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v4.0.1 +# lodash v4.1.0 The [lodash](https://lodash.com/) library exported as a [UMD](https://github.com/umdjs/umd) module. @@ -18,8 +18,8 @@ $ lodash core -o ./dist/lodash.core.js Lodash is also available in a variety of other builds & module formats. * [lodash](https://www.npmjs.com/package/lodash) & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) packages - * [lodash-amd](https://github.com/lodash/lodash/tree/4.0.1-amd) - * [lodash-es](https://github.com/lodash/lodash/tree/4.0.1-es) + * [lodash-amd](https://www.npmjs.com/package/lodash-amd) + * [lodash-es](https://www.npmjs.com/package/lodash-es) & [babel-plugin-lodash](https://www.npmjs.com/package/babel-plugin-lodash) ## Further Reading diff --git a/dist/lodash.core.js b/dist/lodash.core.js index 9aa3e4df8c..cdb750ecad 100644 --- a/dist/lodash.core.js +++ b/dist/lodash.core.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.0.1 (Custom Build) + * lodash 4.1.0 (Custom Build) * Build: `lodash core -o ./dist/lodash.core.js` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.0.1'; + var VERSION = '4.1.0'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -420,20 +420,21 @@ * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`, - * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, - * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, - * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, - * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`, - * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`, - * `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, - * `reject`, `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, - * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, - * `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, - * `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, - * `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, - * `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `without`, - * `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, and `zipWith` + * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, + * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, + * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, + * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, + * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, + * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, + * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, + * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, + * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, + * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, + * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, + * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, + * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, + * `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, @@ -1360,9 +1361,11 @@ */ function indexKeys(object) { var length = object ? object.length : undefined; - return (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) - ? baseTimes(length, String) - : null; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; } /** @@ -1871,36 +1874,6 @@ return baseEach(collection, toFunction(iteratee)); } - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it's - * invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invokeMap = rest(function(collection, path, args) { - var isFunc = typeof path == 'function'; - return baseMap(collection, function(value) { - var func = isFunc ? path : value[path]; - return func == null ? func : func.apply(value, args); - }); - }); - /** * Creates an array of values by running each element in `collection` through * `iteratee`. The iteratee is invoked with three arguments: @@ -1972,7 +1945,7 @@ * * _.reduce([1, 2], function(sum, n) { * return sum + n; - * }); + * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { @@ -2098,26 +2071,6 @@ /*------------------------------------------------------------------------*/ - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @type Function - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked - */ - var now = Date.now; - - /*------------------------------------------------------------------------*/ - /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent @@ -2593,9 +2546,16 @@ * // => false */ function isEmpty(value) { - return (!isObjectLike(value) || isFunction(value.splice)) - ? !size(value) - : !keys(value).length; + if (isArrayLike(value) && + (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { + return !value.length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; } /** @@ -2733,8 +2693,6 @@ * // => false */ function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } @@ -3720,7 +3678,6 @@ lodash.filter = filter; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; - lodash.invokeMap = invokeMap; lodash.iteratee = iteratee; lodash.keys = keys; lodash.map = map; @@ -3774,7 +3731,6 @@ lodash.min = min; lodash.noConflict = noConflict; lodash.noop = noop; - lodash.now = now; lodash.reduce = reduce; lodash.result = result; lodash.size = size; diff --git a/dist/lodash.core.min.js b/dist/lodash.core.min.js index fd454cbef1..608ebd491d 100644 --- a/dist/lodash.core.min.js +++ b/dist/lodash.core.min.js @@ -1,30 +1,30 @@ /** * @license - * lodash 4.0.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * lodash 4.1.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE * Build: `lodash core -o ./dist/lodash.core.js` */ -;(function(){function n(n,t){for(var r=-1,e=t.length,u=n.length;++r-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){if(Z(n)&&!Vn(n)){if(n instanceof l)return n;if(En.call(n,"__wrapped__")){var t=new l(n.__wrapped__,n.__chain__);return t.__actions__=k(n.__actions__),t}}return new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){return n===ln||H(n,xn[r])&&!En.call(e,r)?t:n; -}function s(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(ln,r)},t)}function h(n,t){var r=true;return $n(n,function(n,e,u){return r=!!t(n,e,u)}),r}function v(n,t){var r=[];return $n(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u){u||(u=[]);for(var o=-1,i=t.length;++ot&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:ln,o=typeof o=="function"?(u--,o):ln;for(t=Object(t);++ef))return false;for(a=true;++iarguments.length,$n)}function P(n){return null==n?0:(n=Q(n)?n:un(n),n.length)}function U(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function"); -return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=ln),r}}function V(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=Rn(t===ln?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=Rn(r.length-t,0),o=Array(u);++et}function L(n){return Z(n)&&Q(n)&&En.call(n,"callee")&&(!Fn.call(n,"callee")||"[object Arguments]"==kn.call(n)); -}function Q(n){return null!=n&&!(typeof n=="function"&&W(n))&&X(Mn(n))}function W(n){return n=Y(n)?kn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function X(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function Y(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function Z(n){return!!n&&typeof n=="object"}function nn(n){return typeof n=="number"||Z(n)&&"[object Number]"==kn.call(n)}function tn(n){return typeof n=="string"||!Vn(n)&&Z(n)&&"[object String]"==kn.call(n); -}function rn(n,t){return t>n}function en(n){return typeof n=="string"?n:null==n?"":n+""}function un(n){var t=M(n);if(!t&&!Q(n))return Dn(Object(n));var r,e=q(n),u=!!e,e=e||[],o=e.length;for(r in n)!En.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function on(n){for(var t=-1,r=M(n),e=d(n),u=e.length,o=q(n),i=!!o,o=o||[],c=o.length;++t"'`]/g,sn=RegExp(pn.source),hn=/^(?:0|[1-9]\d*)$/,vn={ -"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},yn={"function":true,object:true},_n=yn[typeof exports]&&exports&&!exports.nodeType?exports:null,gn=yn[typeof module]&&module&&!module.nodeType?module:null,bn=o(yn[typeof self]&&self),jn=o(yn[typeof window]&&window),mn=gn&&gn.exports===_n?_n:null,dn=o(yn[typeof this]&&this),wn=o(_n&&gn&&typeof global=="object"&&global)||jn!==(dn&&dn.window)&&jn||bn||dn||Function("return this")(),On=Array.prototype,xn=Object.prototype,En=xn.hasOwnProperty,An=0,kn=xn.toString,Nn=wn._,Sn=wn.f,Tn=Sn?Sn.g:ln,Fn=xn.propertyIsEnumerable,Bn=wn.isFinite,Dn=Object.keys,Rn=Math.max,In=function(){ -function n(){}return function(t){if(Y(t)){n.prototype=t;var r=new n;n.prototype=ln}return r||{}}}(),$n=function(n,t){return function(r,e){if(null==r)return r;if(!Q(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++oe&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?k(n):[]:cn(n)},a.values=cn,a.extend=Qn,an(a,a),a.clone=function(n){return Y(n)?Vn(n)?k(n):T(n,un(n)):n},a.escape=function(n){ -return(n=en(n))&&sn.test(n)?n.replace(pn,i):n},a.every=function(n,t,r){return t=r?ln:t,h(n,m(t))},a.find=C,a.forEach=G,a.has=function(n,t){return null!=n&&En.call(n,t)},a.head=z,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){if(Y(n)&&!Mn(n)){if(n instanceof l)return n;if(xn.call(n,"__wrapped__")){var t=new l(n.__wrapped__,n.__chain__);return t.__actions__=k(n.__actions__),t}}return new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){return n===an||V(n,On[r])&&!xn.call(e,r)?t:n; +}function s(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(an,r)},t)}function h(n,t){var r=true;return In(n,function(n,e,u){return r=!!t(n,e,u)}),r}function v(n,t){var r=[];return In(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u){u||(u=[]);for(var o=-1,i=t.length;++ot&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:an,o=typeof o=="function"?(u--,o):an;for(t=Object(t);++ef))return false;for(a=true;++iarguments.length,In)}function P(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Pn(n), +function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=an),r}}function U(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=Rn(t===an?n.length-1:Pn(t),0),function(){for(var r=arguments,e=-1,u=Rn(r.length-t,0),o=Array(u);++et}function K(n){return Y(n)&&L(n)&&xn.call(n,"callee")&&(!Tn.call(n,"callee")||"[object Arguments]"==An.call(n)); +}function L(n){return null!=n&&!(typeof n=="function"&&Q(n))&&W(qn(n))}function Q(n){return n=X(n)?An.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function W(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function X(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function Y(n){return!!n&&typeof n=="object"}function Z(n){return typeof n=="number"||Y(n)&&"[object Number]"==An.call(n)}function nn(n){return typeof n=="string"||!Mn(n)&&Y(n)&&"[object String]"==An.call(n); +}function tn(n,t){return t>n}function rn(n){return typeof n=="string"?n:null==n?"":n+""}function en(n){var t=z(n);if(!t&&!L(n))return Bn(Object(n));var r,e=q(n),u=!!e,e=e||[],o=e.length;for(r in n)!xn.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function un(n){for(var t=-1,r=z(n),e=d(n),u=e.length,o=q(n),i=!!o,o=o||[],c=o.length;++t"'`]/g,pn=RegExp(ln.source),sn=/^(?:0|[1-9]\d*)$/,hn={ +"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},vn={"function":true,object:true},yn=vn[typeof exports]&&exports&&!exports.nodeType?exports:null,_n=vn[typeof module]&&module&&!module.nodeType?module:null,gn=o(vn[typeof self]&&self),bn=o(vn[typeof window]&&window),jn=_n&&_n.exports===yn?yn:null,mn=o(vn[typeof this]&&this),dn=o(yn&&_n&&typeof global=="object"&&global)||bn!==(mn&&mn.window)&&bn||gn||mn||Function("return this")(),wn=Array.prototype,On=Object.prototype,xn=On.hasOwnProperty,En=0,An=On.toString,kn=dn._,Nn=dn.f,Sn=Nn?Nn.g:an,Tn=On.propertyIsEnumerable,Fn=dn.isFinite,Bn=Object.keys,Rn=Math.max,Dn=function(){ +function n(){}return function(t){if(X(t)){n.prototype=t;var r=new n;n.prototype=an}return r||{}}}(),In=function(n,t){return function(r,e){if(null==r)return r;if(!L(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++oe&&!c||!i||u&&!f&&a||o&&a){ +r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return L(n)?n.length?k(n):[]:on(n)},a.values=on,a.extend=Hn,fn(a,a),a.clone=function(n){return X(n)?Mn(n)?k(n):T(n,en(n)):n},a.escape=function(n){return(n=rn(n))&&pn.test(n)?n.replace(ln,i):n},a.every=function(n,t,r){return t=r?an:t,h(n,m(t))},a.find=G,a.forEach=J,a.has=function(n,t){return null!=n&&xn.call(n,t)},a.head=C, +a.identity=cn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r2?r-2:1,t=e(t);var n=t.length;return n&&r>=n?t:m(t,r)}},mixin:function(e){return function(t){var r=this;if(!h(r))return e(r,Object(t));var n=[],i=[];return l(d(t),function(e){var a=t[e];h(a)&&(i.push(e),n.push(r.prototype[e]))}),e(r,Object(t)),l(i,function(e,t){var i=n[t];h(i)?r.prototype[e]=i:delete r.prototype[e]}),r}},runInContext:function(t){return function(r){return n(e,t(r))}}},E=function(e,t){var r=k[e];if(r)return r(t);a.array[e]?t=R(t,v):a.object[e]?t=R(t,W(t)):a.set[e]&&(t=R(t,f)); -var n;return l(i.caps,function(r){return l(i.aryMethod[r],function(a){if(e==a){var o=i.iterateeRearg[e],s=!u&&i.aryIteratee[e];return n=c(t,r),r>1&&!i.skipRearg[e]&&(n=y(n,i.methodRearg[e]||i.aryRearg[r])),o?n=I(n,o):s&&(n=x(n,s)),r>1&&(n=p(n,r)),!1}}),!n}),n||(n=t),i.placeholder[e]&&(n.placeholder=o),n};if(!u)return E(t,r);var B=[];return l(i.caps,function(e){l(i.aryMethod[e],function(e){var t=s[i.key[e]||e];t&&B.push([e,E(e,t)])})}),l(B,function(e){s[e[0]]=e[1]}),l(d(s),function(e){l(i.alias[e]||[],function(t){ -s[t]=s[e]})}),s}var i=r(2),a=i.mutate,o={};e.exports=n},function(e,t){e.exports={alias:{ary:["nAry"],assignIn:["extend"],assignInWith:["extendWith"],filter:["whereEq"],flatten:["unnest"],flow:["pipe"],flowRight:["compose"],forEach:["each"],forEachRight:["eachRight"],get:["path","prop"],getOr:["pathOr","propOr"],head:["first"],includes:["contains"],initial:["init"],isEqual:["equals"],mapValues:["mapObj"],matchesProperty:["pathEq"],omit:["dissoc","omitAll"],overArgs:["useWith"],overEvery:["allPass"], -overSome:["somePass"],pick:["pickAll"],propertyOf:["propOf"],rest:["unapply"],some:["all"],spread:["apply"],zipObject:["zipObj"]},aryIteratee:{assignWith:2,assignInWith:2,cloneDeepWith:1,cloneWith:1,dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findIndex:1,findKey:1,findLast:1,findLastIndex:1,findLastKey:1,flatMap:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,isEqualWith:2,isMatchWith:2,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1, -some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},aryMethod:{1:["attempt","ceil","create","curry","curryRight","floor","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","template","trim","trimEnd","trimStart","uniqueId","words"],2:["add","after","ary","assign","at","before","bind","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","extend","filter","find","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","merge","minBy","omit","omitBy","orderBy","overArgs","pad","padEnd","padStart","parseInt","partition","pick","pickBy","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject"], -3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","getOr","inRange","intersectionBy","intersectionWith","isEqualWith","isMatchWith","mergeWith","pullAllBy","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","xorBy","xorWith","zipWith"],4:["fill","setWith"]},aryRearg:{2:[1,0],3:[2,1,0],4:[3,2,0,1]},iterateeRearg:{findKey:[1],findLastKey:[1],mapKeys:[1]},methodRearg:{clamp:[2,0,1],reduce:[2,0,1],reduceRight:[2,0,1], -set:[2,0,1],setWith:[3,1,2,0],slice:[2,0,1],transform:[2,0,1]},caps:[1,2,3,4],key:{curryN:"curry",curryRightN:"curryRight",getOr:"get"},mutate:{array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignIn:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsDeep:!0,merge:!0,mergeWith:!0},set:{set:!0,setWith:!0}},placeholder:{bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},skipRearg:{assign:!0,assignIn:!0,concat:!0,defaults:!0,defaultsDeep:!0, -difference:!0,matchesProperty:!0,merge:!0,random:!0,range:!0,rangeRight:!0,zip:!0,zipObject:!0}}}])}); \ No newline at end of file +if("function"!=typeof r&&(r=t,t=void 0),null==r)throw new TypeError;var s=void 0===t&&"string"==typeof r.VERSION,u=s?r:{ary:e.ary,cloneDeep:e.cloneDeep,curry:e.curry,forEach:e.forEach,isFunction:e.isFunction,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg},c=u.ary,p=u.cloneDeep,f=u.curry,l=u.forEach,h=u.isFunction,d=u.keys,y=u.rearg,g=function(e,t){return 2==t?function(t,r){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}},m=function(e,t){return 2==t?function(t,r){return e(t,r); +}:function(t){return e(t)}},v=function(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r},W=function(e){return function(t){return e({},t)}},R=function(e,t){return O(e,t,!0)},x=function(e,t){return O(e,function(e){return m(e,t)})},I=function(e,t){return O(e,function(e){var r=t.length;return g(y(m(e,r),t),r)})},O=function(e,t,r){return function(){for(var n=arguments.length,i=Array(n);n--;)i[n]=arguments[n];i[0]=t(i[0]);var a=e.apply(void 0,i);return r?i[0]:a}},b={iteratee:function(e){return function(){ +var t=arguments[0],r=arguments[1];r=r>2?r-2:1,t=e(t);var n=t.length;return n&&r>=n?t:m(t,r)}},mixin:function(e){return function(t){var r=this;if(!h(r))return e(r,Object(t));var n=[],i=[];return l(d(t),function(e){var a=t[e];h(a)&&(i.push(e),n.push(r.prototype[e]))}),e(r,Object(t)),l(i,function(e,t){var i=n[t];h(i)?r.prototype[e]=i:delete r.prototype[e]}),r}},runInContext:function(t){return function(r){return n(e,t(r))}}},k=function(e,t){e=i.aliasToReal[e]||e;var r=b[e];if(r)return r(t);a.array[e]?t=R(t,v):a.object[e]?t=R(t,W(t)):a.set[e]&&(t=R(t,p)); +var n;return l(i.caps,function(r){return l(i.aryMethod[r],function(a){if(e==a){var o=i.iterateeRearg[e],u=!s&&i.aryIteratee[e];return n=c(t,r),r>1&&!i.skipRearg[e]&&(n=y(n,i.methodRearg[e]||i.aryRearg[r])),o?n=I(n,o):u&&(n=x(n,u)),r>1&&(n=f(n,r)),!1}}),!n}),n||(n=t),i.placeholder[e]&&(n.placeholder=o),n};if(!s)return k(t,r);var B=[];return l(i.caps,function(e){l(i.aryMethod[e],function(e){var t=u[i.key[e]||e];t&&B.push([e,k(e,t)])})}),l(B,function(e){u[e[0]]=e[1]}),l(d(u),function(e){l(i.realToAlias[e]||[],function(t){ +u[t]=u[e]})}),u}var i=r(2),a=i.mutate,o={};e.exports=n},function(e,t){t.aliasToReal={all:"some",allPass:"overEvery",apply:"spread",compose:"flowRight",contains:"includes",dissoc:"omit",each:"forEach",eachRight:"forEachRight",equals:"isEqual",extend:"assignIn",extendWith:"assignInWith",first:"head",init:"initial",mapObj:"mapValues",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",pickAll:"pick",pipe:"flow",prop:"get",propOf:"propertyOf",propOr:"getOr",somePass:"overSome", +unapply:"rest",unnest:"flatten",useWith:"overArgs",whereEq:"filter",zipObj:"zipObject"},t.aryIteratee={assignWith:2,assignInWith:2,cloneDeepWith:1,cloneWith:1,dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findIndex:1,findKey:1,findLast:1,findLastIndex:1,findLastKey:1,flatMap:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,isEqualWith:2,isMatchWith:2,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1, +transform:2},t.aryMethod={1:["attempt","ceil","create","curry","curryRight","floor","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","template","trim","trimEnd","trimStart","uniqueId","words"],2:["add","after","ary","assign","assignIn","at","before","bind","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","merge","minBy","omit","omitBy","orderBy","overArgs","pad","padEnd","padStart","parseInt","partition","pick","pickBy","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"], +3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","getOr","inRange","intersectionBy","intersectionWith","isEqualWith","isMatchWith","mergeWith","pullAllBy","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","xorBy","xorWith","zipWith"],4:["fill","setWith"]},t.aryRearg={2:[1,0],3:[2,1,0],4:[3,2,0,1]},t.iterateeRearg={findKey:[1],findLastKey:[1],mapKeys:[1]},t.methodRearg={assignInWith:[1,2,0],assignWith:[1,2,0], +clamp:[2,0,1],mergeWith:[1,2,0],reduce:[2,0,1],reduceRight:[2,0,1],set:[2,0,1],setWith:[3,1,2,0],slice:[2,0,1],transform:[2,0,1]},t.caps=[1,2,3,4],t.key={curryN:"curry",curryRightN:"curryRight",getOr:"get"},t.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignIn:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsDeep:!0,merge:!0,mergeWith:!0},set:{set:!0,setWith:!0}},t.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0 +},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,r=t.aliasToReal,n={};for(var i in r){var a=r[i];e.call(n,a)?n[a].push(i):n[a]=[i]}return n}(),t.skipRearg={assign:!0,assignIn:!0,concat:!0,difference:!0,matchesProperty:!0,merge:!0,random:!0,range:!0,rangeRight:!0,zip:!0,zipObject:!0}}])}); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index bcbae62efd..a5c9206ee1 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.0.1 (Custom Build) + * lodash 4.1.0 (Custom Build) * Build: `lodash -o ./dist/lodash.js` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.0.1'; + var VERSION = '4.1.0'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -411,6 +411,27 @@ return func.apply(thisArg, args); } + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + /** * Creates a new array concatenating `array` with `other`. * @@ -820,7 +841,7 @@ result = result === undefined ? current : (result + current); } } - return result; + return length ? result : 0; } /** @@ -1378,20 +1399,21 @@ * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`, - * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, - * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, - * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, - * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`, - * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`, - * `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, - * `reject`, `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, - * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, - * `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, - * `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, - * `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, - * `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `without`, - * `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, and `zipWith` + * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, + * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, + * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, + * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, + * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, + * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, + * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, + * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, + * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, + * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, + * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, + * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, + * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, + * `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, @@ -2123,6 +2145,24 @@ } } + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. @@ -2669,6 +2709,24 @@ return result; } + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + /** * The base implementation of `_.invoke` without support for individual * method arguments. @@ -2999,7 +3057,7 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = object[key], srcValue = source[key], - stacked = stack.get(srcValue) || stack.get(objValue); + stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); @@ -3018,6 +3076,7 @@ newValue = copyArray(objValue); } else { + isCommon = false; newValue = baseClone(srcValue); } } @@ -3026,6 +3085,7 @@ newValue = toPlainObject(objValue); } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + isCommon = false; newValue = baseClone(srcValue); } else { @@ -3626,6 +3686,27 @@ return (result && result.length) ? baseUniq(result, iteratee, comparator) : []; } + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property names. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + assignFunc(result, props[index], index < valsLength ? values[index] : undefined); + } + return result; + } + /** * Creates a clone of `buffer`. * @@ -3843,29 +3924,16 @@ * Creates a function like `_.groupBy`. * * @private - * @param {Function} setter The function to set keys and values of the accumulator object. - * @param {Function} [initializer] The function to initialize the accumulator object. + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { - var result = initializer ? initializer() : {}; - iteratee = getIteratee(iteratee); - - if (isArray(collection)) { - var index = -1, - length = collection.length; + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; - while (++index < length) { - var value = collection[index]; - setter(result, value, iteratee(value), collection); - } - } else { - baseEach(collection, function(value, key, collection) { - setter(result, value, iteratee(value), collection); - }); - } - return result; + return func(collection, setter, getIteratee(iteratee), accumulator); }; } @@ -4198,6 +4266,20 @@ return wrapper; } + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + /** * Creates a function like `_.over`. * @@ -4840,8 +4922,11 @@ result = hasFunc(object, path); } } - return result || (isLength(object && object.length) && isIndex(path, object.length) && - (isArray(object) || isString(object) || isArguments(object))); + var length = object ? object.length : undefined; + return result || ( + !!length && isLength(length) && isIndex(path, length) && + (isArray(object) || isString(object) || isArguments(object)) + ); } /** @@ -4871,6 +4956,9 @@ * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { + if (isPrototype(object)) { + return {}; + } var Ctor = object.constructor; return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); } @@ -4930,9 +5018,11 @@ */ function indexKeys(object) { var length = object ? object.length : undefined; - return (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) - ? baseTimes(length, String) - : null; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; } /** @@ -6908,19 +6998,29 @@ * @returns {Object} Returns the new object. * @example * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { - var index = -1, - length = props ? props.length : 0, - valsLength = values ? values.length : 0, - result = {}; + return baseZipObject(props || [], values || [], assignValue); + } - while (++index < length) { - baseSet(result, props[index], index < valsLength ? values[index] : undefined); - } - return result; + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} [props=[]] The property names. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); } /** @@ -7651,17 +7751,17 @@ * @returns {Object} Returns the composed aggregate object. * @example * - * var keyData = [ + * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * - * _.keyBy(keyData, function(o) { + * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * - * _.keyBy(keyData, 'dir'); + * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { @@ -7820,7 +7920,7 @@ * * _.reduce([1, 2], function(sum, n) { * return sum + n; - * }); + * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { @@ -9458,9 +9558,16 @@ * // => false */ function isEmpty(value) { - return (!isObjectLike(value) || isFunction(value.splice)) - ? !size(value) - : !keys(value).length; + if (isArrayLike(value) && + (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { + return !value.length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; } /** @@ -9685,8 +9792,6 @@ * // => false */ function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } @@ -10932,14 +11037,12 @@ /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values unless `multiVal` is `true`. + * assignments of previous values. * * @static * @memberOf _ * @category Object * @param {Object} object The object to invert. - * @param {boolean} [multiVal] Allow multiple values per key. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @returns {Object} Returns the new inverted object. * @example * @@ -10947,27 +11050,43 @@ * * _.invert(object); * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` through `iteratee`. + * The corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). * - * // with `multiVal` - * _.invert(object, true); + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to invert. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ - function invert(object, multiVal, guard) { - return arrayReduce(keys(object), function(result, key) { - var value = object[key]; - if (multiVal && !guard) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } - else { - result[value] = key; - } - return result; - }, {}); - } + var invertBy = createInverter(function(result, value, key) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); /** * Invokes the method at `path` of `object`. @@ -11468,12 +11587,12 @@ * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; - * }); + * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); - * }); + * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { @@ -13811,7 +13930,7 @@ function sum(array) { return (array && array.length) ? baseSum(array, identity) - : undefined; + : 0; } /** @@ -13839,7 +13958,7 @@ function sumBy(array, iteratee) { return (array && array.length) ? baseSum(array, getIteratee(iteratee)) - : undefined; + : 0; } /*------------------------------------------------------------------------*/ @@ -13928,6 +14047,7 @@ lodash.intersectionBy = intersectionBy; lodash.intersectionWith = intersectionWith; lodash.invert = invert; + lodash.invertBy = invertBy; lodash.invokeMap = invokeMap; lodash.iteratee = iteratee; lodash.keyBy = keyBy; @@ -14016,6 +14136,7 @@ lodash.xorWith = xorWith; lodash.zip = zip; lodash.zipObject = zipObject; + lodash.zipObjectDeep = zipObjectDeep; lodash.zipWith = zipWith; // Add aliases. diff --git a/dist/lodash.min.js b/dist/lodash.min.js index a9d10fb1dc..df3fea8e03 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -1,118 +1,118 @@ /** * @license - * lodash 4.0.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * lodash 4.1.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE * Build: `lodash -o ./dist/lodash.js` */ -;(function(){function n(n,t){return n.set(t[0],t[1]),n}function t(n,t){return n.add(t),n}function r(n,t,r){switch(r?r.length:0){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function e(n,t){for(var r=-1,e=n.length;++rt&&!o||!u||r&&!i&&f||e&&f)return 1;if(t>n&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function I(n){return Un[n]}function R(n){return Bn[n]}function S(n){return"\\"+$n[n]}function W(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t-1&&0==n%1&&(null==t?9007199254740991:t)>n}function B(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function z(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function L(n,t){for(var r=-1,e=n.length,u=-1,o=[];++rr?false:(r==n.length-1?n.pop():du.call(n,r,1), -!0)}function Zn(n,t){var r=Dn(n,t);return 0>r?Z:n[r][1]}function Dn(n,t){for(var r=n.length;r--;)if(ue(n[r][0],t))return r;return-1}function qn(n,t,r){var e=Dn(n,t);0>e?n.push([t,r]):n[e][1]=r}function Pn(n,t,r,e){return n===Z||ue(n,Xe[r])&&!tu.call(e,r)?t:n}function Tn(n,t,r){(r!==Z&&!ue(n[t],r)||typeof t=="number"&&r===Z&&!(t in n))&&(n[t]=r)}function Vn(n,t,r){var e=n[t];(!ue(e,r)||ue(e,Xe[t])&&!tu.call(n,t)||r===Z&&!(t in n))&&(n[t]=r)}function Jn(n,t){return n&&Tt(t,Ce(t),n)}function Yn(n,t){ -for(var r=-1,e=null==n,u=t.length,o=Array(u);++rr?r:n),t!==Z&&(n=t>n?t:n)),n}function Qn(n,t,r,u,o,i){var f;if(r&&(f=o?r(n,u,o,i):r(n)),f!==Z)return f;if(!pe(n))return n;if(u=Wo(n)){if(f=mr(n),!t)return Pt(n,f)}else{var c=br(n),a="[object Function]"==c||"[object GeneratorFunction]"==c;if("[object Object]"!=c&&"[object Arguments]"!=c&&(!a||o))return Cn[c]?wr(n,c,t):o?n:{};if(C(n))return o?n:{};if(f=jr(a?{}:n),!t)return Gt(n,Jn(f,n)); -}return i||(i=new $n),(o=i.get(n))?o:(i.set(n,f),(u?e:it)(n,function(e,u){Vn(f,u,Qn(e,t,r,u,n,i))}),u?f:Gt(n,f))}function Xn(n){var t=Ce(n),r=t.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=t[u],i=n[o],f=e[o];if(f===Z&&!(o in Object(e))||!i(f))return false}return true}}function nt(n,t,r){if(typeof n!="function")throw new He("Expected a function");return vu(function(){n.apply(Z,r)},t)}function tt(n,t,r,e){var u=-1,o=i,a=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,j(r))), -e?(o=f,a=false):t.length>=200&&(o=Ln,a=false,t=new zn(t));n:for(;++ur;)n=n[t[r++]];return r&&r==e?n:Z}function lt(n,t){return tu.call(n,t)||typeof n=="object"&&t in n&&null===hu(n)}function st(n,t){return t in Object(n)}function ht(n,t,r){for(var e=r?f:i,u=n.length,o=u,a=Array(u),l=[];o--;){var s=n[o];o&&t&&(s=c(s,j(t))),a[o]=r||!t&&120>s.length?Z:new zn(o&&s); -}var s=n[0],h=-1,p=s.length,_=a[0];n:for(;++he?c*("desc"==r[e]?-1:1):c;break n}}e=n.b-t.b}return e})}function wt(n,t){return n=Object(n),l(t,function(t,r){return r in n&&(t[r]=n[r]), -t},{})}function At(n,t){var r={};return ot(n,function(n,e){t(n,e)&&(r[e]=n)}),r}function Ot(n){return function(t){return null==t?Z:t[n]}}function Et(n){return function(t){return at(t,n)}}function kt(n,t,r){var e=-1,u=t.length,o=n;for(r&&(o=c(n,function(n){return r(n)}));++et&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e=u){for(;u>e;){var o=e+u>>>1,i=n[o];(r?t>=i:t>i)&&null!==i?e=o+1:u=o}return u}return Bt(n,t,Ne,r)}function Bt(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=null===t,c=t===Z;o>u;){var a=bu((u+o)/2),l=r(n[a]),s=l!==Z,h=l===l;(i?h||e:f?h&&s&&(e||null!=l):c?h&&(e||s):null==l?0:e?t>=l:t>l)?u=a+1:o=a}return Au(o,4294967294)}function zt(n,t){for(var r=0,e=n.length,u=n[0],o=t?t(u):u,i=o,f=0,c=[u];++r1?r[u-1]:Z,i=u>2?r[2]:Z,o=typeof o=="function"?(u--,o):Z;for(i&&Or(r[0],r[1],i)&&(o=3>u?Z:o,u=1),t=Object(t);++ei&&c[0]!==l&&c[i-1]!==l?[]:L(c,l),i-=f.length,e>i?ar(n,t,ur,l,Z,c,f,Z,Z,e-i):r(a,this,c)}var o=tr(n);return u}function er(n){return ee(function(t){t=ut(t);var r=t.length,e=r,u=jn.prototype.thru;for(n&&t.reverse();e--;){var o=t[e];if(typeof o!="function")throw new He("Expected a function");if(u&&!i&&"wrapper"==gr(o))var i=new jn([],true)}for(e=i?e:r;++e=200)return i.plant(e).value();for(var u=0,n=r?t[u].apply(this,n):e;++uy)return ar(n,t,ur,b,r,x,m,f,c,a-y)}if(y=h?r:this,b=p?y[n]:n,f)for(var m=x.length,j=Au(f.length,m),w=Pt(x);j--;){var A=f[j]; -x[j]=U(A,m)?w[A]:Z}else v&&x.length>1&&x.reverse();return s&&x.length>c&&(x.length=c),this&&this!==Kn&&this instanceof l&&(b=d||tr(b)),b.apply(y,x)}var s=128&t,h=1&t,p=2&t,_=8&t,g=16&t,v=512&t,d=p?Z:tr(n);return l}function or(n){return ee(function(t){return t=c(ut(t),vr()),ee(function(e){var u=this;return n(t,function(n){return r(n,u,e)})})})}function ir(n,t,r){return t=Ae(t),n=F(n),t&&t>n?(t-=n,r=r===Z?" ":r+"",n=Fe(r,yu(t/F(r))),En.test(r)?n.match(On).slice(0,t).join(""):n.slice(0,t)):""}function fr(n,t,e,u){ -function o(){for(var t=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Kn&&this instanceof o?f:n;++at?1:-1:Ee(e)||0;var u=-1;r=wu(yu((r-t)/(e||1)),0);for(var o=Array(r);r--;)o[n?r:++u]=t,t+=e;return o}}function ar(n,t,r,e,u,o,i,f,c,a){var l=8&t;f=f?Pt(f):Z; -var s=l?i:Z;i=l?Z:i;var h=l?o:Z;return o=l?Z:o,t=(t|(l?32:64))&~(l?64:32),4&t||(t&=-4),t=[n,t,u,h,s,o,i,f,c,a],r=r.apply(Z,t),Ir(n)&&Ju(r,t),r.placeholder=e,r}function lr(n){var t=Je[n];return function(n,r){if(n=Ee(n),r=Ae(r)){var e=(Ie(n)+"e").split("e"),e=t(e[0]+"e"+(+e[1]+r)),e=(Ie(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return t(n)}}function sr(n,t,r,e,u,o,i,f){var c=2&t;if(!c&&typeof n!="function")throw new He("Expected a function");var a=e?e.length:0;if(a||(t&=-97,e=u=Z),i=i===Z?i:wu(Ae(i),0), -f=f===Z?f:Ae(f),a-=u?u.length:0,64&t){var l=e,s=u;e=u=Z}var h=c?Z:Ku(n);return o=[n,t,r,e,u,l,s,o,i,f],h&&(r=o[1],n=h[1],t=r|n,e=128==n&&8==r||128==n&&256==r&&h[8]>=o[7].length||384==n&&h[8]>=h[7].length&&8==r,131>t||e)&&(1&n&&(o[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?Dt(e,r,h[4]):Pt(r),o[4]=e?L(o[3],"__lodash_placeholder__"):Pt(h[4])),(r=h[5])&&(e=o[5],o[5]=e?qt(e,r,h[6]):Pt(r),o[6]=e?L(o[5],"__lodash_placeholder__"):Pt(h[6])),(r=h[7])&&(o[7]=Pt(r)),128&n&&(o[8]=null==o[8]?h[8]:Au(o[8],h[8])), -null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=t),n=o[0],t=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:n.length:wu(o[9]-a,0),!f&&24&t&&(t&=-25),(h?Pu:Ju)(t&&1!=t?8==t||16==t?rr(n,t,f):32!=t&&33!=t||u.length?ur.apply(Z,o):fr(n,t,r,e):Qt(n,t,r),o)}function hr(n,t,r,e,u,o){var i=-1,f=2&u,c=1&u,a=n.length,l=t.length;if(!(a==l||f&&l>a))return false;if(l=o.get(n))return l==t;for(l=true,o.set(n,t);++it?0:t,e)):[]}function $r(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Ae(t),t=e-t,Wt(n,0,0>t?0:t)):[]}function Fr(n){return n?n[0]:Z; -}function Mr(n){var t=n?n.length:0;return t?n[t-1]:Z}function Nr(n,t){return n&&n.length&&t&&t.length?kt(n,t):n}function Zr(n){return n?ku.call(n):n}function Dr(n){if(!n||!n.length)return[];var t=0;return n=o(n,function(n){return ce(n)?(t=wu(n.length,t),true):void 0}),x(t,function(t){return c(n,Ot(t))})}function qr(n,t){if(!n||!n.length)return[];var e=Dr(n);return null==t?e:c(e,function(n){return r(t,Z,n)})}function Pr(n){return n=dn(n),n.__chain__=true,n}function Tr(n,t){return t(n)}function Kr(){return this; -}function Gr(n,t){return typeof t=="function"&&Wo(n)?e(n,t):Nu(n,Br(t))}function Vr(n,t){var r;if(typeof t=="function"&&Wo(n)){for(r=n.length;r--&&false!==t(n[r],r,n););r=n}else r=Zu(n,Br(t));return r}function Jr(n,t){var r=-1,e=we(n),u=e.length,o=u-1;for(t=Hn(Ae(t),0,u);++r=n&&(t=Z),r}}function Xr(n,t,r){return t=r?Z:t,n=sr(n,8,Z,Z,Z,Z,Z,t),n.placeholder=Xr.placeholder,n}function ne(n,t,r){return t=r?Z:t,n=sr(n,16,Z,Z,Z,Z,Z,t),n.placeholder=ne.placeholder,n}function te(n,t,r){function e(){p&&lu(p),a&&lu(a),g=0,c=a=h=p=_=Z}function u(t,r){r&&lu(r),a=p=_=Z,t&&(g=jo(),l=n.apply(h,c),p||a||(c=h=Z))}function o(){var n=t-(jo()-s); -0>=n||n>t?u(_,a):p=vu(o,n)}function i(){u(y,p)}function f(){if(c=arguments,s=jo(),h=this,_=y&&(p||!v),false===d)var r=v&&!p;else{a||v||(g=s);var e=d-(s-g),u=0>=e||e>d;u?(a&&(a=lu(a)),g=s,l=n.apply(h,c)):a||(a=vu(i,e))}return u&&p?p=lu(p):p||t===d||(p=vu(o,t)),r&&(u=true,l=n.apply(h,c)),!u||p||a||(c=h=Z),l}var c,a,l,s,h,p,_,g=0,v=false,d=false,y=true;if(typeof n!="function")throw new He("Expected a function");return t=Ee(t)||0,pe(r)&&(v=!!r.leading,d="maxWait"in r&&wu(Ee(r.maxWait)||0,t),y="trailing"in r?!!r.trailing:y), -f.cancel=e,f.flush=function(){return(p&&_||a&&y)&&(l=n.apply(h,c)),e(),l},f}function re(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=n.apply(this,e),r.cache=o.set(u,e),e)}if(typeof n!="function"||t&&typeof t!="function")throw new He("Expected a function");return r.cache=new re.Cache,r}function ee(n,t){if(typeof n!="function")throw new He("Expected a function");return t=wu(t===Z?n.length-1:Ae(t),0),function(){for(var e=arguments,u=-1,o=wu(e.length-t,0),i=Array(o);++ut}function ie(n){return ce(n)&&tu.call(n,"callee")&&(!gu.call(n,"callee")||"[object Arguments]"==uu.call(n))}function fe(n){return null!=n&&!(typeof n=="function"&&le(n))&&he(Gu(n))}function ce(n){return _e(n)&&fe(n)}function ae(n){return _e(n)&&typeof n.message=="string"&&"[object Error]"==uu.call(n); -}function le(n){return n=pe(n)?uu.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function se(n){return typeof n=="number"&&n==Ae(n)}function he(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function pe(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function _e(n){return!!n&&typeof n=="object"}function ge(n){return null==n?false:le(n)?iu.test(nu.call(n)):_e(n)&&(C(n)?iu:gn).test(n)}function ve(n){return typeof n=="number"||_e(n)&&"[object Number]"==uu.call(n); -}function de(n){if(!_e(n)||"[object Object]"!=uu.call(n)||C(n))return false;var t=Xe;return typeof n.constructor=="function"&&(t=hu(n)),null===t?true:(n=t.constructor,typeof n=="function"&&n instanceof n&&nu.call(n)==eu)}function ye(n){return pe(n)&&"[object RegExp]"==uu.call(n)}function be(n){return typeof n=="string"||!Wo(n)&&_e(n)&&"[object String]"==uu.call(n)}function xe(n){return typeof n=="symbol"||_e(n)&&"[object Symbol]"==uu.call(n)}function me(n){return _e(n)&&he(n.length)&&!!Wn[uu.call(n)]}function je(n,t){ -return t>n}function we(n){if(!n)return[];if(fe(n))return be(n)?n.match(On):Pt(n);if(_u&&n[_u])return B(n[_u]());var t=br(n);return("[object Map]"==t?z:"[object Set]"==t?$:ze)(n)}function Ae(n){if(!n)return 0===n?n:0;if(n=Ee(n),n===D||n===-D)return 1.7976931348623157e308*(0>n?-1:1);var t=n%1;return n===n?t?n-t:n:0}function Oe(n){return n?Hn(Ae(n),0,4294967295):0}function Ee(n){if(pe(n)&&(n=le(n.valueOf)?n.valueOf():n,n=pe(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(on,"");var t=_n.test(n); -return t||vn.test(n)?Mn(n.slice(2),t?2:8):pn.test(n)?q:+n}function ke(n){return Tt(n,Ue(n))}function Ie(n){if(typeof n=="string")return n;if(null==n)return"";if(xe(n))return cu?$u.call(n):"";var t=n+"";return"0"==t&&1/n==-D?"-0":t}function Re(n,t,r){return n=null==n?Z:at(n,t),n===Z?r:n}function Se(n,t){return xr(n,t,lt)}function We(n,t){return xr(n,t,st)}function Ce(n){var t=Rr(n);if(!t&&!fe(n))return ju(Object(n));var r,e=Ar(n),u=!!e,e=e||[],o=e.length;for(r in n)!lt(n,r)||u&&("length"==r||U(r,o))||t&&"constructor"==r||e.push(r); -return e}function Ue(n){for(var t=-1,r=Rr(n),e=dt(n),u=e.length,o=Ar(n),i=!!o,o=o||[],f=o.length;++tt||t>9007199254740991)return r;do t%2&&(r+=n),t=bu(t/2),n+=n;while(t);return r; -}function Me(n,t,r){return n=Ie(n),t=r?Z:t,t===Z&&(t=Rn.test(n)?In:kn),n.match(t)||[]}function Ne(n){return n}function Ze(n){return _e(n)&&!Wo(n)?De(n):vt(n)}function De(n){return bt(Qn(n,true))}function qe(n,t,r){var u=Ce(t),o=ct(t,u);null!=r||pe(t)&&(o.length||!u.length)||(r=t,t=n,n=this,o=ct(t,Ce(t)));var i=pe(r)&&"chain"in r?r.chain:true,f=le(n);return e(o,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__);return(r.__actions__=Pt(this.__actions__)).push({ -func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function Pe(){}function Te(n){return Er(n)?Ot(n):Et(n)}function Ke(n){return n&&n.length?b(n,Ne):Z}E=E?Gn.defaults({},E,Gn.pick(Kn,Sn)):Kn;var Ge=E.Date,Ve=E.Error,Je=E.Math,Ye=E.RegExp,He=E.TypeError,Qe=E.Array.prototype,Xe=E.Object.prototype,nu=E.Function.prototype.toString,tu=Xe.hasOwnProperty,ru=0,eu=nu.call(Object),uu=Xe.toString,ou=Kn._,iu=Ye("^"+nu.call(tu).replace(en,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fu=E.f,cu=E.Symbol,au=E.Uint8Array,lu=E.clearTimeout,su=fu?fu.g:Z,hu=Object.getPrototypeOf,pu=Object.getOwnPropertySymbols,_u=typeof(_u=cu&&cu.iterator)=="symbol"?_u:Z,gu=Xe.propertyIsEnumerable,vu=E.setTimeout,du=Qe.splice,yu=Je.ceil,bu=Je.floor,xu=E.isFinite,mu=Qe.join,ju=Object.keys,wu=Je.max,Au=Je.min,Ou=E.parseInt,Eu=Je.random,ku=Qe.reverse,Iu=yr(E,"Map"),Ru=yr(E,"Set"),Su=yr(E,"WeakMap"),Wu=yr(Object,"create"),Cu=Su&&new Su,Uu=Iu?nu.call(Iu):"",Bu=Ru?nu.call(Ru):"",zu=cu?cu.prototype:Z,Lu=cu?zu.valueOf:Z,$u=cu?zu.toString:Z,Fu={}; -dn.templateSettings={escape:H,evaluate:Q,interpolate:X,variable:"",imports:{_:dn}};var Mu=function(){function n(){}return function(t){if(pe(t)){n.prototype=t;var r=new n;n.prototype=Z}return r||{}}}(),Nu=Yt(it),Zu=Yt(ft,true),Du=Ht(),qu=Ht(true);su&&!gu.call({valueOf:1},"valueOf")&&(dt=function(n){return B(su(n))});var Pu=Cu?function(n,t){return Cu.set(n,t),n}:Ne,Tu=Ru&&2===new Ru([1,2]).size?function(n){return new Ru(n)}:Pe,Ku=Cu?function(n){return Cu.get(n)}:Pe,Gu=Ot("length"),Vu=pu||function(){return[]; -};(Iu&&"[object Map]"!=br(new Iu)||Ru&&"[object Set]"!=br(new Ru))&&(br=function(n){var t=uu.call(n);if(n="[object Object]"==t?n.constructor:null,n=typeof n=="function"?nu.call(n):""){if(n==Uu)return"[object Map]";if(n==Bu)return"[object Set]"}return t});var Ju=function(){var n=0,t=0;return function(r,e){var u=jo(),o=16-(u-t);if(t=u,o>0){if(150<=++n)return r}else n=0;return Pu(r,e)}}(),Yu=ee(function(n,t){Wo(n)||(n=null==n?[]:[Object(n)]),t=ut(t);for(var r=n,e=t,u=-1,o=r.length,i=-1,f=e.length,c=Array(o+f);++u1?n[t-1]:Z,t=typeof t=="function"?(n.pop(),t):Z;return qr(n,t)}),_o=ee(function(n){function t(t){return Yn(t,n)}n=ut(n);var r=n.length,e=r?n[0]:0,u=this.__wrapped__;return 1>=r&&!this.__actions__.length&&u instanceof wn&&U(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:Tr,args:[t],thisArg:Z}),new jn(u,this.__chain__).thru(function(n){return r&&!n.length&&n.push(Z),n})):this.thru(t)}),go=Vt(function(n,t,r){tu.call(n,r)?++n[r]:n[r]=1; -}),vo=Vt(function(n,t,r){tu.call(n,r)?n[r].push(t):n[r]=[t]}),yo=ee(function(n,t,e){var u=-1,o=typeof t=="function",i=Er(t),f=fe(n)?Array(n.length):[];return Nu(n,function(n){var c=o?t:i&&null!=n?n[t]:Z;f[++u]=c?r(c,n,e):pt(n,t,e)}),f}),bo=Vt(function(n,t,r){n[r]=t}),xo=Vt(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),mo=ee(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Or(n,t[0],t[1])?t=[]:r>2&&Or(t[0],t[1],t[2])&&(t.length=1),jt(n,ut(t),[])}),jo=Ge.now,wo=ee(function(n,t,r){ -var e=1;if(r.length)var u=L(r,wo.placeholder),e=32|e;return sr(n,e,t,r,u)}),Ao=ee(function(n,t,r){var e=3;if(r.length)var u=L(r,Ao.placeholder),e=32|e;return sr(t,e,n,r,u)}),Oo=ee(function(n,t){return nt(n,1,t)}),Eo=ee(function(n,t,r){return nt(n,Ee(t)||0,r)}),ko=ee(function(n,t){t=c(ut(t),vr());var e=t.length;return ee(function(u){for(var o=-1,i=Au(u.length,e);++oe.length?qn(e,n,t):(r.array=null,r.map=new Bn(e))),(r=r.map)&&r.set(n,t), -this},re.Cache=Bn,dn.after=function(n,t){if(typeof t!="function")throw new He("Expected a function");return n=Ae(n),function(){return 1>--n?t.apply(this,arguments):void 0}},dn.ary=Hr,dn.assign=Co,dn.assignIn=Uo,dn.assignInWith=Bo,dn.assignWith=zo,dn.at=Lo,dn.before=Qr,dn.bind=wo,dn.bindAll=Xo,dn.bindKey=Ao,dn.chain=Pr,dn.chunk=function(n,t){t=wu(Ae(t),0);var r=n?n.length:0;if(!r||1>t)return[];for(var e=0,u=-1,o=Array(yu(r/t));r>e;)o[++u]=Wt(n,e,e+=t);return o},dn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++tr&&(r=-r>u?0:u+r),e=e===Z||e>u?u:Ae(e),0>e&&(e+=u),e=r>e?0:Oe(e);e>r;)n[r++]=t;return n}, -dn.filter=function(n,t){return(Wo(n)?o:et)(n,vr(t,3))},dn.flatMap=function(n,t){return n&&n.length?ut(c(n,vr(t,3))):[]},dn.flatten=function(n){return n&&n.length?ut(n):[]},dn.flattenDeep=function(n){return n&&n.length?ut(n,true):[]},dn.flip=function(n){return sr(n,512)},dn.flow=ni,dn.flowRight=ti,dn.fromPairs=function(n){for(var t=-1,r=n?n.length:0,e={};++tt?0:t)):[]},dn.takeRight=function(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Ae(t),t=e-t,Wt(n,0>t?0:t,e)):[]},dn.takeRightWhile=function(n,t){return n&&n.length?Ft(n,vr(t,3),false,true):[]},dn.takeWhile=function(n,t){return n&&n.length?Ft(n,vr(t,3)):[]},dn.tap=function(n,t){return t(n),n},dn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new He("Expected a function");return pe(r)&&(e="leading"in r?!!r.leading:e, -u="trailing"in r?!!r.trailing:u),te(n,t,{leading:e,maxWait:t,trailing:u})},dn.thru=Tr,dn.toArray=we,dn.toPairs=Be,dn.toPairsIn=function(n){return m(n,Ue(n))},dn.toPath=function(n){return Wo(n)?c(n,String):Cr(n)},dn.toPlainObject=ke,dn.transform=function(n,t,r){var u=Wo(n)||me(n);if(t=vr(t,4),null==r)if(u||pe(n)){var o=n.constructor;r=u?Wo(n)?new o:[]:Mu(le(o)?o.prototype:Z)}else r={};return(u?e:it)(n,function(n,e,u){return t(r,n,e,u)}),r},dn.unary=function(n){return Hr(n,1)},dn.union=oo,dn.unionBy=io, -dn.unionWith=fo,dn.uniq=function(n){return n&&n.length?$t(n):[]},dn.uniqBy=function(n,t){return n&&n.length?$t(n,vr(t)):[]},dn.uniqWith=function(n,t){return n&&n.length?$t(n,Z,t):[]},dn.unset=function(n,t){var r;if(null==n)r=true;else{r=n;var e=t,e=Er(e,r)?[e+""]:Lt(e);r=Wr(r,e),e=Mr(e),r=null!=r&&Se(r,e)?delete r[e]:true}return r},dn.unzip=Dr,dn.unzipWith=qr,dn.values=ze,dn.valuesIn=function(n){return null==n?w(n,Ue(n)):[]},dn.without=co,dn.words=Me,dn.wrap=function(n,t){return t=null==t?Ne:t,Io(t,n); -},dn.xor=ao,dn.xorBy=lo,dn.xorWith=so,dn.zip=ho,dn.zipObject=function(n,t){for(var r=-1,e=n?n.length:0,u=t?t.length:0,o={};++rr?t[r]:Z);return o},dn.zipWith=po,dn.extend=Uo,dn.extendWith=Bo,qe(dn,dn),dn.add=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r+t),r},dn.attempt=Qo,dn.camelCase=Po,dn.capitalize=Le,dn.ceil=ai,dn.clamp=function(n,t,r){return r===Z&&(r=t,t=Z),r!==Z&&(r=Ee(r),r=r===r?r:0),t!==Z&&(t=Ee(t),t=t===t?t:0),Hn(Ee(n),t,r)},dn.clone=function(n){return Qn(n); -},dn.cloneDeep=function(n){return Qn(n,true)},dn.cloneDeepWith=function(n,t){return Qn(n,true,t)},dn.cloneWith=function(n,t){return Qn(n,false,t)},dn.deburr=$e,dn.endsWith=function(n,t,r){n=Ie(n),t=typeof t=="string"?t:t+"";var e=n.length;return r=r===Z?e:Hn(Ae(r),0,e),r-=t.length,r>=0&&n.indexOf(t,r)==r},dn.eq=ue,dn.escape=function(n){return(n=Ie(n))&&Y.test(n)?n.replace(V,R):n},dn.escapeRegExp=function(n){return(n=Ie(n))&&un.test(n)?n.replace(en,"\\$&"):n},dn.every=function(n,t,r){var e=Wo(n)?u:rt;return r&&Or(n,t,r)&&(t=Z), -e(n,vr(t,3))},dn.find=function(n,t){if(t=vr(t,3),Wo(n)){var r=g(n,t);return r>-1?n[r]:Z}return _(n,t,Nu)},dn.findIndex=function(n,t){return n&&n.length?g(n,vr(t,3)):-1},dn.findKey=function(n,t){return _(n,vr(t,3),it,true)},dn.findLast=function(n,t){if(t=vr(t,3),Wo(n)){var r=g(n,t,true);return r>-1?n[r]:Z}return _(n,t,Zu)},dn.findLastIndex=function(n,t){return n&&n.length?g(n,vr(t,3),true):-1},dn.findLastKey=function(n,t){return _(n,vr(t,3),ft,true)},dn.floor=li,dn.forEach=Gr,dn.forEachRight=Vr,dn.forIn=function(n,t){ -return null==n?n:Du(n,Br(t),Ue)},dn.forInRight=function(n,t){return null==n?n:qu(n,Br(t),Ue)},dn.forOwn=function(n,t){return n&&it(n,Br(t))},dn.forOwnRight=function(n,t){return n&&ft(n,Br(t))},dn.get=Re,dn.gt=oe,dn.gte=function(n,t){return n>=t},dn.has=Se,dn.hasIn=We,dn.head=Fr,dn.identity=Ne,dn.includes=function(n,t,r,e){return n=fe(n)?n:ze(n),r=r&&!e?Ae(r):0,e=n.length,0>r&&(r=wu(e+r,0)),be(n)?e>=r&&-1r&&(r=wu(e+r,0)),v(n,t,r)):-1},dn.inRange=function(n,t,r){return t=Ee(t)||0,r===Z?(r=t,t=0):r=Ee(r)||0,n=Ee(n),n>=Au(t,r)&&n=-9007199254740991&&9007199254740991>=n},dn.isString=be,dn.isSymbol=xe,dn.isTypedArray=me,dn.isUndefined=function(n){return n===Z},dn.join=function(n,t){return n?mu.call(n,t):""},dn.kebabCase=To,dn.last=Mr,dn.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(r!==Z&&(u=Ae(r),u=(0>u?wu(e+u,0):Au(u,e-1))+1),t!==t)return W(n,u,true);for(;u--;)if(n[u]===t)return u; -return-1},dn.lowerCase=Ko,dn.lowerFirst=Go,dn.lt=je,dn.lte=function(n,t){return t>=n},dn.max=function(n){return n&&n.length?p(n,Ne,oe):Z},dn.maxBy=function(n,t){return n&&n.length?p(n,vr(t),oe):Z},dn.mean=function(n){return Ke(n)/(n?n.length:0)},dn.min=function(n){return n&&n.length?p(n,Ne,je):Z},dn.minBy=function(n,t){return n&&n.length?p(n,vr(t),je):Z},dn.noConflict=function(){return Kn._===this&&(Kn._=ou),this},dn.noop=Pe,dn.now=jo,dn.pad=function(n,t,r){n=Ie(n),t=Ae(t);var e=F(n);return t&&t>e?(e=(t-e)/2, -t=bu(e),e=yu(e),ir("",t,r)+n+ir("",e,r)):n},dn.padEnd=function(n,t,r){return n=Ie(n),n+ir(n,t,r)},dn.padStart=function(n,t,r){return n=Ie(n),ir(n,t,r)+n},dn.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),n=Ie(n).replace(on,""),Ou(n,t||(hn.test(n)?16:10))},dn.random=function(n,t,r){if(r&&typeof r!="boolean"&&Or(n,t,r)&&(t=r=Z),r===Z&&(typeof t=="boolean"?(r=t,t=Z):typeof n=="boolean"&&(r=n,n=Z)),n===Z&&t===Z?(n=0,t=1):(n=Ee(n)||0,t===Z?(t=n,n=0):t=Ee(t)||0),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Eu(), -Au(n+r*(t-n+Fn("1e-"+((r+"").length-1))),t)):Rt(n,t)},dn.reduce=function(n,t,r){var e=Wo(n)?l:d,u=3>arguments.length;return e(n,vr(t,4),r,u,Nu)},dn.reduceRight=function(n,t,r){var e=Wo(n)?s:d,u=3>arguments.length;return e(n,vr(t,4),r,u,Zu)},dn.repeat=Fe,dn.replace=function(){var n=arguments,t=Ie(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},dn.result=function(n,t,r){if(Er(t,n))e=null==n?Z:n[t];else{t=Lt(t);var e=Re(n,t);n=Wr(n,t)}return e===Z&&(e=r),le(e)?e.call(n):e},dn.round=si,dn.runInContext=N, -dn.sample=function(n){n=fe(n)?n:ze(n);var t=n.length;return t>0?n[Rt(0,t-1)]:Z},dn.size=Yr,dn.snakeCase=Jo,dn.some=function(n,t,r){var e=Wo(n)?h:Ct;return r&&Or(n,t,r)&&(t=Z),e(n,vr(t,3))},dn.sortedIndex=function(n,t){return Ut(n,t)},dn.sortedIndexBy=function(n,t,r){return Bt(n,t,vr(r))},dn.sortedIndexOf=function(n,t){var r=n?n.length:0;if(r){var e=Ut(n,t);if(r>e&&ue(n[e],t))return e}return-1},dn.sortedLastIndex=function(n,t){return Ut(n,t,true)},dn.sortedLastIndexBy=function(n,t,r){return Bt(n,t,vr(r),true); -},dn.sortedLastIndexOf=function(n,t){if(n&&n.length){var r=Ut(n,t,true)-1;if(ue(n[r],t))return r}return-1},dn.startCase=Yo,dn.startsWith=function(n,t,r){return n=Ie(n),r=Hn(Ae(r),0,n.length),n.lastIndexOf(t,r)==r},dn.subtract=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r-t),r},dn.sum=Ke,dn.sumBy=function(n,t){return n&&n.length?b(n,vr(t)):Z},dn.template=function(n,t,r){var e=dn.templateSettings;r&&Or(n,t,r)&&(t=Z),n=Ie(n),t=Bo({},t,e,Pn),r=Bo({},t.imports,e.imports,Pn);var u,o,i=Ce(r),f=w(r,i),c=0; -r=t.interpolate||bn;var a="__p+='";r=Ye((t.escape||bn).source+"|"+r.source+"|"+(r===X?ln:bn).source+"|"+(t.evaluate||bn).source+"|$","g");var l="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,i,f,l){return e||(e=i),a+=n.slice(c,l).replace(xn,S),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+t.length,t}),a+="';",(t=t.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(P,""):a).replace(T,"$1").replace(K,"$1;"), -a="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",t=Qo(function(){return Function(i,l+"return "+a).apply(Z,f)}),t.source=a,ae(t))throw t;return t},dn.times=function(n,t){if(n=Ae(n),1>n||n>9007199254740991)return[];var r=4294967295,e=Au(n,4294967295);for(t=Br(t),n-=4294967295,e=x(e,t);++r=o)return n;if(o=r-F(e),1>o)return e;if(r=i?i.slice(0,o).join(""):n.slice(0,o),u===Z)return r+e;if(i&&(o+=r.length-o),ye(u)){if(n.slice(o).search(u)){var f=r;for(u.global||(u=Ye(u.source,Ie(sn.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index; -r=r.slice(0,c===Z?o:c)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},dn.unescape=function(n){return(n=Ie(n))&&J.test(n)?n.replace(G,M):n},dn.uniqueId=function(n){var t=++ru;return Ie(n)+t},dn.upperCase=Ho,dn.upperFirst=Vo,dn.each=Gr,dn.eachRight=Vr,dn.first=Fr,qe(dn,function(){var n={};return it(dn,function(t,r){tu.call(dn.prototype,r)||(n[r]=t)}),n}(),{chain:false}),dn.VERSION="4.0.1",e("bind bindKey curry curryRight partial partialRight".split(" "),function(n){dn[n].placeholder=dn; -}),e(["drop","take"],function(n,t){wn.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new wn(this);r=r===Z?1:wu(Ae(r),0);var u=this.clone();return e?u.__takeCount__=Au(r,u.__takeCount__):u.__views__.push({size:Au(r,4294967295),type:n+(0>u.__dir__?"Right":"")}),u},wn.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),e(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;wn.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({ -iteratee:vr(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),e(["head","last"],function(n,t){var r="take"+(t?"Right":"");wn.prototype[n]=function(){return this[r](1).value()[0]}}),e(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");wn.prototype[n]=function(){return this.__filtered__?new wn(this):this[r](1)}}),wn.prototype.compact=function(){return this.filter(Ne)},wn.prototype.find=function(n){return this.filter(n).head()},wn.prototype.findLast=function(n){return this.reverse().find(n); -},wn.prototype.invokeMap=ee(function(n,t){return typeof n=="function"?new wn(this):this.map(function(r){return pt(r,n,t)})}),wn.prototype.reject=function(n){return n=vr(n,3),this.filter(function(t){return!n(t)})},wn.prototype.slice=function(n,t){n=Ae(n);var r=this;return r.__filtered__&&(n>0||0>t)?new wn(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==Z&&(t=Ae(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},wn.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},wn.prototype.toArray=function(){ -return this.take(4294967295)},it(wn.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=dn[e?"take"+("last"==t?"Right":""):t],o=e||/^find/.test(t);u&&(dn.prototype[t]=function(){function t(n){return n=u.apply(dn,a([n],f)),e&&h?n[0]:n}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof wn,l=f[0],s=c||Wo(i);s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,l=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new wn(this), -i=n.apply(i,f),i.__actions__.push({func:Tr,args:[t],thisArg:Z}),new jn(i,h)):l&&c?n.apply(this,f):(i=this.thru(t),l?e?i.value()[0]:i.value():i)})}),e("pop push shift sort splice unshift".split(" "),function(n){var t=Qe[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);dn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),it(wn.prototype,function(n,t){var r=dn[t];if(r){var e=r.name+"";(Fu[e]||(Fu[e]=[])).push({ -name:t,func:r})}}),Fu[ur(Z,2).name]=[{name:"wrapper",func:Z}],wn.prototype.clone=function(){var n=new wn(this.__wrapped__);return n.__actions__=Pt(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Pt(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Pt(this.__views__),n},wn.prototype.reverse=function(){if(this.__filtered__){var n=new wn(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},wn.prototype.value=function(){ -var n,t=this.__wrapped__.value(),r=this.__dir__,e=Wo(t),u=0>r,o=e?t.length:0;n=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++co||o==n&&a==n)return Mt(t,this.__actions__);e=[];n:for(;n--&&a>c;){for(u+=r,o=-1,l=t[u];++o=this.__values__.length,t=n?Z:this.__values__[this.__index__++];return{done:n,value:t}},dn.prototype.plant=function(n){ -for(var t,r=this;r instanceof mn;){var e=zr(r);e.__index__=0,e.__values__=Z,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},dn.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof wn?(this.__actions__.length&&(n=new wn(this)),n=n.reverse(),n.__actions__.push({func:Tr,args:[Zr],thisArg:Z}),new jn(n,this.__chain__)):this.thru(Zr)},dn.prototype.toJSON=dn.prototype.valueOf=dn.prototype.value=function(){return Mt(this.__wrapped__,this.__actions__)},_u&&(dn.prototype[_u]=Kr), -dn}var Z,D=1/0,q=NaN,P=/\b__p\+='';/g,T=/\b(__p\+=)''\+/g,K=/(__e\(.*?\)|\b__t\))\+'';/g,G=/&(?:amp|lt|gt|quot|#39|#96);/g,V=/[&<>"'`]/g,J=RegExp(G.source),Y=RegExp(V.source),H=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tn=/^\w*$/,rn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,en=/[\\^$.*+?()[\]{}|]/g,un=RegExp(en.source),on=/^\s+|\s+$/g,fn=/^\s+/,cn=/\s+$/,an=/\\(\\)?/g,ln=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,sn=/\w*$/,hn=/^0x/i,pn=/^[-+]0x[0-9a-f]+$/i,_n=/^0b[01]+$/i,gn=/^\[object .+?Constructor\]$/,vn=/^0o[0-7]+$/i,dn=/^(?:0|[1-9]\d*)$/,yn=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,bn=/($^)/,xn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",jn="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,wn="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",An=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),On=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+wn+mn,"g"),En=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),kn=/[a-zA-Z0-9]+/g,In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|\\d+",jn].join("|"),"g"),Rn=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sn="Array Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Wn={}; -Wn["[object Float32Array]"]=Wn["[object Float64Array]"]=Wn["[object Int8Array]"]=Wn["[object Int16Array]"]=Wn["[object Int32Array]"]=Wn["[object Uint8Array]"]=Wn["[object Uint8ClampedArray]"]=Wn["[object Uint16Array]"]=Wn["[object Uint32Array]"]=true,Wn["[object Arguments]"]=Wn["[object Array]"]=Wn["[object ArrayBuffer]"]=Wn["[object Boolean]"]=Wn["[object Date]"]=Wn["[object Error]"]=Wn["[object Function]"]=Wn["[object Map]"]=Wn["[object Number]"]=Wn["[object Object]"]=Wn["[object RegExp]"]=Wn["[object Set]"]=Wn["[object String]"]=Wn["[object WeakMap]"]=false; -var Cn={};Cn["[object Arguments]"]=Cn["[object Array]"]=Cn["[object ArrayBuffer]"]=Cn["[object Boolean]"]=Cn["[object Date]"]=Cn["[object Float32Array]"]=Cn["[object Float64Array]"]=Cn["[object Int8Array]"]=Cn["[object Int16Array]"]=Cn["[object Int32Array]"]=Cn["[object Map]"]=Cn["[object Number]"]=Cn["[object Object]"]=Cn["[object RegExp]"]=Cn["[object Set]"]=Cn["[object String]"]=Cn["[object Symbol]"]=Cn["[object Uint8Array]"]=Cn["[object Uint8ClampedArray]"]=Cn["[object Uint16Array]"]=Cn["[object Uint32Array]"]=true, -Cn["[object Error]"]=Cn["[object Function]"]=Cn["[object WeakMap]"]=false;var Un={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O", -"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Bn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},zn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ln={"function":true,object:true},$n={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" -},Fn=parseFloat,Mn=parseInt,Nn=Ln[typeof exports]&&exports&&!exports.nodeType?exports:null,Zn=Ln[typeof module]&&module&&!module.nodeType?module:null,Dn=E(Ln[typeof self]&&self),qn=E(Ln[typeof window]&&window),Pn=Zn&&Zn.exports===Nn?Nn:null,Tn=E(Ln[typeof this]&&this),Kn=E(Nn&&Zn&&typeof global=="object"&&global)||qn!==(Tn&&Tn.window)&&qn||Dn||Tn||Function("return this")(),Gn=N();(qn||Dn||{})._=Gn,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Gn}):Nn&&Zn?(Pn&&((Zn.exports=Gn)._=Gn), -Nn._=Gn):Kn._=Gn}).call(this); \ No newline at end of file +;(function(){function n(n,t){return n.set(t[0],t[1]),n}function t(n,t){return n.add(t),n}function r(n,t,r){switch(r?r.length:0){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function e(n,t,r,e){for(var u=-1,o=n.length;++ut&&!o||!u||r&&!i&&f||e&&f)return 1;if(t>n&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function R(n){return Bn[n]}function S(n){return zn[n]}function W(n){return"\\"+Fn[n]}function C(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t-1&&0==n%1&&(null==t?9007199254740991:t)>n}function z(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function L(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function $(n,t){for(var r=-1,e=n.length,u=-1,o=[];++rr?false:(r==n.length-1?n.pop():ju.call(n,r,1),true)}function Zn(n,t){var r=qn(n,t);return 0>r?Z:n[r][1]}function qn(n,t){for(var r=n.length;r--;)if(ce(n[r][0],t))return r;return-1}function Pn(n,t,r){var e=qn(n,t);0>e?n.push([t,r]):n[e][1]=r}function Tn(n,t,r,e){return n===Z||ce(n,uu[r])&&!iu.call(e,r)?t:n}function Kn(n,t,r){(r!==Z&&!ce(n[t],r)||typeof t=="number"&&r===Z&&!(t in n))&&(n[t]=r)}function Jn(n,t,r){var e=n[t];(!ce(e,r)||ce(e,uu[t])&&!iu.call(n,t)||r===Z&&!(t in n))&&(n[t]=r); +}function Yn(n,t,r,e){return Tu(n,function(n,u,o){t(e,n,r(n),o)}),e}function Hn(n,t){return n&&Jt(t,Le(t),n)}function Qn(n,t){for(var r=-1,e=null==n,u=t.length,o=Array(u);++rr?r:n),t!==Z&&(n=t>n?t:n)),n}function nt(n,t,r,e,o,i){var f;if(r&&(f=o?r(n,e,o,i):r(n)),f!==Z)return f;if(!de(n))return n;if(e=Lo(n)){if(f=Er(n),!t)return Vt(n,f)}else{var c=Ar(n),a="[object Function]"==c||"[object GeneratorFunction]"==c;if("[object Object]"!=c&&"[object Arguments]"!=c&&(!a||o))return Un[c]?Ir(n,c,t):o?n:{}; +if(U(n))return o?n:{};if(f=kr(a?{}:n),!t)return Ht(n,Hn(f,n))}return i||(i=new Fn),(o=i.get(n))?o:(i.set(n,f),(e?u:ct)(n,function(e,u){Jn(f,u,nt(e,t,r,u,n,i))}),e?f:Ht(n,f))}function tt(n){var t=Le(n),r=t.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=t[u],i=n[o],f=e[o];if(f===Z&&!(o in Object(e))||!i(f))return false}return true}}function rt(n,t,r){if(typeof n!="function")throw new ru("Expected a function");return mu(function(){n.apply(Z,r)},t)}function et(n,t,r,e){var u=-1,o=f,i=true,l=n.length,s=[],h=t.length; +if(!l)return s;r&&(t=a(t,w(r))),e?(o=c,i=false):t.length>=200&&(o=$n,i=false,t=new Ln(t));n:for(;++ur;)n=n[t[r++]];return r&&r==e?n:Z}function ht(n,t){return iu.call(n,t)||typeof n=="object"&&t in n&&null===du(n)}function pt(n,t){return t in Object(n)}function _t(n,t,r){for(var e=r?c:f,u=n.length,o=u,i=Array(u),l=[];o--;){var s=n[o];o&&t&&(s=a(s,w(t))), +i[o]=r||!t&&120>s.length?Z:new Ln(o&&s)}var s=n[0],h=-1,p=s.length,_=i[0];n:for(;++he?c*("desc"==r[e]?-1:1):c;break n}}e=n.b-t.b}return e})}function Et(n,t){return n=Object(n),s(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function kt(n,t){var r={};return ft(n,function(n,e){t(n,e)&&(r[e]=n)}),r}function It(n){return function(t){return null==t?Z:t[n]}}function Rt(n){return function(t){return st(t,n)}}function St(n,t,r){var e=-1,u=t.length,o=n;for(r&&(o=a(n,function(n){return r(n)}));++et&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e=u){for(;u>e;){var o=e+u>>>1,i=n[o];(r?t>=i:t>i)&&null!==i?e=o+1:u=o}return u}return $t(n,t,Te,r)}function $t(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=null===t,c=t===Z;o>u;){var a=Au((u+o)/2),l=r(n[a]),s=l!==Z,h=l===l;(i?h||e:f?h&&s&&(e||null!=l):c?h&&(e||s):null==l?0:e?t>=l:t>l)?u=a+1:o=a; +}return Ru(o,4294967294)}function Ft(n,t){for(var r=0,e=n.length,u=n[0],o=t?t(u):u,i=o,f=0,c=[u];++re?t[e]:Z);return i}function Tt(n){ +var t=new n.constructor(n.byteLength);return new _u(t).set(new _u(n)),t}function Kt(n,t,r){for(var e=r.length,u=-1,o=Iu(n.length-e,0),i=-1,f=t.length,c=Array(f+o);++i1?r[u-1]:Z,i=u>2?r[2]:Z,o=typeof o=="function"?(u--,o):Z;for(i&&Sr(r[0],r[1],i)&&(o=3>u?Z:o,u=1),t=Object(t);++ei&&c[0]!==l&&c[i-1]!==l?[]:$(c,l),i-=f.length,e>i?_r(n,t,cr,l,Z,c,f,Z,Z,e-i):r(a,this,c)}var o=or(n);return u}function fr(n){return fe(function(t){t=it(t);var r=t.length,e=r,u=wn.prototype.thru;for(n&&t.reverse();e--;){var o=t[e];if(typeof o!="function")throw new ru("Expected a function");if(u&&!i&&"wrapper"==xr(o))var i=new wn([],true)}for(e=i?e:r;++e=200)return i.plant(e).value();for(var u=0,n=r?t[u].apply(this,n):e;++uy)return _r(n,t,cr,b,r,x,m,f,c,a-y)}if(y=h?r:this,b=p?y[n]:n,f)for(var m=x.length,j=Ru(f.length,m),w=Vt(x);j--;){var A=f[j]; +x[j]=B(A,m)?w[A]:Z}else v&&x.length>1&&x.reverse();return s&&x.length>c&&(x.length=c),this&&this!==Gn&&this instanceof l&&(b=d||or(b)),b.apply(y,x)}var s=128&t,h=1&t,p=2&t,_=8&t,g=16&t,v=512&t,d=p?Z:or(n);return l}function ar(n,t){return function(r,e){return gt(r,n,t(e))}}function lr(n){return fe(function(t){return t=a(it(t),mr()),fe(function(e){var u=this;return n(t,function(n){return r(n,u,e)})})})}function sr(n,t,r){return t=Ie(t),n=M(n),t&&t>n?(t-=n,r=r===Z?" ":r+"",n=Ze(r,wu(t/M(r))),kn.test(r)?n.match(En).slice(0,t).join(""):n.slice(0,t)):""; +}function hr(n,t,e,u){function o(){for(var t=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Gn&&this instanceof o?f:n;++at?1:-1:Se(e)||0;var u=-1;r=Iu(wu((r-t)/(e||1)),0);for(var o=Array(r);r--;)o[n?r:++u]=t,t+=e;return o}}function _r(n,t,r,e,u,o,i,f,c,a){ +var l=8&t;f=f?Vt(f):Z;var s=l?i:Z;i=l?Z:i;var h=l?o:Z;return o=l?Z:o,t=(t|(l?32:64))&~(l?64:32),4&t||(t&=-4),t=[n,t,u,h,s,o,i,f,c,a],r=r.apply(Z,t),Ur(n)&&no(r,t),r.placeholder=e,r}function gr(n){var t=nu[n];return function(n,r){if(n=Se(n),r=Ie(r)){var e=(Ce(n)+"e").split("e"),e=t(e[0]+"e"+(+e[1]+r)),e=(Ce(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return t(n)}}function vr(n,t,r,e,u,o,i,f){var c=2&t;if(!c&&typeof n!="function")throw new ru("Expected a function");var a=e?e.length:0;if(a||(t&=-97, +e=u=Z),i=i===Z?i:Iu(Ie(i),0),f=f===Z?f:Ie(f),a-=u?u.length:0,64&t){var l=e,s=u;e=u=Z}var h=c?Z:Hu(n);return o=[n,t,r,e,u,l,s,o,i,f],h&&(r=o[1],n=h[1],t=r|n,e=128==n&&8==r||128==n&&256==r&&h[8]>=o[7].length||384==n&&h[8]>=h[7].length&&8==r,131>t||e)&&(1&n&&(o[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?Kt(e,r,h[4]):Vt(r),o[4]=e?$(o[3],"__lodash_placeholder__"):Vt(h[4])),(r=h[5])&&(e=o[5],o[5]=e?Gt(e,r,h[6]):Vt(r),o[6]=e?$(o[5],"__lodash_placeholder__"):Vt(h[6])),(r=h[7])&&(o[7]=Vt(r)),128&n&&(o[8]=null==o[8]?h[8]:Ru(o[8],h[8])), +null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=t),n=o[0],t=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:n.length:Iu(o[9]-a,0),!f&&24&t&&(t&=-25),(h?Ju:no)(t&&1!=t?8==t||16==t?ir(n,t,f):32!=t&&33!=t||u.length?cr.apply(Z,o):hr(n,t,r,e):rr(n,t,r),o)}function dr(n,t,r,e,u,o){var i=-1,f=2&u,c=1&u,a=n.length,l=t.length;if(!(a==l||f&&l>a))return false;if(l=o.get(n))return l==t;for(l=true,o.set(n,t);++it?0:t,e)):[]}function Zr(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Ie(t),t=e-t,Bt(n,0,0>t?0:t)):[]}function qr(n){return n?n[0]:Z; +}function Pr(n){var t=n?n.length:0;return t?n[t-1]:Z}function Tr(n,t){return n&&n.length&&t&&t.length?St(n,t):n}function Kr(n){return n?Cu.call(n):n}function Gr(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){return he(n)?(t=Iu(n.length,t),true):void 0}),m(t,function(t){return a(n,It(t))})}function Vr(n,t){if(!n||!n.length)return[];var e=Gr(n);return null==t?e:a(e,function(n){return r(t,Z,n)})}function Jr(n){return n=yn(n),n.__chain__=true,n}function Yr(n,t){return t(n)}function Hr(){return this; +}function Qr(n,t){return typeof t=="function"&&Lo(n)?u(n,t):Tu(n,Mr(t))}function Xr(n,t){var r;if(typeof t=="function"&&Lo(n)){for(r=n.length;r--&&false!==t(n[r],r,n););r=n}else r=Ku(n,Mr(t));return r}function ne(n,t){var r=-1,e=ke(n),u=e.length,o=u-1;for(t=Xn(Ie(t),0,u);++r=n&&(t=Z),r}}function ee(n,t,r){return t=r?Z:t,n=vr(n,8,Z,Z,Z,Z,Z,t),n.placeholder=ee.placeholder,n}function ue(n,t,r){return t=r?Z:t,n=vr(n,16,Z,Z,Z,Z,Z,t),n.placeholder=ue.placeholder,n}function oe(n,t,r){function e(){p&&gu(p),a&&gu(a),g=0,c=a=h=p=_=Z}function u(t,r){r&&gu(r),a=p=_=Z,t&&(g=ko(),l=n.apply(h,c),p||a||(c=h=Z))}function o(){var n=t-(ko()-s);0>=n||n>t?u(_,a):p=mu(o,n)}function i(){u(y,p)}function f(){if(c=arguments,s=ko(),h=this, +_=y&&(p||!v),false===d)var r=v&&!p;else{a||v||(g=s);var e=d-(s-g),u=0>=e||e>d;u?(a&&(a=gu(a)),g=s,l=n.apply(h,c)):a||(a=mu(i,e))}return u&&p?p=gu(p):p||t===d||(p=mu(o,t)),r&&(u=true,l=n.apply(h,c)),!u||p||a||(c=h=Z),l}var c,a,l,s,h,p,_,g=0,v=false,d=false,y=true;if(typeof n!="function")throw new ru("Expected a function");return t=Se(t)||0,de(r)&&(v=!!r.leading,d="maxWait"in r&&Iu(Se(r.maxWait)||0,t),y="trailing"in r?!!r.trailing:y),f.cancel=e,f.flush=function(){return(p&&_||a&&y)&&(l=n.apply(h,c)),e(),l},f}function ie(n,t){ +function r(){var e=arguments,u=t?t.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=n.apply(this,e),r.cache=o.set(u,e),e)}if(typeof n!="function"||t&&typeof t!="function")throw new ru("Expected a function");return r.cache=new ie.Cache,r}function fe(n,t){if(typeof n!="function")throw new ru("Expected a function");return t=Iu(t===Z?n.length-1:Ie(t),0),function(){for(var e=arguments,u=-1,o=Iu(e.length-t,0),i=Array(o);++ut}function le(n){return he(n)&&iu.call(n,"callee")&&(!xu.call(n,"callee")||"[object Arguments]"==au.call(n))}function se(n){return null!=n&&!(typeof n=="function"&&_e(n))&&ve(Qu(n))}function he(n){return ye(n)&&se(n)}function pe(n){return ye(n)&&typeof n.message=="string"&&"[object Error]"==au.call(n)}function _e(n){return n=de(n)?au.call(n):"", +"[object Function]"==n||"[object GeneratorFunction]"==n}function ge(n){return typeof n=="number"&&n==Ie(n)}function ve(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function de(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function ye(n){return!!n&&typeof n=="object"}function be(n){return null==n?false:_e(n)?su.test(ou.call(n)):ye(n)&&(U(n)?su:vn).test(n)}function xe(n){return typeof n=="number"||ye(n)&&"[object Number]"==au.call(n)}function me(n){if(!ye(n)||"[object Object]"!=au.call(n)||U(n))return false; +var t=uu;return typeof n.constructor=="function"&&(t=du(n)),null===t?true:(n=t.constructor,typeof n=="function"&&n instanceof n&&ou.call(n)==cu)}function je(n){return de(n)&&"[object RegExp]"==au.call(n)}function we(n){return typeof n=="string"||!Lo(n)&&ye(n)&&"[object String]"==au.call(n)}function Ae(n){return typeof n=="symbol"||ye(n)&&"[object Symbol]"==au.call(n)}function Oe(n){return ye(n)&&ve(n.length)&&!!Cn[au.call(n)]}function Ee(n,t){return t>n}function ke(n){if(!n)return[];if(se(n))return we(n)?n.match(En):Vt(n); +if(bu&&n[bu])return z(n[bu]());var t=Ar(n);return("[object Map]"==t?L:"[object Set]"==t?F:Me)(n)}function Ie(n){if(!n)return 0===n?n:0;if(n=Se(n),n===q||n===-q)return 1.7976931348623157e308*(0>n?-1:1);var t=n%1;return n===n?t?n-t:n:0}function Re(n){return n?Xn(Ie(n),0,4294967295):0}function Se(n){if(de(n)&&(n=_e(n.valueOf)?n.valueOf():n,n=de(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(fn,"");var t=gn.test(n);return t||dn.test(n)?Nn(n.slice(2),t?2:8):_n.test(n)?P:+n}function We(n){ +return Jt(n,$e(n))}function Ce(n){if(typeof n=="string")return n;if(null==n)return"";if(Ae(n))return pu?Zu.call(n):"";var t=n+"";return"0"==t&&1/n==-q?"-0":t}function Ue(n,t,r){return n=null==n?Z:st(n,t),n===Z?r:n}function Be(n,t){return Or(n,t,ht)}function ze(n,t){return Or(n,t,pt)}function Le(n){var t=Br(n);if(!t&&!se(n))return ku(Object(n));var r,e=Rr(n),u=!!e,e=e||[],o=e.length;for(r in n)!ht(n,r)||u&&("length"==r||B(r,o))||t&&"constructor"==r||e.push(r);return e}function $e(n){for(var t=-1,r=Br(n),e=xt(n),u=e.length,o=Rr(n),i=!!o,o=o||[],f=o.length;++tt||t>9007199254740991)return r;do t%2&&(r+=n),t=Au(t/2),n+=n;while(t);return r}function qe(n,t,r){return n=Ce(n),t=r?Z:t,t===Z&&(t=Sn.test(n)?Rn:In),n.match(t)||[]}function Pe(n){ +return function(){return n}}function Te(n){return n}function Ke(n){return ye(n)&&!Lo(n)?Ge(n):bt(n)}function Ge(n){return jt(nt(n,true))}function Ve(n,t,r){var e=Le(t),o=lt(t,e);null!=r||de(t)&&(o.length||!e.length)||(r=t,t=n,n=this,o=lt(t,Le(t)));var i=de(r)&&"chain"in r?r.chain:true,f=_e(n);return u(o,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__);return(r.__actions__=Vt(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t, +r}return e.apply(n,l([this.value()],arguments))})}),n}function Je(){}function Ye(n){return Wr(n)?It(n):Rt(n)}function He(n){return n&&n.length?x(n,Te):0}k=k?Vn.defaults({},k,Vn.pick(Gn,Wn)):Gn;var Qe=k.Date,Xe=k.Error,nu=k.Math,tu=k.RegExp,ru=k.TypeError,eu=k.Array.prototype,uu=k.Object.prototype,ou=k.Function.prototype.toString,iu=uu.hasOwnProperty,fu=0,cu=ou.call(Object),au=uu.toString,lu=Gn._,su=tu("^"+ou.call(iu).replace(un,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hu=k.f,pu=k.Symbol,_u=k.Uint8Array,gu=k.clearTimeout,vu=hu?hu.g:Z,du=Object.getPrototypeOf,yu=Object.getOwnPropertySymbols,bu=typeof(bu=pu&&pu.iterator)=="symbol"?bu:Z,xu=uu.propertyIsEnumerable,mu=k.setTimeout,ju=eu.splice,wu=nu.ceil,Au=nu.floor,Ou=k.isFinite,Eu=eu.join,ku=Object.keys,Iu=nu.max,Ru=nu.min,Su=k.parseInt,Wu=nu.random,Cu=eu.reverse,Uu=wr(k,"Map"),Bu=wr(k,"Set"),zu=wr(k,"WeakMap"),Lu=wr(Object,"create"),$u=zu&&new zu,Fu=Uu?ou.call(Uu):"",Mu=Bu?ou.call(Bu):"",Nu=pu?pu.prototype:Z,Du=pu?Nu.valueOf:Z,Zu=pu?Nu.toString:Z,qu={}; +yn.templateSettings={escape:Q,evaluate:X,interpolate:nn,variable:"",imports:{_:yn}};var Pu=function(){function n(){}return function(t){if(de(t)){n.prototype=t;var r=new n;n.prototype=Z}return r||{}}}(),Tu=nr(ct),Ku=nr(at,true),Gu=tr(),Vu=tr(true);vu&&!xu.call({valueOf:1},"valueOf")&&(xt=function(n){return z(vu(n))});var Ju=$u?function(n,t){return $u.set(n,t),n}:Te,Yu=Bu&&2===new Bu([1,2]).size?function(n){return new Bu(n)}:Je,Hu=$u?function(n){return $u.get(n)}:Je,Qu=It("length"),Xu=yu||function(){return[]; +};(Uu&&"[object Map]"!=Ar(new Uu)||Bu&&"[object Set]"!=Ar(new Bu))&&(Ar=function(n){var t=au.call(n);if(n="[object Object]"==t?n.constructor:null,n=typeof n=="function"?ou.call(n):""){if(n==Fu)return"[object Map]";if(n==Mu)return"[object Set]"}return t});var no=function(){var n=0,t=0;return function(r,e){var u=ko(),o=16-(u-t);if(t=u,o>0){if(150<=++n)return r}else n=0;return Ju(r,e)}}(),to=fe(function(n,t){Lo(n)||(n=null==n?[]:[Object(n)]),t=it(t);for(var r=n,e=t,u=-1,o=r.length,i=-1,f=e.length,c=Array(o+f);++u1?n[t-1]:Z,t=typeof t=="function"?(n.pop(),t):Z;return Vr(n,t)}),xo=fe(function(n){function t(t){return Qn(t,n)}n=it(n);var r=n.length,e=r?n[0]:0,u=this.__wrapped__;return 1>=r&&!this.__actions__.length&&u instanceof An&&B(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:Yr,args:[t],thisArg:Z}),new wn(u,this.__chain__).thru(function(n){return r&&!n.length&&n.push(Z),n})):this.thru(t)}),mo=Qt(function(n,t,r){iu.call(n,r)?++n[r]:n[r]=1; +}),jo=Qt(function(n,t,r){iu.call(n,r)?n[r].push(t):n[r]=[t]}),wo=fe(function(n,t,e){var u=-1,o=typeof t=="function",i=Wr(t),f=se(n)?Array(n.length):[];return Tu(n,function(n){var c=o?t:i&&null!=n?n[t]:Z;f[++u]=c?r(c,n,e):vt(n,t,e)}),f}),Ao=Qt(function(n,t,r){n[r]=t}),Oo=Qt(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Eo=fe(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Sr(n,t[0],t[1])?t=[]:r>2&&Sr(t[0],t[1],t[2])&&(t.length=1),Ot(n,it(t),[])}),ko=Qe.now,Io=fe(function(n,t,r){ +var e=1;if(r.length)var u=$(r,Io.placeholder),e=32|e;return vr(n,e,t,r,u)}),Ro=fe(function(n,t,r){var e=3;if(r.length)var u=$(r,Ro.placeholder),e=32|e;return vr(t,e,n,r,u)}),So=fe(function(n,t){return rt(n,1,t)}),Wo=fe(function(n,t,r){return rt(n,Se(t)||0,r)}),Co=fe(function(n,t){t=a(it(t),mr());var e=t.length;return fe(function(u){for(var o=-1,i=Ru(u.length,e);++oe.length?Pn(e,n,t):(r.array=null,r.map=new zn(e))),(r=r.map)&&r.set(n,t),this},ie.Cache=zn,yn.after=function(n,t){if(typeof t!="function")throw new ru("Expected a function");return n=Ie(n),function(){return 1>--n?t.apply(this,arguments):void 0}},yn.ary=te,yn.assign=$o,yn.assignIn=Fo,yn.assignInWith=Mo,yn.assignWith=No,yn.at=Do,yn.before=re,yn.bind=Io,yn.bindAll=ii,yn.bindKey=Ro,yn.chain=Jr,yn.chunk=function(n,t){t=Iu(Ie(t),0);var r=n?n.length:0;if(!r||1>t)return[];for(var e=0,u=-1,o=Array(wu(r/t));r>e;)o[++u]=Bt(n,e,e+=t); +return o},yn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++tr&&(r=-r>u?0:u+r),e=e===Z||e>u?u:Ie(e),0>e&&(e+=u), +e=r>e?0:Re(e);e>r;)n[r++]=t;return n},yn.filter=function(n,t){return(Lo(n)?i:ot)(n,mr(t,3))},yn.flatMap=function(n,t){return n&&n.length?it(a(n,mr(t,3))):[]},yn.flatten=function(n){return n&&n.length?it(n):[]},yn.flattenDeep=function(n){return n&&n.length?it(n,true):[]},yn.flip=function(n){return vr(n,512)},yn.flow=fi,yn.flowRight=ci,yn.fromPairs=function(n){for(var t=-1,r=n?n.length:0,e={};++tt?0:t)):[]},yn.takeRight=function(n,t,r){ +var e=n?n.length:0;return e?(t=r||t===Z?1:Ie(t),t=e-t,Bt(n,0>t?0:t,e)):[]},yn.takeRightWhile=function(n,t){return n&&n.length?Dt(n,mr(t,3),false,true):[]},yn.takeWhile=function(n,t){return n&&n.length?Dt(n,mr(t,3)):[]},yn.tap=function(n,t){return t(n),n},yn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ru("Expected a function");return de(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),oe(n,t,{leading:e,maxWait:t,trailing:u})},yn.thru=Yr,yn.toArray=ke,yn.toPairs=Fe, +yn.toPairsIn=function(n){return j(n,$e(n))},yn.toPath=function(n){return Lo(n)?a(n,String):$r(n)},yn.toPlainObject=We,yn.transform=function(n,t,r){var e=Lo(n)||Oe(n);if(t=mr(t,4),null==r)if(e||de(n)){var o=n.constructor;r=e?Lo(n)?new o:[]:Pu(_e(o)?o.prototype:Z)}else r={};return(e?u:ct)(n,function(n,e,u){return t(r,n,e,u)}),r},yn.unary=function(n){return te(n,1)},yn.union=lo,yn.unionBy=so,yn.unionWith=ho,yn.uniq=function(n){return n&&n.length?Nt(n):[]},yn.uniqBy=function(n,t){return n&&n.length?Nt(n,mr(t)):[]; +},yn.uniqWith=function(n,t){return n&&n.length?Nt(n,Z,t):[]},yn.unset=function(n,t){var r;if(null==n)r=true;else{r=n;var e=t,e=Wr(e,r)?[e+""]:Mt(e);r=Lr(r,e),e=Pr(e),r=null!=r&&Be(r,e)?delete r[e]:true}return r},yn.unzip=Gr,yn.unzipWith=Vr,yn.values=Me,yn.valuesIn=function(n){return null==n?A(n,$e(n)):[]},yn.without=po,yn.words=qe,yn.wrap=function(n,t){return t=null==t?Te:t,Uo(t,n)},yn.xor=_o,yn.xorBy=go,yn.xorWith=vo,yn.zip=yo,yn.zipObject=function(n,t){return Pt(n||[],t||[],Jn)},yn.zipObjectDeep=function(n,t){ +return Pt(n||[],t||[],Ut)},yn.zipWith=bo,yn.extend=Fo,yn.extendWith=Mo,Ve(yn,yn),yn.add=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r+t),r},yn.attempt=oi,yn.camelCase=Ho,yn.capitalize=Ne,yn.ceil=vi,yn.clamp=function(n,t,r){return r===Z&&(r=t,t=Z),r!==Z&&(r=Se(r),r=r===r?r:0),t!==Z&&(t=Se(t),t=t===t?t:0),Xn(Se(n),t,r)},yn.clone=function(n){return nt(n)},yn.cloneDeep=function(n){return nt(n,true)},yn.cloneDeepWith=function(n,t){return nt(n,true,t)},yn.cloneWith=function(n,t){return nt(n,false,t); +},yn.deburr=De,yn.endsWith=function(n,t,r){n=Ce(n),t=typeof t=="string"?t:t+"";var e=n.length;return r=r===Z?e:Xn(Ie(r),0,e),r-=t.length,r>=0&&n.indexOf(t,r)==r},yn.eq=ce,yn.escape=function(n){return(n=Ce(n))&&H.test(n)?n.replace(J,S):n},yn.escapeRegExp=function(n){return(n=Ce(n))&&on.test(n)?n.replace(un,"\\$&"):n},yn.every=function(n,t,r){var e=Lo(n)?o:ut;return r&&Sr(n,t,r)&&(t=Z),e(n,mr(t,3))},yn.find=function(n,t){if(t=mr(t,3),Lo(n)){var r=v(n,t);return r>-1?n[r]:Z}return g(n,t,Tu)},yn.findIndex=function(n,t){ +return n&&n.length?v(n,mr(t,3)):-1},yn.findKey=function(n,t){return g(n,mr(t,3),ct,true)},yn.findLast=function(n,t){if(t=mr(t,3),Lo(n)){var r=v(n,t,true);return r>-1?n[r]:Z}return g(n,t,Ku)},yn.findLastIndex=function(n,t){return n&&n.length?v(n,mr(t,3),true):-1},yn.findLastKey=function(n,t){return g(n,mr(t,3),at,true)},yn.floor=di,yn.forEach=Qr,yn.forEachRight=Xr,yn.forIn=function(n,t){return null==n?n:Gu(n,Mr(t),$e)},yn.forInRight=function(n,t){return null==n?n:Vu(n,Mr(t),$e)},yn.forOwn=function(n,t){return n&&ct(n,Mr(t)); +},yn.forOwnRight=function(n,t){return n&&at(n,Mr(t))},yn.get=Ue,yn.gt=ae,yn.gte=function(n,t){return n>=t},yn.has=Be,yn.hasIn=ze,yn.head=qr,yn.identity=Te,yn.includes=function(n,t,r,e){return n=se(n)?n:Me(n),r=r&&!e?Ie(r):0,e=n.length,0>r&&(r=Iu(e+r,0)),we(n)?e>=r&&-1r&&(r=Iu(e+r,0)),d(n,t,r)):-1},yn.inRange=function(n,t,r){return t=Se(t)||0,r===Z?(r=t,t=0):r=Se(r)||0,n=Se(n),n>=Ru(t,r)&&n=-9007199254740991&&9007199254740991>=n},yn.isString=we,yn.isSymbol=Ae,yn.isTypedArray=Oe,yn.isUndefined=function(n){return n===Z},yn.join=function(n,t){return n?Eu.call(n,t):""},yn.kebabCase=Qo,yn.last=Pr,yn.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(r!==Z&&(u=Ie(r),u=(0>u?Iu(e+u,0):Ru(u,e-1))+1),t!==t)return C(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},yn.lowerCase=Xo,yn.lowerFirst=ni, +yn.lt=Ee,yn.lte=function(n,t){return t>=n},yn.max=function(n){return n&&n.length?_(n,Te,ae):Z},yn.maxBy=function(n,t){return n&&n.length?_(n,mr(t),ae):Z},yn.mean=function(n){return He(n)/(n?n.length:0)},yn.min=function(n){return n&&n.length?_(n,Te,Ee):Z},yn.minBy=function(n,t){return n&&n.length?_(n,mr(t),Ee):Z},yn.noConflict=function(){return Gn._===this&&(Gn._=lu),this},yn.noop=Je,yn.now=ko,yn.pad=function(n,t,r){n=Ce(n),t=Ie(t);var e=M(n);return t&&t>e?(e=(t-e)/2,t=Au(e),e=wu(e),sr("",t,r)+n+sr("",e,r)):n; +},yn.padEnd=function(n,t,r){return n=Ce(n),n+sr(n,t,r)},yn.padStart=function(n,t,r){return n=Ce(n),sr(n,t,r)+n},yn.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),n=Ce(n).replace(fn,""),Su(n,t||(pn.test(n)?16:10))},yn.random=function(n,t,r){if(r&&typeof r!="boolean"&&Sr(n,t,r)&&(t=r=Z),r===Z&&(typeof t=="boolean"?(r=t,t=Z):typeof n=="boolean"&&(r=n,n=Z)),n===Z&&t===Z?(n=0,t=1):(n=Se(n)||0,t===Z?(t=n,n=0):t=Se(t)||0),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Wu(),Ru(n+r*(t-n+Mn("1e-"+((r+"").length-1))),t)):Ct(n,t); +},yn.reduce=function(n,t,r){var e=Lo(n)?s:y,u=3>arguments.length;return e(n,mr(t,4),r,u,Tu)},yn.reduceRight=function(n,t,r){var e=Lo(n)?h:y,u=3>arguments.length;return e(n,mr(t,4),r,u,Ku)},yn.repeat=Ze,yn.replace=function(){var n=arguments,t=Ce(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},yn.result=function(n,t,r){if(Wr(t,n))e=null==n?Z:n[t];else{t=Mt(t);var e=Ue(n,t);n=Lr(n,t)}return e===Z&&(e=r),_e(e)?e.call(n):e},yn.round=yi,yn.runInContext=D,yn.sample=function(n){n=se(n)?n:Me(n);var t=n.length; +return t>0?n[Ct(0,t-1)]:Z},yn.size=function(n){if(null==n)return 0;if(se(n)){var t=n.length;return t&&we(n)?M(n):t}return Le(n).length},yn.snakeCase=ri,yn.some=function(n,t,r){var e=Lo(n)?p:zt;return r&&Sr(n,t,r)&&(t=Z),e(n,mr(t,3))},yn.sortedIndex=function(n,t){return Lt(n,t)},yn.sortedIndexBy=function(n,t,r){return $t(n,t,mr(r))},yn.sortedIndexOf=function(n,t){var r=n?n.length:0;if(r){var e=Lt(n,t);if(r>e&&ce(n[e],t))return e}return-1},yn.sortedLastIndex=function(n,t){return Lt(n,t,true)},yn.sortedLastIndexBy=function(n,t,r){ +return $t(n,t,mr(r),true)},yn.sortedLastIndexOf=function(n,t){if(n&&n.length){var r=Lt(n,t,true)-1;if(ce(n[r],t))return r}return-1},yn.startCase=ei,yn.startsWith=function(n,t,r){return n=Ce(n),r=Xn(Ie(r),0,n.length),n.lastIndexOf(t,r)==r},yn.subtract=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r-t),r},yn.sum=He,yn.sumBy=function(n,t){return n&&n.length?x(n,mr(t)):0},yn.template=function(n,t,r){var e=yn.templateSettings;r&&Sr(n,t,r)&&(t=Z),n=Ce(n),t=Mo({},t,e,Tn),r=Mo({},t.imports,e.imports,Tn); +var u,o,i=Le(r),f=A(r,i),c=0;r=t.interpolate||xn;var a="__p+='";r=tu((t.escape||xn).source+"|"+r.source+"|"+(r===nn?sn:xn).source+"|"+(t.evaluate||xn).source+"|$","g");var l="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,i,f,l){return e||(e=i),a+=n.slice(c,l).replace(mn,W),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+t.length,t}),a+="';",(t=t.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(T,""):a).replace(K,"$1").replace(G,"$1;"), +a="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",t=oi(function(){return Function(i,l+"return "+a).apply(Z,f)}),t.source=a,pe(t))throw t;return t},yn.times=function(n,t){if(n=Ie(n),1>n||n>9007199254740991)return[];var r=4294967295,e=Ru(n,4294967295);for(t=Mr(t),n-=4294967295,e=m(e,t);++r=o)return n;if(o=r-M(e),1>o)return e;if(r=i?i.slice(0,o).join(""):n.slice(0,o),u===Z)return r+e;if(i&&(o+=r.length-o),je(u)){if(n.slice(o).search(u)){var f=r;for(u.global||(u=tu(u.source,Ce(hn.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index; +r=r.slice(0,c===Z?o:c)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},yn.unescape=function(n){return(n=Ce(n))&&Y.test(n)?n.replace(V,N):n},yn.uniqueId=function(n){var t=++fu;return Ce(n)+t},yn.upperCase=ui,yn.upperFirst=ti,yn.each=Qr,yn.eachRight=Xr,yn.first=qr,Ve(yn,function(){var n={};return ct(yn,function(t,r){iu.call(yn.prototype,r)||(n[r]=t)}),n}(),{chain:false}),yn.VERSION="4.1.0",u("bind bindKey curry curryRight partial partialRight".split(" "),function(n){yn[n].placeholder=yn; +}),u(["drop","take"],function(n,t){An.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new An(this);r=r===Z?1:Iu(Ie(r),0);var u=this.clone();return e?u.__takeCount__=Ru(r,u.__takeCount__):u.__views__.push({size:Ru(r,4294967295),type:n+(0>u.__dir__?"Right":"")}),u},An.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),u(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;An.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({ +iteratee:mr(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),u(["head","last"],function(n,t){var r="take"+(t?"Right":"");An.prototype[n]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");An.prototype[n]=function(){return this.__filtered__?new An(this):this[r](1)}}),An.prototype.compact=function(){return this.filter(Te)},An.prototype.find=function(n){return this.filter(n).head()},An.prototype.findLast=function(n){return this.reverse().find(n); +},An.prototype.invokeMap=fe(function(n,t){return typeof n=="function"?new An(this):this.map(function(r){return vt(r,n,t)})}),An.prototype.reject=function(n){return n=mr(n,3),this.filter(function(t){return!n(t)})},An.prototype.slice=function(n,t){n=Ie(n);var r=this;return r.__filtered__&&(n>0||0>t)?new An(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==Z&&(t=Ie(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},An.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},An.prototype.toArray=function(){ +return this.take(4294967295)},ct(An.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=yn[e?"take"+("last"==t?"Right":""):t],o=e||/^find/.test(t);u&&(yn.prototype[t]=function(){function t(n){return n=u.apply(yn,l([n],f)),e&&h?n[0]:n}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof An,a=f[0],s=c||Lo(i);s&&r&&typeof a=="function"&&1!=a.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new An(this), +i=n.apply(i,f),i.__actions__.push({func:Yr,args:[t],thisArg:Z}),new wn(i,h)):a&&c?n.apply(this,f):(i=this.thru(t),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(n){var t=eu[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);yn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),ct(An.prototype,function(n,t){var r=yn[t];if(r){var e=r.name+"";(qu[e]||(qu[e]=[])).push({ +name:t,func:r})}}),qu[cr(Z,2).name]=[{name:"wrapper",func:Z}],An.prototype.clone=function(){var n=new An(this.__wrapped__);return n.__actions__=Vt(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Vt(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Vt(this.__views__),n},An.prototype.reverse=function(){if(this.__filtered__){var n=new An(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},An.prototype.value=function(){ +var n,t=this.__wrapped__.value(),r=this.__dir__,e=Lo(t),u=0>r,o=e?t.length:0;n=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++co||o==n&&a==n)return Zt(t,this.__actions__);e=[];n:for(;n--&&a>c;){for(u+=r,o=-1,l=t[u];++o=this.__values__.length,t=n?Z:this.__values__[this.__index__++];return{done:n,value:t}},yn.prototype.plant=function(n){ +for(var t,r=this;r instanceof jn;){var e=Nr(r);e.__index__=0,e.__values__=Z,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},yn.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof An?(this.__actions__.length&&(n=new An(this)),n=n.reverse(),n.__actions__.push({func:Yr,args:[Kr],thisArg:Z}),new wn(n,this.__chain__)):this.thru(Kr)},yn.prototype.toJSON=yn.prototype.valueOf=yn.prototype.value=function(){return Zt(this.__wrapped__,this.__actions__)},bu&&(yn.prototype[bu]=Hr), +yn}var Z,q=1/0,P=NaN,T=/\b__p\+='';/g,K=/\b(__p\+=)''\+/g,G=/(__e\(.*?\)|\b__t\))\+'';/g,V=/&(?:amp|lt|gt|quot|#39|#96);/g,J=/[&<>"'`]/g,Y=RegExp(V.source),H=RegExp(J.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,nn=/<%=([\s\S]+?)%>/g,tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,en=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,un=/[\\^$.*+?()[\]{}|]/g,on=RegExp(un.source),fn=/^\s+|\s+$/g,cn=/^\s+/,an=/\s+$/,ln=/\\(\\)?/g,sn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hn=/\w*$/,pn=/^0x/i,_n=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,vn=/^\[object .+?Constructor\]$/,dn=/^0o[0-7]+$/i,yn=/^(?:0|[1-9]\d*)$/,bn=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xn=/($^)/,mn=/['\n\r\u2028\u2029\\]/g,jn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",wn="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+jn,An="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",On=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),En=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+An+jn,"g"),kn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),In=/[a-zA-Z0-9]+/g,Rn=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|\\d+",wn].join("|"),"g"),Sn=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="Array Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Cn={}; +Cn["[object Float32Array]"]=Cn["[object Float64Array]"]=Cn["[object Int8Array]"]=Cn["[object Int16Array]"]=Cn["[object Int32Array]"]=Cn["[object Uint8Array]"]=Cn["[object Uint8ClampedArray]"]=Cn["[object Uint16Array]"]=Cn["[object Uint32Array]"]=true,Cn["[object Arguments]"]=Cn["[object Array]"]=Cn["[object ArrayBuffer]"]=Cn["[object Boolean]"]=Cn["[object Date]"]=Cn["[object Error]"]=Cn["[object Function]"]=Cn["[object Map]"]=Cn["[object Number]"]=Cn["[object Object]"]=Cn["[object RegExp]"]=Cn["[object Set]"]=Cn["[object String]"]=Cn["[object WeakMap]"]=false; +var Un={};Un["[object Arguments]"]=Un["[object Array]"]=Un["[object ArrayBuffer]"]=Un["[object Boolean]"]=Un["[object Date]"]=Un["[object Float32Array]"]=Un["[object Float64Array]"]=Un["[object Int8Array]"]=Un["[object Int16Array]"]=Un["[object Int32Array]"]=Un["[object Map]"]=Un["[object Number]"]=Un["[object Object]"]=Un["[object RegExp]"]=Un["[object Set]"]=Un["[object String]"]=Un["[object Symbol]"]=Un["[object Uint8Array]"]=Un["[object Uint8ClampedArray]"]=Un["[object Uint16Array]"]=Un["[object Uint32Array]"]=true, +Un["[object Error]"]=Un["[object Function]"]=Un["[object WeakMap]"]=false;var Bn={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O", +"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},zn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ln={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},$n={"function":true,object:true},Fn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" +},Mn=parseFloat,Nn=parseInt,Dn=$n[typeof exports]&&exports&&!exports.nodeType?exports:null,Zn=$n[typeof module]&&module&&!module.nodeType?module:null,qn=k($n[typeof self]&&self),Pn=k($n[typeof window]&&window),Tn=Zn&&Zn.exports===Dn?Dn:null,Kn=k($n[typeof this]&&this),Gn=k(Dn&&Zn&&typeof global=="object"&&global)||Pn!==(Kn&&Kn.window)&&Pn||qn||Kn||Function("return this")(),Vn=D();(Pn||qn||{})._=Vn,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Vn}):Dn&&Zn?(Tn&&((Zn.exports=Vn)._=Vn), +Dn._=Vn):Gn._=Vn}).call(this); \ No newline at end of file diff --git a/dist/mapping.fp.js b/dist/mapping.fp.js index 4788970469..c03625d3bd 100644 --- a/dist/mapping.fp.js +++ b/dist/mapping.fp.js @@ -54,207 +54,225 @@ return /******/ (function(modules) { // webpackBootstrap /* 0 */ /***/ function(module, exports) { - module.exports = { - - /** Used to map method names to their aliases. */ - 'alias': { - 'ary': ['nAry'], - 'assignIn': ['extend'], - 'assignInWith': ['extendWith'], - 'filter': ['whereEq'], - 'flatten': ['unnest'], - 'flow': ['pipe'], - 'flowRight': ['compose'], - 'forEach': ['each'], - 'forEachRight': ['eachRight'], - 'get': ['path', 'prop'], - 'getOr': ['pathOr', 'propOr'], - 'head': ['first'], - 'includes': ['contains'], - 'initial': ['init'], - 'isEqual': ['equals'], - 'mapValues': ['mapObj'], - 'matchesProperty': ['pathEq'], - 'omit': ['dissoc', 'omitAll'], - 'overArgs': ['useWith'], - 'overEvery': ['allPass'], - 'overSome': ['somePass'], - 'pick': ['pickAll'], - 'propertyOf': ['propOf'], - 'rest': ['unapply'], - 'some': ['all'], - 'spread': ['apply'], - 'zipObject': ['zipObj'] - }, - - /** Used to map method names to their iteratee ary. */ - 'aryIteratee': { - 'assignWith': 2, - 'assignInWith': 2, - 'cloneDeepWith': 1, - 'cloneWith': 1, - 'dropRightWhile': 1, - 'dropWhile': 1, - 'every': 1, - 'filter': 1, - 'find': 1, - 'findIndex': 1, - 'findKey': 1, - 'findLast': 1, - 'findLastIndex': 1, - 'findLastKey': 1, - 'flatMap': 1, - 'forEach': 1, - 'forEachRight': 1, - 'forIn': 1, - 'forInRight': 1, - 'forOwn': 1, - 'forOwnRight': 1, - 'isEqualWith': 2, - 'isMatchWith': 2, - 'map': 1, - 'mapKeys': 1, - 'mapValues': 1, - 'partition': 1, - 'reduce': 2, - 'reduceRight': 2, - 'reject': 1, - 'remove': 1, - 'some': 1, - 'takeRightWhile': 1, - 'takeWhile': 1, - 'times': 1, - 'transform': 2 - }, + /** Used to map aliases to their real names. */ + exports.aliasToReal = { + 'all': 'some', + 'allPass': 'overEvery', + 'apply': 'spread', + 'compose': 'flowRight', + 'contains': 'includes', + 'dissoc': 'omit', + 'each': 'forEach', + 'eachRight': 'forEachRight', + 'equals': 'isEqual', + 'extend': 'assignIn', + 'extendWith': 'assignInWith', + 'first': 'head', + 'init': 'initial', + 'mapObj': 'mapValues', + 'omitAll': 'omit', + 'nAry': 'ary', + 'path': 'get', + 'pathEq': 'matchesProperty', + 'pathOr': 'getOr', + 'pickAll': 'pick', + 'pipe': 'flow', + 'prop': 'get', + 'propOf': 'propertyOf', + 'propOr': 'getOr', + 'somePass': 'overSome', + 'unapply': 'rest', + 'unnest': 'flatten', + 'useWith': 'overArgs', + 'whereEq': 'filter', + 'zipObj': 'zipObject' + }; - /** Used to map ary to method names. */ - 'aryMethod': { - 1:[ - 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', - 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', - 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', - 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words' - ], - 2:[ - 'add', 'after', 'ary', 'assign', 'at', 'before', 'bind', 'bindKey', - 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', - 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', - 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', - 'every', 'extend', 'filter', 'find', 'find', 'findIndex', 'findKey', - 'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'forEach', - 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', - 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', - 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', - 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', - 'merge', 'minBy', 'omit', 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', - 'padStart', 'parseInt', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', - 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', - 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', - 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', - 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', - 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy', - 'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject' - ], - 3:[ - 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', - 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', - 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', - 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', - 'unionWith', 'xorBy', 'xorWith', 'zipWith' - ], - 4:[ - 'fill', 'setWith' - ] - }, + /** Used to map method names to their iteratee ary. */ + exports.aryIteratee = { + 'assignWith': 2, + 'assignInWith': 2, + 'cloneDeepWith': 1, + 'cloneWith': 1, + 'dropRightWhile': 1, + 'dropWhile': 1, + 'every': 1, + 'filter': 1, + 'find': 1, + 'findIndex': 1, + 'findKey': 1, + 'findLast': 1, + 'findLastIndex': 1, + 'findLastKey': 1, + 'flatMap': 1, + 'forEach': 1, + 'forEachRight': 1, + 'forIn': 1, + 'forInRight': 1, + 'forOwn': 1, + 'forOwnRight': 1, + 'isEqualWith': 2, + 'isMatchWith': 2, + 'map': 1, + 'mapKeys': 1, + 'mapValues': 1, + 'partition': 1, + 'reduce': 2, + 'reduceRight': 2, + 'reject': 1, + 'remove': 1, + 'some': 1, + 'takeRightWhile': 1, + 'takeWhile': 1, + 'times': 1, + 'transform': 2 + }; - /** Used to map ary to rearg configs. */ - 'aryRearg': { - 2: [1, 0], - 3: [2, 1, 0], - 4: [3, 2, 0, 1] - }, + /** Used to map ary to method names. */ + exports.aryMethod = { + 1: [ + 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', + 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', + 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', + 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words' + ], + 2: [ + 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey', + 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', + 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', + 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every', + 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', + 'findLastKey', 'flatMap', 'forEach', 'forEachRight', 'forIn', 'forInRight', + 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', + 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap', + 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', + 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit', + 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', + 'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'pullAt', 'random', 'range', + 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'result', 'sampleSize', + 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex', + 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'startsWith', 'subtract', + 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap', 'throttle', + 'thru', 'times', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', + 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep' + ], + 3: [ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', + 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', + 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', + 'unionWith', 'xorBy', 'xorWith', 'zipWith' + ], + 4: [ + 'fill', 'setWith' + ] + }; - /** Used to map method names to iteratee rearg configs. */ - 'iterateeRearg': { - 'findKey': [1], - 'findLastKey': [1], - 'mapKeys': [1] - }, + /** Used to map ary to rearg configs. */ + exports.aryRearg = { + 2: [1, 0], + 3: [2, 1, 0], + 4: [3, 2, 0, 1] + }; - /** Used to map method names to rearg configs. */ - 'methodRearg': { - 'clamp': [2, 0, 1], - 'reduce': [2, 0, 1], - 'reduceRight': [2, 0, 1], - 'set': [2, 0, 1], - 'setWith': [3, 1, 2, 0], - 'slice': [2, 0, 1], - 'transform': [2, 0, 1] - }, + /** Used to map method names to iteratee rearg configs. */ + exports.iterateeRearg = { + 'findKey': [1], + 'findLastKey': [1], + 'mapKeys': [1] + }; - /** Used to iterate `mapping.aryMethod` keys. */ - 'caps': [1, 2, 3, 4], + /** Used to map method names to rearg configs. */ + exports.methodRearg = { + 'assignInWith': [1, 2, 0], + 'assignWith': [1, 2, 0], + 'clamp': [2, 0, 1], + 'mergeWith': [1, 2, 0], + 'reduce': [2, 0, 1], + 'reduceRight': [2, 0, 1], + 'set': [2, 0, 1], + 'setWith': [3, 1, 2, 0], + 'slice': [2, 0, 1], + 'transform': [2, 0, 1] + }; - /** Used to map keys to other keys. */ - 'key': { - 'curryN': 'curry', - 'curryRightN': 'curryRight', - 'getOr': 'get' - }, + /** Used to iterate `mapping.aryMethod` keys. */ + exports.caps = [1, 2, 3, 4]; - /** Used to identify methods which mutate arrays or objects. */ - 'mutate': { - 'array': { - 'fill': true, - 'pull': true, - 'pullAll': true, - 'pullAllBy': true, - 'pullAt': true, - 'remove': true, - 'reverse': true - }, - 'object': { - 'assign': true, - 'assignIn': true, - 'assignInWith': true, - 'assignWith': true, - 'defaults': true, - 'defaultsDeep': true, - 'merge': true, - 'mergeWith': true - }, - 'set': { - 'set': true, - 'setWith': true - } - }, + /** Used to map keys to other keys. */ + exports.key = { + 'curryN': 'curry', + 'curryRightN': 'curryRight', + 'getOr': 'get' + }; - /** Used to track methods with placeholder support */ - 'placeholder': { - 'bind': true, - 'bindKey': true, - 'curry': true, - 'curryRight': true, - 'partial': true, - 'partialRight': true + /** Used to identify methods which mutate arrays or objects. */ + exports.mutate = { + 'array': { + 'fill': true, + 'pull': true, + 'pullAll': true, + 'pullAllBy': true, + 'pullAt': true, + 'remove': true, + 'reverse': true }, - - /** Used to track methods that skip `_.rearg`. */ - 'skipRearg': { + 'object': { 'assign': true, 'assignIn': true, - 'concat': true, + 'assignInWith': true, + 'assignWith': true, 'defaults': true, 'defaultsDeep': true, - 'difference': true, - 'matchesProperty': true, 'merge': true, - 'random': true, - 'range': true, - 'rangeRight': true, - 'zip': true, - 'zipObject': true + 'mergeWith': true + }, + 'set': { + 'set': true, + 'setWith': true + } + }; + + /** Used to track methods with placeholder support */ + exports.placeholder = { + 'bind': true, + 'bindKey': true, + 'curry': true, + 'curryRight': true, + 'partial': true, + 'partialRight': true + }; + + /** Used to map real names to their aliases. */ + exports.realToAlias = (function() { + var hasOwnProperty = Object.prototype.hasOwnProperty, + object = exports.aliasToReal, + result = {}; + + for (var key in object) { + var value = object[key]; + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } } + return result; + }()); + + /** Used to track methods that skip `_.rearg`. */ + exports.skipRearg = { + 'assign': true, + 'assignIn': true, + 'concat': true, + 'difference': true, + 'matchesProperty': true, + 'merge': true, + 'random': true, + 'range': true, + 'rangeRight': true, + 'zip': true, + 'zipObject': true }; diff --git a/doc/README.md b/doc/README.md index 5bd967f62b..b840f5ea06 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,4 +1,4 @@ -# lodash v4.0.1 +# lodash v4.1.0 @@ -66,6 +66,7 @@ * `_.xorWith` * `_.zip` * `_.zipObject` +* `_.zipObjectDeep` * `_.zipWith` @@ -241,7 +242,8 @@ * `_.get` * `_.has` * `_.hasIn` -* `_.invert` +* `_.invert` +* `_.invertBy` * `_.invoke` * `_.keys` * `_.keysIn` @@ -387,7 +389,7 @@ ### `_.chunk(array, [size=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5270 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5360 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") Creates an array of elements split into groups the length of `size`. If `array` can't be split evenly, the final chunk will be the remaining @@ -415,7 +417,7 @@ _.chunk(['a', 'b', 'c', 'd'], 3); ### `_.compact(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5301 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5391 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") Creates an array with all falsey values removed. The values `false`, `null`, `0`, `""`, `undefined`, and `NaN` are falsey. @@ -438,7 +440,7 @@ _.compact([0, 1, false, 2, '', 3]); ### `_.concat(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5337 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5427 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") Creates a new array concatenating `array` with any additional arrays and/or values. @@ -468,7 +470,7 @@ console.log(array); ### `_.difference(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5361 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5451 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") Creates an array of unique `array` values not included in the other provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -493,7 +495,7 @@ _.difference([3, 2, 1], [4, 2]); ### `_.differenceBy(array, [values], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5388 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5478 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") This method is like `_.difference` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to generate the criterion @@ -523,7 +525,7 @@ _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); ### `_.differenceWith(array, [values], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5417 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5507 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") This method is like `_.difference` except that it accepts `comparator` which is invoked to compare elements of `array` to `values`. The comparator @@ -551,7 +553,7 @@ _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); ### `_.drop(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5451 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5541 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") Creates a slice of `array` with `n` elements dropped from the beginning. @@ -583,7 +585,7 @@ _.drop([1, 2, 3], 0); ### `_.dropRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5484 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5574 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") Creates a slice of `array` with `n` elements dropped from the end. @@ -615,7 +617,7 @@ _.dropRight([1, 2, 3], 0); ### `_.dropRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5528 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5618 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") Creates a slice of `array` excluding elements dropped from the end. Elements are dropped until `predicate` returns falsey. The predicate is @@ -658,7 +660,7 @@ _.dropRightWhile(users, 'active'); ### `_.dropWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5568 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5658 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") Creates a slice of `array` excluding elements dropped from the beginning. Elements are dropped until `predicate` returns falsey. The predicate is @@ -701,7 +703,7 @@ _.dropWhile(users, 'active'); ### `_.fill(array, value, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5602 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5692 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") Fills elements of `array` with `value` from `start` up to, but not including, `end`. @@ -739,7 +741,7 @@ _.fill([4, 6, 8, 10], '*', 1, 3); ### `_.findIndex(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5647 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5737 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") This method is like `_.find` except that it returns the index of the first element `predicate` returns truthy for instead of the element itself. @@ -781,7 +783,7 @@ _.findIndex(users, 'active'); ### `_.findLastIndex(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5686 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5776 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") This method is like `_.findIndex` except that it iterates over elements of `collection` from right to left. @@ -823,7 +825,7 @@ _.findLastIndex(users, 'active'); ### `_.flatMap(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5712 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5802 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") Creates an array of flattened values by running each element in `array` through `iteratee` and concating its result to the other mapped values. @@ -852,7 +854,7 @@ _.flatMap([1, 2], duplicate); ### `_.flatten(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5730 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5820 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") Flattens `array` a single level. @@ -874,7 +876,7 @@ _.flatten([1, [2, 3, [4]]]); ### `_.flattenDeep(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5748 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5838 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") This method is like `_.flatten` except that it recursively flattens `array`. @@ -896,7 +898,7 @@ _.flattenDeep([1, [2, 3, [4]]]); ### `_.fromPairs(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5767 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5857 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") The inverse of `_.toPairs`; this method returns an object composed from key-value `pairs`. @@ -919,7 +921,7 @@ _.fromPairs([['fred', 30], ['barney', 40]]); ### `_.head(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5796 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5886 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") Gets the first element of `array`. @@ -947,7 +949,7 @@ _.head([]); ### `_.indexOf(array, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5823 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5913 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") Gets the index at which the first occurrence of `value` is found in `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -979,7 +981,7 @@ _.indexOf([1, 2, 1, 2], 2, 2); ### `_.initial(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5848 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5938 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") Gets all but the last element of `array`. @@ -1001,7 +1003,7 @@ _.initial([1, 2, 3]); ### `_.intersection([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5867 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5957 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") Creates an array of unique values that are included in all of the provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1025,7 +1027,7 @@ _.intersection([2, 1], [4, 2], [1, 2]); ### `_.intersectionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5894 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L5984 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") This method is like `_.intersection` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion @@ -1054,7 +1056,7 @@ _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.intersectionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5927 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6017 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") This method is like `_.intersection` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The comparator is invoked @@ -1082,7 +1084,7 @@ _.intersectionWith(objects, others, _.isEqual); ### `_.join(array, [separator=','])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5955 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6045 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") Converts all elements in `array` into a string separated by `separator`. @@ -1105,7 +1107,7 @@ _.join(['a', 'b', 'c'], '~'); ### `_.last(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5972 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6062 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") Gets the last element of `array`. @@ -1127,7 +1129,7 @@ _.last([1, 2, 3]); ### `_.lastIndexOf(array, value, [fromIndex=array.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5997 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6087 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") This method is like `_.indexOf` except that it iterates over elements of `array` from right to left. @@ -1156,7 +1158,7 @@ _.lastIndexOf([1, 2, 1, 2], 2, 2); ### `_.pull(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6039 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6129 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") Removes all provided values from `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1187,7 +1189,7 @@ console.log(array); ### `_.pullAll(array, values)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6150 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") This method is like `_.pull` except that it accepts an array of values to remove.
@@ -1216,7 +1218,7 @@ console.log(array); ### `_.pullAllBy(array, values, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6088 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6178 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") This method is like `_.pullAll` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to to generate the criterion @@ -1248,7 +1250,7 @@ console.log(array); ### `_.pullAt(array, [indexes])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6118 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6208 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") Removes elements from `array` corresponding to `indexes` and returns an array of removed elements. @@ -1281,7 +1283,7 @@ console.log(evens); ### `_.remove(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6152 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6242 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") Removes all elements from `array` that `predicate` returns truthy for and returns an array of the removed elements. The predicate is invoked with @@ -1317,7 +1319,7 @@ console.log(evens); ### `_.reverse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6194 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6284 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") Reverses `array` so that the first element becomes the last, the second element becomes the second to last, and so on. @@ -1346,7 +1348,7 @@ console.log(array); ### `_.slice(array, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6212 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6302 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") Creates a slice of `array` from `start` up to, but not including, `end`.
@@ -1369,7 +1371,7 @@ to ensure dense arrays are returned. ### `_.sortedIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6246 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6336 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") Uses a binary search to determine the lowest index at which `value` should be inserted into `array` in order to maintain its sort order. @@ -1396,7 +1398,7 @@ _.sortedIndex([4, 5], 4); ### `_.sortedIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6273 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6363 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") This method is like `_.sortedIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their @@ -1428,7 +1430,7 @@ _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); ### `_.sortedIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6292 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6382 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") This method is like `_.indexOf` except that it performs a binary search on a sorted `array`. @@ -1452,7 +1454,7 @@ _.sortedIndexOf([1, 1, 2, 2], 2); ### `_.sortedLastIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6319 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6409 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") This method is like `_.sortedIndex` except that it returns the highest index at which `value` should be inserted into `array` in order to @@ -1477,7 +1479,7 @@ _.sortedLastIndex([4, 5], 4); ### `_.sortedLastIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6341 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") This method is like `_.sortedLastIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their @@ -1504,7 +1506,7 @@ _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); ### `_.sortedLastIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6360 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6450 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") This method is like `_.lastIndexOf` except that it performs a binary search on a sorted `array`. @@ -1528,7 +1530,7 @@ _.sortedLastIndexOf([1, 1, 2, 2], 2); ### `_.sortedUniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6385 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6475 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") This method is like `_.uniq` except that it's designed and optimized for sorted arrays. @@ -1551,7 +1553,7 @@ _.sortedUniq([1, 1, 2]); ### `_.sortedUniqBy(array, [iteratee])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6406 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6496 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") This method is like `_.uniqBy` except that it's designed and optimized for sorted arrays. @@ -1575,7 +1577,7 @@ _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); ### `_.tail(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6425 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6515 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") Gets all but the first element of `array`. @@ -1597,7 +1599,7 @@ _.tail([1, 2, 3]); ### `_.take(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6453 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6543 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") Creates a slice of `array` with `n` elements taken from the beginning. @@ -1629,7 +1631,7 @@ _.take([1, 2, 3], 0); ### `_.takeRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6485 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6575 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") Creates a slice of `array` with `n` elements taken from the end. @@ -1661,7 +1663,7 @@ _.takeRight([1, 2, 3], 0); ### `_.takeRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6529 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6619 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") Creates a slice of `array` with elements taken from the end. Elements are taken until `predicate` returns falsey. The predicate is invoked with three @@ -1704,7 +1706,7 @@ _.takeRightWhile(users, 'active'); ### `_.takeWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6569 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6659 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") Creates a slice of `array` with elements taken from the beginning. Elements are taken until `predicate` returns falsey. The predicate is invoked with @@ -1747,7 +1749,7 @@ _.takeWhile(users, 'active'); ### `_.union([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6590 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6680 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") Creates an array of unique values, in order, from all of the provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1771,7 +1773,7 @@ _.union([2, 1], [4, 2], [1, 2]); ### `_.unionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6614 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6704 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") This method is like `_.union` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by which @@ -1800,7 +1802,7 @@ _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.unionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6641 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6731 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") This method is like `_.union` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The comparator is invoked @@ -1828,7 +1830,7 @@ _.unionWith(objects, others, _.isEqual); ### `_.uniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6665 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6755 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") Creates a duplicate-free version of an array, using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1853,7 +1855,7 @@ _.uniq([2, 1, 2]); ### `_.uniqBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6691 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6781 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") This method is like `_.uniq` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -1882,7 +1884,7 @@ _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); ### `_.uniqWith(array, [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6715 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6805 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") This method is like `_.uniq` except that it accepts `comparator` which is invoked to compare elements of `array`. The comparator is invoked with @@ -1909,7 +1911,7 @@ _.uniqWith(objects, _.isEqual); ### `_.unzip(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6739 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6829 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") This method is like `_.zip` except that it accepts an array of grouped elements and creates an array regrouping the elements to their pre-zip @@ -1936,7 +1938,7 @@ _.unzip(zipped); ### `_.unzipWith(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6774 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6864 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") This method is like `_.unzip` except that it accepts `iteratee` to specify how regrouped values should be combined. The iteratee is invoked with the @@ -1964,7 +1966,7 @@ _.unzipWith(zipped, _.add); ### `_.without(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6803 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6893 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") Creates an array excluding all provided values using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1989,7 +1991,7 @@ _.without([1, 2, 1, 3], 1, 2); ### `_.xor([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6823 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6913 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) of the provided arrays. @@ -2012,7 +2014,7 @@ _.xor([2, 1], [4, 2]); ### `_.xorBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6847 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6937 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") This method is like `_.xor` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by which @@ -2041,7 +2043,7 @@ _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.xorWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6874 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6964 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") This method is like `_.xor` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The comparator is invoked with @@ -2069,7 +2071,7 @@ _.xorWith(objects, others, _.isEqual); ### `_.zip([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6897 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L6987 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements @@ -2093,7 +2095,7 @@ _.zip(['fred', 'barney'], [30, 40], [true, false]); ### `_.zipObject([props=[]], [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6914 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7004 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") This method is like `_.fromPairs` except that it accepts two arrays, one of property names and one of corresponding values. @@ -2107,8 +2109,31 @@ one of property names and one of corresponding values. #### Example ```js -_.zipObject(['fred', 'barney'], [30, 40]); -// => { 'fred': 30, 'barney': 40 } +_.zipObject(['a', 'b'], [1, 2]); +// => { 'a': 1, 'b': 2 } +``` +* * * + + + + + +### `_.zipObjectDeep([props=[]], [values=[]])` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7022 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package") + +This method is like `_.zipObject` except that it supports property paths. + +#### Arguments +1. `[props=[]]` *(Array)*: The property names. +2. `[values=[]]` *(Array)*: The property values. + +#### Returns +*(Object)*: Returns the new object. + +#### Example +```js +_.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); +// => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } ``` * * * @@ -2117,7 +2142,7 @@ _.zipObject(['fred', 'barney'], [30, 40]); ### `_.zipWith([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6944 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7044 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") This method is like `_.zip` except that it accepts `iteratee` to specify how grouped values should be combined. The iteratee is invoked with the @@ -2150,7 +2175,7 @@ _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { ### `_.countBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7324 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7424 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") Creates an object composed of keys generated from the results of running each element of `collection` through `iteratee`. The corresponding value @@ -2179,7 +2204,7 @@ _.countBy(['one', 'two', 'three'], 'length'); ### `_.every(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7362 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7462 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") Checks if `predicate` returns truthy for **all** elements of `collection`. Iteration is stopped once `predicate` returns falsey. The predicate is @@ -2221,7 +2246,7 @@ _.every(users, 'active'); ### `_.filter(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7403 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7503 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") Iterates over elements of `collection`, returning an array of all elements `predicate` returns truthy for. The predicate is invoked with three arguments:
@@ -2263,7 +2288,7 @@ _.filter(users, 'active'); ### `_.find(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7442 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7542 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") Iterates over elements of `collection`, returning the first element `predicate` returns truthy for. The predicate is invoked with three arguments:
@@ -2306,7 +2331,7 @@ _.find(users, 'active'); ### `_.findLast(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7468 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7568 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") This method is like `_.find` except that it iterates over elements of `collection` from right to left. @@ -2332,7 +2357,7 @@ _.findLast([1, 2, 3, 4], function(n) { ### `_.forEach(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7505 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7605 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") Iterates over elements of `collection` invoking `iteratee` for each element. The iteratee is invoked with three arguments: (value, index|key, collection). @@ -2372,7 +2397,7 @@ _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { ### `_.forEachRight(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7529 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7629 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") This method is like `_.forEach` except that it iterates over elements of `collection` from right to left. @@ -2401,7 +2426,7 @@ _.forEachRight([1, 2], function(value) { ### `_.groupBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7556 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7656 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") Creates an object composed of keys generated from the results of running each element of `collection` through `iteratee`. The corresponding value @@ -2431,7 +2456,7 @@ _.groupBy(['one', 'two', 'three'], 'length'); ### `_.includes(collection, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7592 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7692 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") Checks if `value` is in `collection`. If `collection` is a string it's checked for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -2467,7 +2492,7 @@ _.includes('pebbles', 'eb'); ### `_.invokeMap(collection, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7627 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7727 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") Invokes the method at `path` of each element in `collection`, returning an array of the results of each invoked method. Any additional arguments @@ -2497,7 +2522,7 @@ _.invokeMap([123, 456], String.prototype.split, ''); ### `_.keyBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7667 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7767 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") Creates an object composed of keys generated from the results of running each element of `collection` through `iteratee`. The corresponding value @@ -2513,17 +2538,17 @@ iteratee is invoked with one argument: (value). #### Example ```js -var keyData = [ +var array = [ { 'dir': 'left', 'code': 97 }, { 'dir': 'right', 'code': 100 } ]; -_.keyBy(keyData, function(o) { +_.keyBy(array, function(o) { return String.fromCharCode(o.code); }); // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } -_.keyBy(keyData, 'dir'); +_.keyBy(array, 'dir'); // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } ``` * * * @@ -2533,7 +2558,7 @@ _.keyBy(keyData, 'dir'); ### `_.map(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7712 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7812 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") Creates an array of values by running each element in `collection` through `iteratee`. The iteratee is invoked with three arguments:
@@ -2585,7 +2610,7 @@ _.map(users, 'user'); ### `_.orderBy(collection, [iteratees=[_.identity]], [orders])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7744 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7844 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") This method is like `_.sortBy` except that it allows specifying the sort orders of the iteratees to sort by. If `orders` is unspecified, all values @@ -2620,7 +2645,7 @@ _.orderBy(users, ['user', 'age'], ['asc', 'desc']); ### `_.partition(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7793 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7893 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") Creates an array of elements split into two groups, the first of which contains elements `predicate` returns truthy for, the second of which @@ -2664,7 +2689,7 @@ _.partition(users, 'active'); ### `_.reduce(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7832 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7932 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") Reduces `collection` to a value which is the accumulated result of running each element in `collection` through `iteratee`, where each successive @@ -2694,7 +2719,7 @@ and `sortBy` ```js _.reduce([1, 2], function(sum, n) { return sum + n; -}); +}, 0); // => 3 _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { @@ -2710,7 +2735,7 @@ _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { ### `_.reduceRight(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7859 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7959 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") This method is like `_.reduce` except that it iterates over elements of `collection` from right to left. @@ -2739,7 +2764,7 @@ _.reduceRight(array, function(flattened, other) { ### `_.reject(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7898 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7998 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") The opposite of `_.filter`; this method returns the elements of `collection` that `predicate` does **not** return truthy for. @@ -2780,7 +2805,7 @@ _.reject(users, 'active'); ### `_.sample(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7919 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8019 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") Gets a random element from `collection`. @@ -2802,7 +2827,7 @@ _.sample([1, 2, 3, 4]); ### `_.sampleSize(collection, [n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7944 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8044 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") Gets `n` random elements at unique keys from `collection` up to the size of `collection`. @@ -2829,7 +2854,7 @@ _.sampleSize([1, 2, 3], 4); ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7976 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8076 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") Creates an array of shuffled values, using a version of the [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). @@ -2852,7 +2877,7 @@ _.shuffle([1, 2, 3, 4]); ### `_.size(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8000 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8100 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") Gets the size of `collection` by returning its length for array-like values or the number of own enumerable properties for objects. @@ -2881,7 +2906,7 @@ _.size('pebbles'); ### `_.some(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8045 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8145 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") Checks if `predicate` returns truthy for **any** element of `collection`. Iteration is stopped once `predicate` returns truthy. The predicate is @@ -2923,7 +2948,7 @@ _.some(users, 'active'); ### `_.sortBy(collection, [iteratees=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8086 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8186 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") Creates an array of elements, sorted in ascending order by the results of running each element in a collection through each iteratee. This method @@ -2970,7 +2995,7 @@ _.sortBy(users, 'user', function(o) { ### `_.now()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8117 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8217 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") Gets the timestamp of the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). @@ -2998,7 +3023,7 @@ _.defer(function(stamp) { ### `_.after(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8144 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8244 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") The opposite of `_.before`; this method creates a function that invokes `func` once it's called `n` or more times. @@ -3030,7 +3055,7 @@ _.forEach(saves, function(type) { ### `_.ary(func, [n=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8172 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8272 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") Creates a function that accepts up to `n` arguments, ignoring any additional arguments. @@ -3054,7 +3079,7 @@ _.map(['6', '8', '10'], _.ary(parseInt, 1)); ### `_.before(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8194 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8294 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") Creates a function that invokes `func`, with the `this` binding and arguments of the created function, while it's called less than `n` times. Subsequent @@ -3079,7 +3104,7 @@ jQuery(element).on('click', _.before(5, addContactToList)); ### `_.bind(func, thisArg, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8246 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8346 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") Creates a function that invokes `func` with the `this` binding of `thisArg` and prepends any additional `_.bind` arguments to those provided to the @@ -3125,7 +3150,7 @@ bound('hi'); ### `_.bindKey(object, key, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8299 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8399 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") Creates a function that invokes the method at `object[key]` and prepends any additional `_.bindKey` arguments to those provided to the bound function. @@ -3180,7 +3205,7 @@ bound('hi'); ### `_.curry(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8348 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8448 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") Creates a function that accepts arguments of `func` and either invokes `func` returning its result, if at least `arity` number of arguments have @@ -3230,7 +3255,7 @@ curried(1)(_, 3)(2); ### `_.curryRight(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8392 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8492 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") This method is like `_.curry` except that arguments are applied to `func` in the manner of `_.partialRight` instead of `_.partial`. @@ -3277,7 +3302,7 @@ curried(3)(1, _)(2); ### `_.debounce(func, [wait=0], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8448 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8548 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was @@ -3334,7 +3359,7 @@ jQuery(window).on('popstate', debounced.cancel); ### `_.defer(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8680 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") Defers invoking the `func` until the current call stack has cleared. Any additional arguments are provided to `func` when it's invoked. @@ -3360,7 +3385,7 @@ _.defer(function(text) { ### `_.delay(func, wait, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8602 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8702 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") Invokes `func` after `wait` milliseconds. Any additional arguments are provided to `func` when it's invoked. @@ -3387,7 +3412,7 @@ _.delay(function(text) { ### `_.flip(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8623 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8723 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") Creates a function that invokes `func` with arguments reversed. @@ -3413,7 +3438,7 @@ flipped('a', 'b', 'c', 'd'); ### `_.memoize(func, [resolver])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8669 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8769 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") Creates a function that memoizes the result of `func`. If `resolver` is provided it determines the cache key for storing the result based on the @@ -3465,7 +3490,7 @@ _.memoize.Cache = WeakMap; ### `_.negate(predicate)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8708 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8808 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") Creates a function that negates the result of the predicate `func`. The `func` predicate is invoked with the `this` binding and arguments of the @@ -3493,7 +3518,7 @@ _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); ### `_.once(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8734 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8834 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") Creates a function that is restricted to invoking `func` once. Repeat calls to the function return the value of the first invocation. The `func` is @@ -3519,7 +3544,7 @@ initialize(); ### `_.overArgs(func, [transforms])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8769 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8869 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") Creates a function that invokes `func` with arguments transformed by corresponding `transforms`. @@ -3558,7 +3583,7 @@ func(10, 5); ### `_.partial(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8816 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8916 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") Creates a function that invokes `func` with `partial` arguments prepended to those provided to the new function. This method is like `_.bind` except @@ -3601,7 +3626,7 @@ greetFred('hi'); ### `_.partialRight(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8852 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8952 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") This method is like `_.partial` except that partially applied arguments are appended to those provided to the new function. @@ -3643,7 +3668,7 @@ sayHelloTo('fred'); ### `_.rearg(func, indexes)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8879 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L8979 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") Creates a function that invokes `func` with arguments arranged according to the specified indexes where the argument value at the first index is @@ -3673,7 +3698,7 @@ rearged('b', 'c', 'a') ### `_.rest(func, [start=func.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8905 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9005 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") Creates a function that invokes `func` with the `this` binding of the created function and arguments from `start` and beyond provided as an array. @@ -3705,7 +3730,7 @@ say('hello', 'fred', 'barney', 'pebbles'); ### `_.spread(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8965 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9065 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") Creates a function that invokes `func` with the `this` binding of the created function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). @@ -3746,7 +3771,7 @@ numbers.then(_.spread(function(x, y) { ### `_.throttle(func, [wait=0], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9014 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9114 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") Creates a throttled function that only invokes `func` at most once per every `wait` milliseconds. The throttled function comes with a `cancel` @@ -3795,7 +3820,7 @@ jQuery(window).on('popstate', throttled.cancel); ### `_.unary(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9042 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9142 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") Creates a function that accepts up to one argument, ignoring any additional arguments. @@ -3818,7 +3843,7 @@ _.map(['6', '8', '10'], _.unary(parseInt)); ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9067 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9167 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") Creates a function that provides `value` to the wrapper function as its first argument. Any additional arguments provided to the function are @@ -3854,7 +3879,7 @@ p('fred, barney, & pebbles'); ### `_.clone(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9098 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9198 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") Creates a shallow clone of `value`.
@@ -3888,7 +3913,7 @@ console.log(shallow[0] === objects[0]); ### `_.cloneDeep(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9151 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9251 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") This method is like `_.clone` except that it recursively clones `value`. @@ -3913,7 +3938,7 @@ console.log(deep[0] === objects[0]); ### `_.cloneDeepWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9181 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9281 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") This method is like `_.cloneWith` except that it recursively clones `value`. @@ -3948,7 +3973,7 @@ console.log(el.childNodes.length); ### `_.cloneWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9131 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9231 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") This method is like `_.clone` except that it accepts `customizer` which is invoked to produce the cloned value. If `customizer` returns `undefined` @@ -3986,7 +4011,7 @@ console.log(el.childNodes.length); ### `_.eq(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9215 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9315 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) comparison between two values to determine if they are equivalent. @@ -4025,7 +4050,7 @@ _.eq(NaN, NaN); ### `_.gt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9239 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9339 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") Checks if `value` is greater than `other`. @@ -4054,7 +4079,7 @@ _.gt(1, 3); ### `_.gte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9263 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9363 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") Checks if `value` is greater than or equal to `other`. @@ -4083,7 +4108,7 @@ _.gte(1, 3); ### `_.isArguments(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9283 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9383 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") Checks if `value` is likely an `arguments` object. @@ -4108,7 +4133,7 @@ _.isArguments([1, 2, 3]); ### `_.isArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9312 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9412 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") Checks if `value` is classified as an `Array` object. @@ -4139,7 +4164,7 @@ _.isArray(_.noop); ### `_.isArrayLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9339 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9439 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") Checks if `value` is array-like. A value is considered array-like if it's not a function and has a `value.length` that's an integer greater than or @@ -4172,7 +4197,7 @@ _.isArrayLike(_.noop); ### `_.isArrayLikeObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9368 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9468 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") This method is like `_.isArrayLike` except that it also checks if `value` is an object. @@ -4204,7 +4229,7 @@ _.isArrayLikeObject(_.noop); ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9388 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9488 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") Checks if `value` is classified as a boolean primitive or object. @@ -4229,7 +4254,7 @@ _.isBoolean(null); ### `_.isDate(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9409 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9509 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") Checks if `value` is classified as a `Date` object. @@ -4254,7 +4279,7 @@ _.isDate('Mon April 23 2012'); ### `_.isElement(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9429 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9529 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") Checks if `value` is likely a DOM element. @@ -4279,7 +4304,7 @@ _.isElement(''); ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9460 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9560 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") Checks if `value` is empty. A value is considered empty unless it's an `arguments` object, array, string, or jQuery-like collection with a length @@ -4315,7 +4340,7 @@ _.isEmpty({ 'a': 1 }); ### `_.isEqual(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9493 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9600 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") Performs a deep comparison between two values to determine if they are equivalent. @@ -4352,7 +4377,7 @@ object === other; ### `_.isEqualWith(value, other, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9528 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9635 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") This method is like `_.isEqual` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined` comparisons are @@ -4392,7 +4417,7 @@ _.isEqualWith(array, other, customizer); ### `_.isError(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9551 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9658 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object. @@ -4418,7 +4443,7 @@ _.isError(Error); ### `_.isFinite(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9687 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") Checks if `value` is a finite primitive number.
@@ -4452,7 +4477,7 @@ _.isFinite(Infinity); ### `_.isFunction(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9600 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9707 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") Checks if `value` is classified as a `Function` object. @@ -4477,7 +4502,7 @@ _.isFunction(/abc/); ### `_.isInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9632 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9739 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") Checks if `value` is an integer.
@@ -4511,7 +4536,7 @@ _.isInteger('3'); ### `_.isLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9660 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9767 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") Checks if `value` is a valid array-like length.
@@ -4545,7 +4570,7 @@ _.isLength('3'); ### `_.isMatch(object, source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9743 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9848 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") Performs a deep comparison between `object` and `source` to determine if `object` contains equivalent property values. @@ -4577,7 +4602,7 @@ _.isMatch(object, { 'age': 36 }); ### `_.isMatchWith(object, source, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9778 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9883 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") This method is like `_.isMatch` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined` comparisons @@ -4617,7 +4642,7 @@ _.isMatchWith(object, source, customizer); ### `_.isNaN(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9808 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9913 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") Checks if `value` is `NaN`.
@@ -4652,7 +4677,7 @@ _.isNaN(undefined); ### `_.isNative(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9830 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9935 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") Checks if `value` is a native function. @@ -4677,7 +4702,7 @@ _.isNative(_); ### `_.isNil(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9880 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9985 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") Checks if `value` is `null` or `undefined`. @@ -4705,7 +4730,7 @@ _.isNil(NaN); ### `_.isNull(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9857 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9962 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") Checks if `value` is `null`. @@ -4730,7 +4755,7 @@ _.isNull(void 0); ### `_.isNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9909 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10014 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") Checks if `value` is classified as a `Number` primitive or object.
@@ -4765,7 +4790,7 @@ _.isNumber('3'); ### `_.isObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9687 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9794 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) @@ -4797,7 +4822,7 @@ _.isObject(null); ### `_.isObjectLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9717 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L9822 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") Checks if `value` is object-like. A value is object-like if it's not `null` and has a `typeof` result of "object". @@ -4829,7 +4854,7 @@ _.isObjectLike(null); ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9941 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10046 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") Checks if `value` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`. @@ -4865,7 +4890,7 @@ _.isPlainObject(Object.create(null)); ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9973 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10078 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") Checks if `value` is classified as a `RegExp` object. @@ -4890,7 +4915,7 @@ _.isRegExp('/abc/'); ### `_.isSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10002 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10107 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer. @@ -4925,7 +4950,7 @@ _.isSafeInteger('3'); ### `_.isString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10022 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10127 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") Checks if `value` is classified as a `String` primitive or object. @@ -4950,7 +4975,7 @@ _.isString(1); ### `_.isSymbol(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10043 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10148 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") Checks if `value` is classified as a `Symbol` primitive or object. @@ -4975,7 +5000,7 @@ _.isSymbol('abc'); ### `_.isTypedArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10064 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10169 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") Checks if `value` is classified as a typed array. @@ -5000,7 +5025,7 @@ _.isTypedArray([]); ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10084 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10189 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") Checks if `value` is `undefined`. @@ -5025,7 +5050,7 @@ _.isUndefined(null); ### `_.lt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10108 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10213 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") Checks if `value` is less than `other`. @@ -5054,7 +5079,7 @@ _.lt(3, 1); ### `_.lte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10132 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10237 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") Checks if `value` is less than or equal to `other`. @@ -5083,7 +5108,7 @@ _.lte(3, 1); ### `_.toArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10158 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10263 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") Converts `value` to an array. @@ -5114,7 +5139,7 @@ _.toArray(null); ### `_.toInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10198 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10303 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") Converts `value` to an integer.
@@ -5148,7 +5173,7 @@ _.toInteger('3'); ### `_.toLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10236 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10341 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") Converts `value` to an integer suitable for use as the length of an array-like object. @@ -5183,7 +5208,7 @@ _.toLength('3'); ### `_.toNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10262 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10367 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") Converts `value` to a number. @@ -5214,7 +5239,7 @@ _.toNumber('3'); ### `_.toPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10300 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10405 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") Converts `value` to a plain object flattening inherited enumerable properties of `value` to own properties of the plain object. @@ -5246,7 +5271,7 @@ _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); ### `_.toSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10327 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10432 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") Converts `value` to a safe integer. A safe integer can be compared and represented correctly. @@ -5278,7 +5303,7 @@ _.toSafeInteger('3'); ### `_.toString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10351 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10456 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") Converts `value` to a string if it's not one. An empty string is returned for `null` and `undefined` values. The sign of `-0` is preserved. @@ -5313,7 +5338,7 @@ _.toString([1, 2, 3]); ### `_.add(augend, addend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13577 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13696 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") Adds two numbers. @@ -5336,7 +5361,7 @@ _.add(6, 4); ### `_.ceil(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13608 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13727 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") Computes `number` rounded up to `precision`. @@ -5365,7 +5390,7 @@ _.ceil(6040, -2); ### `_.floor(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13630 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13749 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") Computes `number` rounded down to `precision`. @@ -5394,7 +5419,7 @@ _.floor(4060, -2); ### `_.max(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13649 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13768 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") Computes the maximum value of `array`. If `array` is empty or falsey `undefined` is returned. @@ -5420,7 +5445,7 @@ _.max([]); ### `_.maxBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13677 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13796 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") This method is like `_.max` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -5451,7 +5476,7 @@ _.maxBy(objects, 'n'); ### `_.mean(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13696 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13815 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") Computes the mean of the values in `array`. @@ -5473,7 +5498,7 @@ _.mean([4, 2, 8, 6]); ### `_.min(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13717 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13836 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") Computes the minimum value of `array`. If `array` is empty or falsey `undefined` is returned. @@ -5499,7 +5524,7 @@ _.min([]); ### `_.minBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13745 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13864 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") This method is like `_.min` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -5530,7 +5555,7 @@ _.minBy(objects, 'n'); ### `_.round(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13771 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13890 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") Computes `number` rounded to `precision`. @@ -5559,7 +5584,7 @@ _.round(4060, -2); ### `_.subtract(minuend, subtrahend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13787 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13906 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") Subtract two numbers. @@ -5582,7 +5607,7 @@ _.subtract(6, 4); ### `_.sum(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13811 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13930 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") Computes the sum of the values in `array`. @@ -5604,7 +5629,7 @@ _.sum([4, 2, 8, 6]); ### `_.sumBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13839 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13958 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") This method is like `_.sum` except that it accepts `iteratee` which is invoked for each element in `array` to generate the value to be summed. @@ -5641,7 +5666,7 @@ _.sumBy(objects, 'n'); ### `_.clamp(number, [lower], upper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11604 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11723 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") Clamps `number` within the inclusive `lower` and `upper` bounds. @@ -5668,7 +5693,7 @@ _.clamp(10, -5, 5); ### `_.inRange(number, [start=0], end)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11656 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11775 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") Checks if `n` is between `start` and up to but not including, `end`. If `end` is not specified it's set to `start` with `start` then set to `0`. @@ -5713,7 +5738,7 @@ _.inRange(-3, -2, -6); ### `_.random([lower=0], [upper=1], [floating])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11698 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11817 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") Produces a random number between the inclusive `lower` and `upper` bounds. If only one argument is provided a number between `0` and the given number @@ -5759,7 +5784,7 @@ _.random(1.2, 5.2); ### `_.assign(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10398 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10503 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") Assigns own enumerable properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources @@ -5799,7 +5824,7 @@ _.assign({ 'a': 1 }, new Foo, new Bar); ### `_.assignIn(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10536 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") This method is like `_.assign` except that it iterates over own and inherited source properties. @@ -5840,7 +5865,7 @@ _.assignIn({ 'a': 1 }, new Foo, new Bar); ### `_.assignInWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10462 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10567 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") This method is like `_.assignIn` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns `undefined` @@ -5879,7 +5904,7 @@ defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); ### `_.assignWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10492 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10597 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") This method is like `_.assign` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns `undefined` @@ -5915,7 +5940,7 @@ defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); ### `_.at(object, [paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10516 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10621 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") Creates an array of values corresponding to `paths` of `object`. @@ -5943,7 +5968,7 @@ _.at(['a', 'b', 'c'], 0, 2); ### `_.create(prototype, [properties])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10552 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10657 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") Creates an object that inherits from the `prototype` object. If a `properties` object is provided its own enumerable properties are assigned to the created object. @@ -5984,7 +6009,7 @@ circle instanceof Shape; ### `_.defaults(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10576 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10681 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") Assigns own and inherited enumerable properties of source objects to the destination object for all destination properties that resolve to `undefined`. @@ -6013,7 +6038,7 @@ _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); ### `_.defaultsDeep(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10599 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10704 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") This method is like `_.defaults` except that it recursively assigns default properties. @@ -6040,7 +6065,7 @@ _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'ag ### `_.findKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10637 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10742 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") This method is like `_.find` except that it returns the key of the first element `predicate` returns truthy for instead of the element itself. @@ -6082,7 +6107,7 @@ _.findKey(users, 'active'); ### `_.findLastKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10674 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10779 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") This method is like `_.findKey` except that it iterates over elements of a collection in the opposite order. @@ -6124,7 +6149,7 @@ _.findLastKey(users, 'active'); ### `_.forIn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10704 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10809 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") Iterates over own and inherited enumerable properties of an object invoking `iteratee` for each property. The iteratee is invoked with three arguments:
@@ -6159,7 +6184,7 @@ _.forIn(new Foo, function(value, key) { ### `_.forInRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10732 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10837 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") This method is like `_.forIn` except that it iterates over properties of `object` in the opposite order. @@ -6192,7 +6217,7 @@ _.forInRight(new Foo, function(value, key) { ### `_.forOwn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10762 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10867 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") Iterates over own enumerable properties of an object invoking `iteratee` for each property. The iteratee is invoked with three arguments:
@@ -6227,7 +6252,7 @@ _.forOwn(new Foo, function(value, key) { ### `_.forOwnRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10790 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10895 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") This method is like `_.forOwn` except that it iterates over properties of `object` in the opposite order. @@ -6260,7 +6285,7 @@ _.forOwnRight(new Foo, function(value, key) { ### `_.functions(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10815 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10920 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") Creates an array of function property names from own enumerable properties of `object`. @@ -6290,7 +6315,7 @@ _.functions(new Foo); ### `_.functionsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10840 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10945 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") Creates an array of function property names from own and inherited enumerable properties of `object`. @@ -6320,7 +6345,7 @@ _.functionsIn(new Foo); ### `_.get(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10868 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L10973 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") Gets the value at `path` of `object`. If the resolved value is `undefined` the `defaultValue` is used in its place. @@ -6353,7 +6378,7 @@ _.get(object, 'a.b.c', 'default'); ### `_.has(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10899 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11004 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") Checks if `path` is a direct property of `object`. @@ -6388,7 +6413,7 @@ _.has(other, 'a'); ### `_.hasIn(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10928 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11033 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") Checks if `path` is a direct or inherited property of `object`. @@ -6421,16 +6446,15 @@ _.hasIn(object, 'b'); -### `_.invert(object, [multiVal])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10955 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") +### `_.invert(object)` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11054 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") Creates an object composed of the inverted keys and values of `object`. If `object` contains duplicate values, subsequent values overwrite property -assignments of previous values unless `multiVal` is `true`. +assignments of previous values. #### Arguments 1. `object` *(Object)*: The object to invert. -2. `[multiVal]` *(boolean)*: Allow multiple values per key. #### Returns *(Object)*: Returns the new inverted object. @@ -6441,10 +6465,40 @@ var object = { 'a': 1, 'b': 2, 'c': 1 }; _.invert(object); // => { '1': 'c', '2': 'b' } +``` +* * * -// with `multiVal` -_.invert(object, true); + + + + +### `_.invertBy(object, [iteratee=_.identity])` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11083 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package") + +This method is like `_.invert` except that the inverted object is generated +from the results of running each element of `object` through `iteratee`. +The corresponding inverted value of each inverted key is an array of keys +responsible for generating the inverted value. The iteratee is invoked +with one argument: (value). + +#### Arguments +1. `object` *(Object)*: The object to invert. +2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element. + +#### Returns +*(Object)*: Returns the new inverted object. + +#### Example +```js +var object = { 'a': 1, 'b': 2, 'c': 1 }; + +_.invertBy(object); // => { '1': ['a', 'c'], '2': ['b'] } + +_.invertBy(object, function(value) { + return 'group' + value; +}); +// => { 'group1': ['a', 'c'], 'group2': ['b'] } ``` * * * @@ -6453,7 +6507,7 @@ _.invert(object, true); ### `_.invoke(object, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10989 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11108 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") Invokes the method at `path` of `object`. @@ -6479,7 +6533,7 @@ _.invoke(object, 'a[0].b.c.slice', 1, 3); ### `_.keys(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11018 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11137 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") Creates an array of the own enumerable property names of `object`.
@@ -6516,7 +6570,7 @@ _.keys('hi'); ### `_.keysIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11179 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") Creates an array of the own and inherited enumerable property names of `object`.
@@ -6548,7 +6602,7 @@ _.keysIn(new Foo); ### `_.mapKeys(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11098 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11217 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") The opposite of `_.mapValues`; this method creates an object with the same values as `object` and keys generated by running each own enumerable @@ -6575,7 +6629,7 @@ _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { ### `_.mapValues(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11133 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11252 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") Creates an object with the same keys as `object` and values generated by running each own enumerable property of `object` through `iteratee`. The @@ -6609,7 +6663,7 @@ _.mapValues(users, 'age'); ### `_.merge(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11172 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11291 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") Recursively merges own and inherited enumerable properties of source objects into the destination object, skipping source properties that resolve @@ -6648,7 +6702,7 @@ _.merge(users, ages); ### `_.mergeWith(object, sources, customizer)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11211 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11330 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") This method is like `_.merge` except that it accepts `customizer` which is invoked to produce the merged values of the destination and source @@ -6692,7 +6746,7 @@ _.mergeWith(object, other, customizer); ### `_.omit(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11233 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11352 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") The opposite of `_.pick`; this method creates an object composed of the own and inherited enumerable properties of `object` that are not omitted. @@ -6718,7 +6772,7 @@ _.omit(object, ['a', 'c']); ### `_.omitBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11259 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11378 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") The opposite of `_.pickBy`; this method creates an object composed of the own and inherited enumerable properties of `object` that `predicate` @@ -6745,7 +6799,7 @@ _.omitBy(object, _.isNumber); ### `_.pick(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11283 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11402 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") Creates an object composed of the picked `object` properties. @@ -6770,7 +6824,7 @@ _.pick(object, ['a', 'c']); ### `_.pickBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11304 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11423 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") Creates an object composed of the `object` properties `predicate` returns truthy for. The predicate is invoked with one argument: (value). @@ -6796,7 +6850,7 @@ _.pickBy(object, _.isNumber); ### `_.result(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11336 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11455 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") This method is like `_.get` except that if the resolved value is a function it's invoked with the `this` binding of its parent object and its result @@ -6833,7 +6887,7 @@ _.result(object, 'a[0].b.c3', _.constant('default')); ### `_.set(object, path, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11375 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11494 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") Sets the value at `path` of `object`. If a portion of `path` doesn't exist it's created. Arrays are created for missing index properties while objects @@ -6867,7 +6921,7 @@ console.log(object.x[0].y.z); ### `_.setWith(object, path, value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11398 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11517 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") This method is like `_.set` except that it accepts `customizer` which is invoked to produce the objects of `path`. If `customizer` returns `undefined` @@ -6895,7 +6949,7 @@ _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object); ### `_.toPairs(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11423 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11542 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") Creates an array of own enumerable key-value pairs for `object`. @@ -6924,7 +6978,7 @@ _.toPairs(new Foo); ### `_.toPairsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11447 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11566 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") Creates an array of own and inherited enumerable key-value pairs for `object`. @@ -6953,7 +7007,7 @@ _.toPairsIn(new Foo); ### `_.transform(object, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11479 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11598 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") An alternative to `_.reduce`; this method transforms `object` to a new `accumulator` object which is the result of running each of its own enumerable @@ -6975,12 +7029,12 @@ early by explicitly returning `false`. _.transform([2, 3, 4], function(result, n) { result.push(n *= n); return n % 2 == 0; -}); +}, []); // => [4, 9] _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { (result[value] || (result[value] = [])).push(key); -}); +}, {}); // => { '1': ['a', 'c'], '2': ['b'] } ``` * * * @@ -6990,7 +7044,7 @@ _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { ### `_.unset(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11525 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11644 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") Removes the property at `path` of `object`. @@ -7023,7 +7077,7 @@ console.log(object); ### `_.values(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11554 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11673 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") Creates an array of the own enumerable property values of `object`.
@@ -7058,7 +7112,7 @@ _.values('hi'); ### `_.valuesIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11699 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") Creates an array of the own and inherited enumerable property values of `object`.
@@ -7096,7 +7150,7 @@ _.valuesIn(new Foo); ### `_(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1445 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L1467 "View in source") [Ⓣ][1] Creates a `lodash` object which wraps `value` to enable implicit method chaining. Methods that operate on and return arrays, collections, and @@ -7152,20 +7206,21 @@ The chainable wrapper methods are:
`differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, -`intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`, -`iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, -`matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, -`methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, -`over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`, -`partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`, -`pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, -`reject`, `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, -`shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, -`takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, -`toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, -`unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, -`unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `without`, -`wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, and `zipWith` +`intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, +`invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, +`mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, +`method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, +`orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, +`partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, +`propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, +`rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, +`set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, +`tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, +`thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, +`transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, +`uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, +`without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, +`zipObjectDeep`, and `zipWith`

The wrapper methods that are **not** chainable by default are:
@@ -7225,7 +7280,7 @@ _.isArray(squares.value()); ### `_.chain(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6981 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7081 "View in source") [Ⓣ][1] Creates a `lodash` object that wraps `value` with explicit method chaining enabled. The result of such method chaining must be unwrapped with `_#value`. @@ -7261,7 +7316,7 @@ var youngest = _ ### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7009 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7109 "View in source") [Ⓣ][1] This method invokes `interceptor` and returns `value`. The interceptor is invoked with one argument; (value). The purpose of this method is to "tap into" @@ -7292,7 +7347,7 @@ _([1, 2, 3]) ### `_.thru(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7034 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7134 "View in source") [Ⓣ][1] This method is like `_.tap` except that it returns the result of `interceptor`. @@ -7321,7 +7376,7 @@ _(' abc ') ### `_.prototype[Symbol.iterator]()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7205 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7305 "View in source") [Ⓣ][1] Enables the wrapper to be iterable. @@ -7345,7 +7400,7 @@ Array.from(wrapped); ### `_.prototype.at([paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7057 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7157 "View in source") [Ⓣ][1] This method is the wrapper version of `_.at`. @@ -7372,7 +7427,7 @@ _(['a', 'b', 'c']).at(0, 2).value(); ### `_.prototype.chain()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7103 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7203 "View in source") [Ⓣ][1] Enables explicit method chaining on the wrapper object. @@ -7405,7 +7460,7 @@ _(users) ### `_.prototype.commit()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7132 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7232 "View in source") [Ⓣ][1] Executes the chained sequence and returns the wrapped result. @@ -7437,7 +7492,7 @@ console.log(array); ### `_.prototype.flatMap([iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7153 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7253 "View in source") [Ⓣ][1] This method is the wrapper version of `_.flatMap`. @@ -7463,7 +7518,7 @@ _([1, 2]).flatMap(duplicate).value(); ### `_.prototype.next()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7178 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7278 "View in source") [Ⓣ][1] Gets the next value on a wrapped object following the [iterator protocol](https://mdn.io/iteration_protocols#iterator). @@ -7491,7 +7546,7 @@ wrapped.next(); ### `_.prototype.plant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7232 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7332 "View in source") [Ⓣ][1] Creates a clone of the chained sequence planting `value` as the wrapped value. @@ -7523,7 +7578,7 @@ wrapped.value(); ### `_.prototype.reverse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7271 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7371 "View in source") [Ⓣ][1] This method is the wrapper version of `_.reverse`.
@@ -7550,7 +7605,7 @@ console.log(array); ### `_.prototype.value()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7298 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L7398 "View in source") [Ⓣ][1] Executes the chained sequence to extract the unwrapped value. @@ -7578,7 +7633,7 @@ _([1, 2, 3]).value(); ### `_.camelCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11758 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11877 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). @@ -7606,7 +7661,7 @@ _.camelCase('__foo_bar__'); ### `_.capitalize([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11777 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11896 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") Converts the first character of `string` to upper case and the remaining to lower case. @@ -7629,7 +7684,7 @@ _.capitalize('FRED'); ### `_.deburr([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11795 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11914 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). @@ -7652,7 +7707,7 @@ _.deburr('déjà vu'); ### `_.endsWith([string=''], [target], [position=string.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11821 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11940 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") Checks if `string` ends with the given target string. @@ -7682,7 +7737,7 @@ _.endsWith('abc', 'b', 2); ### `_.escape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11866 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L11985 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to their corresponding HTML entities. @@ -7727,7 +7782,7 @@ _.escape('fred, barney, & pebbles'); ### `_.escapeRegExp([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11887 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12006 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. @@ -7750,7 +7805,7 @@ _.escapeRegExp('[lodash](https://lodash.com/)'); ### `_.kebabCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11913 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12032 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). @@ -7778,7 +7833,7 @@ _.kebabCase('__foo_bar__'); ### `_.lowerCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11936 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12055 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") Converts `string`, as space separated words, to lower case. @@ -7806,7 +7861,7 @@ _.lowerCase('__FOO_BAR__'); ### `_.lowerFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11956 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12075 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") Converts the first character of `string` to lower case. @@ -7831,7 +7886,7 @@ _.lowerFirst('FRED'); ### `_.pad([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11998 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12117 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") Pads `string` on the left and right sides if it's shorter than `length`. Padding characters are truncated if they can't be evenly divided by `length`. @@ -7862,7 +7917,7 @@ _.pad('abc', 3); ### `_.padEnd([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12035 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12154 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") Pads `string` on the right side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. @@ -7893,7 +7948,7 @@ _.padEnd('abc', 3); ### `_.padStart([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12062 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12181 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") Pads `string` on the left side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. @@ -7924,7 +7979,7 @@ _.padStart('abc', 3); ### `_.parseInt(string, [radix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12090 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12209 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") Converts `string` to an integer of the specified radix. If `radix` is `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, @@ -7956,7 +8011,7 @@ _.map(['6', '08', '10'], _.parseInt); ### `_.repeat([string=''], [n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12122 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12241 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") Repeats the given string `n` times. @@ -7985,7 +8040,7 @@ _.repeat('abc', 0); ### `_.replace([string=''], pattern, replacement)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12160 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12279 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") Replaces matches for `pattern` in `string` with `replacement`.
@@ -8012,7 +8067,7 @@ _.replace('Hi Fred', 'Fred', 'Barney'); ### `_.snakeCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12186 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12305 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). @@ -8040,7 +8095,7 @@ _.snakeCase('--foo-bar'); ### `_.split([string=''], separator, [limit])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12207 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12326 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") Splits `string` by `separator`.
@@ -8067,7 +8122,7 @@ _.split('a-b-c', '-', 2); ### `_.startCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12230 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12349 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). @@ -8095,7 +8150,7 @@ _.startCase('__foo_bar__'); ### `_.startsWith([string=''], [target], [position=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12255 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12374 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") Checks if `string` starts with the given target string. @@ -8125,7 +8180,7 @@ _.startsWith('abc', 'b', 1); ### `_.template([string=''], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12357 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12476 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escape interpolated data properties in @@ -8232,7 +8287,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.toLower([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12482 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12601 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") Converts `string`, as a whole, to lower case. @@ -8260,7 +8315,7 @@ _.toLower('__FOO_BAR__'); ### `_.toUpper([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12505 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12624 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") Converts `string`, as a whole, to upper case. @@ -8288,7 +8343,7 @@ _.toUpper('__foo_bar__'); ### `_.trim([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12530 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12649 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package") Removes leading and trailing whitespace or specified characters from `string`. @@ -8317,7 +8372,7 @@ _.map([' foo ', ' bar '], _.trim); ### `_.trimEnd([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12566 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12685 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") Removes trailing whitespace or specified characters from `string`. @@ -8343,7 +8398,7 @@ _.trimEnd('-_-abc-_-', '_-'); ### `_.trimStart([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12600 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12719 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") Removes leading whitespace or specified characters from `string`. @@ -8369,7 +8424,7 @@ _.trimStart('-_-abc-_-', '_-'); ### `_.truncate([string=''], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12652 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12771 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package") Truncates `string` if it's longer than the given maximum string length. The last characters of the truncated string are replaced with the omission @@ -8414,7 +8469,7 @@ _.truncate('hi-diddly-ho there, neighborino', { ### `_.unescape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12726 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12845 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package") The inverse of `_.escape`; this method converts the HTML entities `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their @@ -8442,7 +8497,7 @@ _.unescape('fred, barney, & pebbles'); ### `_.upperCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12752 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12871 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") Converts `string`, as space separated words, to upper case. @@ -8470,7 +8525,7 @@ _.upperCase('__foo_bar__'); ### `_.upperFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11974 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12093 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") Converts the first character of `string` to upper case. @@ -8495,7 +8550,7 @@ _.upperFirst('FRED'); ### `_.words([string=''], [pattern])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12774 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12893 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") Splits `string` into an array of its words. @@ -8527,7 +8582,7 @@ _.words('fred, barney, & pebbles', /[^, ]+/g); ### `_.attempt(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12806 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12925 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package") Attempts to invoke `func`, returning either the result or the caught error object. Any additional arguments are provided to `func` when it's invoked. @@ -8556,7 +8611,7 @@ if (_.isError(elements)) { ### `_.bindAll(object, methodNames)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12840 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12959 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package") Binds methods of an object to the object itself, overwriting the existing method. @@ -8591,7 +8646,7 @@ jQuery(element).on('click', view.onClick); ### `_.cond(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12875 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L12994 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package") Creates a function that iterates over `pairs` invoking the corresponding function of the first predicate to return truthy. The predicate-function @@ -8628,7 +8683,7 @@ func({ 'a': '1', 'b': '2' }); ### `_.conforms(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12917 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13036 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package") Creates a function that invokes the predicate properties of `source` with the corresponding property values of a given object, returning `true` if @@ -8657,7 +8712,7 @@ _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) })); ### `_.constant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12937 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13056 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") Creates a function that returns `value`. @@ -8682,7 +8737,7 @@ getter() === object; ### `_.flow([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12963 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13082 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package") Creates a function that returns the result of invoking the provided functions with the `this` binding of the created function, where each @@ -8711,7 +8766,7 @@ addSquare(1, 2); ### `_.flowRight([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12984 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13103 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package") This method is like `_.flow` except that it creates a function that invokes the provided functions from right to left. @@ -8739,7 +8794,7 @@ addSquare(1, 2); ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13001 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13120 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") This method returns the first argument provided to it. @@ -8763,7 +8818,7 @@ _.identity(object) === object; ### `_.iteratee([func=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13034 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13153 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package") Creates a function that invokes `func` with the arguments of the created function. If `func` is a property name the created callback returns the @@ -8801,7 +8856,7 @@ _.filter(users, 'age > 36'); ### `_.matches(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13062 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13181 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package") Creates a function that performs a deep partial comparison between a given object and `source`, returning `true` if the given object has equivalent @@ -8833,7 +8888,7 @@ _.filter(users, _.matches({ 'age': 40, 'active': false })); ### `_.matchesProperty(path, srcValue)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13089 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13208 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package") Creates a function that performs a deep partial comparison between the value at `path` of a given object to `srcValue`, returning `true` if the @@ -8866,7 +8921,7 @@ _.find(users, _.matchesProperty('user', 'fred')); ### `_.method(path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13116 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13235 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package") Creates a function that invokes the method at `path` of a given object. Any additional arguments are provided to the invoked method. @@ -8898,7 +8953,7 @@ _.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); ### `_.methodOf(object, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13144 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13263 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package") The opposite of `_.method`; this method creates a function that invokes the method at a given path of `object`. Any additional arguments are @@ -8929,7 +8984,7 @@ _.map([['a', '2'], ['c', '0']], _.methodOf(object)); ### `_.mixin([object=lodash], source, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13186 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13305 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package") Adds all own enumerable function properties of a source object to the destination object. If `object` is a function then methods are added to @@ -8974,7 +9029,7 @@ _('fred').vowels(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13234 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13353 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package") Reverts the `_` variable to its previous value and returns a reference to the `lodash` function. @@ -8993,7 +9048,7 @@ var lodash = _.noConflict(); ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13255 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13374 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package") A no-operation function that returns `undefined` regardless of the arguments it receives. @@ -9012,7 +9067,7 @@ _.noop(object) === undefined; ### `_.nthArg([n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13274 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13393 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") Creates a function that returns its nth argument. @@ -9036,7 +9091,7 @@ func('a', 'b', 'c'); ### `_.over(iteratees)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13297 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13416 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package") Creates a function that invokes `iteratees` with the arguments provided to the created function and returns their results. @@ -9061,7 +9116,7 @@ func(1, 2, 3, 4); ### `_.overEvery(predicates)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13321 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13440 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package") Creates a function that checks if **all** of the `predicates` return truthy when invoked with the arguments provided to the created function. @@ -9092,7 +9147,7 @@ func(NaN); ### `_.overSome(predicates)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13345 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13464 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package") Creates a function that checks if **any** of the `predicates` return truthy when invoked with the arguments provided to the created function. @@ -9123,7 +9178,7 @@ func(NaN); ### `_.property(path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13368 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13487 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package") Creates a function that returns the value at `path` of a given object. @@ -9153,7 +9208,7 @@ _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); ### `_.propertyOf(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13392 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13511 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package") The opposite of `_.property`; this method creates a function that returns the value at a given path of `object`. @@ -9182,7 +9237,7 @@ _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); ### `_.range([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13437 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13556 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package") Creates an array of numbers (positive and/or negative) progressing from `start` up to, but not including, `end`. A step of `-1` is used if a negative @@ -9231,7 +9286,7 @@ _.range(0); ### `_.rangeRight([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13473 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13592 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package") This method is like `_.range` except that it populates values in descending order. @@ -9274,7 +9329,7 @@ _.rangeRight(0); ### `_.runInContext([context=root])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1246 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L1267 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package") Create a new pristine `lodash` function using the `context` object. @@ -9318,7 +9373,7 @@ var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; ### `_.times(n, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13493 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13612 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package") Invokes the iteratee function `n` times, returning an array of the results of each invocation. The iteratee is invoked with one argument; (index). @@ -9345,7 +9400,7 @@ _.times(3, String); ### `_.toPath(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13536 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13655 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") Converts `value` to a property path array. @@ -9379,7 +9434,7 @@ console.log(path === newPath); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13556 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L13675 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package") Generates a unique ID. If `prefix` is provided the ID is appended to it. @@ -9410,7 +9465,7 @@ _.uniqueId(); ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L14187 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L14308 "View in source") [Ⓣ][1] (string): The semantic version number. @@ -9421,7 +9476,7 @@ _.uniqueId(); ### `_.templateSettings` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1490 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L1512 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package") (Object): By default, the template delimiters used by lodash are like those in embedded Ruby (ERB). Change the following template settings to use @@ -9434,7 +9489,7 @@ alternative delimiters. ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1498 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L1520 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to be HTML-escaped. @@ -9445,7 +9500,7 @@ alternative delimiters. ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1506 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L1528 "View in source") [Ⓣ][1] (RegExp): Used to detect code to be evaluated. @@ -9456,7 +9511,7 @@ alternative delimiters. ### `_.templateSettings.imports` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1530 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L1552 "View in source") [Ⓣ][1] (Object): Used to import variables into the compiled template. @@ -9467,7 +9522,7 @@ alternative delimiters. ### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1514 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L1536 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to inject. @@ -9478,7 +9533,7 @@ alternative delimiters. ### `_.templateSettings.variable` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1522 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L1544 "View in source") [Ⓣ][1] (string): Used to reference the data object in the template text. @@ -9495,7 +9550,7 @@ alternative delimiters. ### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1538 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.1.0/lodash.js#L1560 "View in source") [Ⓣ][1] A reference to the `lodash` function. diff --git a/fp/_baseConvert.js b/fp/_baseConvert.js index 10a7d70bc1..5e71b64d8b 100644 --- a/fp/_baseConvert.js +++ b/fp/_baseConvert.js @@ -149,6 +149,7 @@ function baseConvert(util, name, func) { }; var wrap = function(name, func) { + name = mapping.aliasToReal[name] || name; var wrapper = wrappers[name]; if (wrapper) { return wrapper(func); @@ -215,7 +216,7 @@ function baseConvert(util, name, func) { // Wrap the lodash method and its aliases. each(keys(_), function(key) { - each(mapping.alias[key] || [], function(alias) { + each(mapping.realToAlias[key] || [], function(alias) { _[alias] = _[key]; }); }); diff --git a/fp/_mapping.js b/fp/_mapping.js index 4f1e607ee0..711ac45c5e 100644 --- a/fp/_mapping.js +++ b/fp/_mapping.js @@ -1,202 +1,220 @@ -module.exports = { - - /** Used to map method names to their aliases. */ - 'alias': { - 'ary': ['nAry'], - 'assignIn': ['extend'], - 'assignInWith': ['extendWith'], - 'filter': ['whereEq'], - 'flatten': ['unnest'], - 'flow': ['pipe'], - 'flowRight': ['compose'], - 'forEach': ['each'], - 'forEachRight': ['eachRight'], - 'get': ['path', 'prop'], - 'getOr': ['pathOr', 'propOr'], - 'head': ['first'], - 'includes': ['contains'], - 'initial': ['init'], - 'isEqual': ['equals'], - 'mapValues': ['mapObj'], - 'matchesProperty': ['pathEq'], - 'omit': ['dissoc', 'omitAll'], - 'overArgs': ['useWith'], - 'overEvery': ['allPass'], - 'overSome': ['somePass'], - 'pick': ['pickAll'], - 'propertyOf': ['propOf'], - 'rest': ['unapply'], - 'some': ['all'], - 'spread': ['apply'], - 'zipObject': ['zipObj'] - }, - - /** Used to map method names to their iteratee ary. */ - 'aryIteratee': { - 'assignWith': 2, - 'assignInWith': 2, - 'cloneDeepWith': 1, - 'cloneWith': 1, - 'dropRightWhile': 1, - 'dropWhile': 1, - 'every': 1, - 'filter': 1, - 'find': 1, - 'findIndex': 1, - 'findKey': 1, - 'findLast': 1, - 'findLastIndex': 1, - 'findLastKey': 1, - 'flatMap': 1, - 'forEach': 1, - 'forEachRight': 1, - 'forIn': 1, - 'forInRight': 1, - 'forOwn': 1, - 'forOwnRight': 1, - 'isEqualWith': 2, - 'isMatchWith': 2, - 'map': 1, - 'mapKeys': 1, - 'mapValues': 1, - 'partition': 1, - 'reduce': 2, - 'reduceRight': 2, - 'reject': 1, - 'remove': 1, - 'some': 1, - 'takeRightWhile': 1, - 'takeWhile': 1, - 'times': 1, - 'transform': 2 - }, +/** Used to map aliases to their real names. */ +exports.aliasToReal = { + 'all': 'some', + 'allPass': 'overEvery', + 'apply': 'spread', + 'compose': 'flowRight', + 'contains': 'includes', + 'dissoc': 'omit', + 'each': 'forEach', + 'eachRight': 'forEachRight', + 'equals': 'isEqual', + 'extend': 'assignIn', + 'extendWith': 'assignInWith', + 'first': 'head', + 'init': 'initial', + 'mapObj': 'mapValues', + 'omitAll': 'omit', + 'nAry': 'ary', + 'path': 'get', + 'pathEq': 'matchesProperty', + 'pathOr': 'getOr', + 'pickAll': 'pick', + 'pipe': 'flow', + 'prop': 'get', + 'propOf': 'propertyOf', + 'propOr': 'getOr', + 'somePass': 'overSome', + 'unapply': 'rest', + 'unnest': 'flatten', + 'useWith': 'overArgs', + 'whereEq': 'filter', + 'zipObj': 'zipObject' +}; - /** Used to map ary to method names. */ - 'aryMethod': { - 1:[ - 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', - 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', - 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', - 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words' - ], - 2:[ - 'add', 'after', 'ary', 'assign', 'at', 'before', 'bind', 'bindKey', - 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', - 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', - 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', - 'every', 'extend', 'filter', 'find', 'find', 'findIndex', 'findKey', - 'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'forEach', - 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', - 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', - 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', - 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', - 'merge', 'minBy', 'omit', 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', - 'padStart', 'parseInt', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', - 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', - 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', - 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', - 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', - 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy', - 'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject' - ], - 3:[ - 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', - 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', - 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', - 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', - 'unionWith', 'xorBy', 'xorWith', 'zipWith' - ], - 4:[ - 'fill', 'setWith' - ] - }, +/** Used to map method names to their iteratee ary. */ +exports.aryIteratee = { + 'assignWith': 2, + 'assignInWith': 2, + 'cloneDeepWith': 1, + 'cloneWith': 1, + 'dropRightWhile': 1, + 'dropWhile': 1, + 'every': 1, + 'filter': 1, + 'find': 1, + 'findIndex': 1, + 'findKey': 1, + 'findLast': 1, + 'findLastIndex': 1, + 'findLastKey': 1, + 'flatMap': 1, + 'forEach': 1, + 'forEachRight': 1, + 'forIn': 1, + 'forInRight': 1, + 'forOwn': 1, + 'forOwnRight': 1, + 'isEqualWith': 2, + 'isMatchWith': 2, + 'map': 1, + 'mapKeys': 1, + 'mapValues': 1, + 'partition': 1, + 'reduce': 2, + 'reduceRight': 2, + 'reject': 1, + 'remove': 1, + 'some': 1, + 'takeRightWhile': 1, + 'takeWhile': 1, + 'times': 1, + 'transform': 2 +}; - /** Used to map ary to rearg configs. */ - 'aryRearg': { - 2: [1, 0], - 3: [2, 1, 0], - 4: [3, 2, 0, 1] - }, +/** Used to map ary to method names. */ +exports.aryMethod = { + 1: [ + 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', + 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', + 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', + 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words' + ], + 2: [ + 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey', + 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', + 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', + 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every', + 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', + 'findLastKey', 'flatMap', 'forEach', 'forEachRight', 'forIn', 'forInRight', + 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', + 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap', + 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', + 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit', + 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', + 'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'pullAt', 'random', 'range', + 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'result', 'sampleSize', + 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex', + 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'startsWith', 'subtract', + 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap', 'throttle', + 'thru', 'times', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', + 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep' + ], + 3: [ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', + 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', + 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', + 'unionWith', 'xorBy', 'xorWith', 'zipWith' + ], + 4: [ + 'fill', 'setWith' + ] +}; - /** Used to map method names to iteratee rearg configs. */ - 'iterateeRearg': { - 'findKey': [1], - 'findLastKey': [1], - 'mapKeys': [1] - }, +/** Used to map ary to rearg configs. */ +exports.aryRearg = { + 2: [1, 0], + 3: [2, 1, 0], + 4: [3, 2, 0, 1] +}; - /** Used to map method names to rearg configs. */ - 'methodRearg': { - 'clamp': [2, 0, 1], - 'reduce': [2, 0, 1], - 'reduceRight': [2, 0, 1], - 'set': [2, 0, 1], - 'setWith': [3, 1, 2, 0], - 'slice': [2, 0, 1], - 'transform': [2, 0, 1] - }, +/** Used to map method names to iteratee rearg configs. */ +exports.iterateeRearg = { + 'findKey': [1], + 'findLastKey': [1], + 'mapKeys': [1] +}; - /** Used to iterate `mapping.aryMethod` keys. */ - 'caps': [1, 2, 3, 4], +/** Used to map method names to rearg configs. */ +exports.methodRearg = { + 'assignInWith': [1, 2, 0], + 'assignWith': [1, 2, 0], + 'clamp': [2, 0, 1], + 'mergeWith': [1, 2, 0], + 'reduce': [2, 0, 1], + 'reduceRight': [2, 0, 1], + 'set': [2, 0, 1], + 'setWith': [3, 1, 2, 0], + 'slice': [2, 0, 1], + 'transform': [2, 0, 1] +}; - /** Used to map keys to other keys. */ - 'key': { - 'curryN': 'curry', - 'curryRightN': 'curryRight', - 'getOr': 'get' - }, +/** Used to iterate `mapping.aryMethod` keys. */ +exports.caps = [1, 2, 3, 4]; - /** Used to identify methods which mutate arrays or objects. */ - 'mutate': { - 'array': { - 'fill': true, - 'pull': true, - 'pullAll': true, - 'pullAllBy': true, - 'pullAt': true, - 'remove': true, - 'reverse': true - }, - 'object': { - 'assign': true, - 'assignIn': true, - 'assignInWith': true, - 'assignWith': true, - 'defaults': true, - 'defaultsDeep': true, - 'merge': true, - 'mergeWith': true - }, - 'set': { - 'set': true, - 'setWith': true - } - }, +/** Used to map keys to other keys. */ +exports.key = { + 'curryN': 'curry', + 'curryRightN': 'curryRight', + 'getOr': 'get' +}; - /** Used to track methods with placeholder support */ - 'placeholder': { - 'bind': true, - 'bindKey': true, - 'curry': true, - 'curryRight': true, - 'partial': true, - 'partialRight': true +/** Used to identify methods which mutate arrays or objects. */ +exports.mutate = { + 'array': { + 'fill': true, + 'pull': true, + 'pullAll': true, + 'pullAllBy': true, + 'pullAt': true, + 'remove': true, + 'reverse': true }, - - /** Used to track methods that skip `_.rearg`. */ - 'skipRearg': { + 'object': { 'assign': true, 'assignIn': true, - 'concat': true, + 'assignInWith': true, + 'assignWith': true, 'defaults': true, 'defaultsDeep': true, - 'difference': true, - 'matchesProperty': true, 'merge': true, - 'random': true, - 'range': true, - 'rangeRight': true, - 'zip': true, - 'zipObject': true + 'mergeWith': true + }, + 'set': { + 'set': true, + 'setWith': true + } +}; + +/** Used to track methods with placeholder support */ +exports.placeholder = { + 'bind': true, + 'bindKey': true, + 'curry': true, + 'curryRight': true, + 'partial': true, + 'partialRight': true +}; + +/** Used to map real names to their aliases. */ +exports.realToAlias = (function() { + var hasOwnProperty = Object.prototype.hasOwnProperty, + object = exports.aliasToReal, + result = {}; + + for (var key in object) { + var value = object[key]; + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } } + return result; +}()); + +/** Used to track methods that skip `_.rearg`. */ +exports.skipRearg = { + 'assign': true, + 'assignIn': true, + 'concat': true, + 'difference': true, + 'matchesProperty': true, + 'merge': true, + 'random': true, + 'range': true, + 'rangeRight': true, + 'zip': true, + 'zipObject': true }; diff --git a/lib/doc/build.js b/lib/doc/build.js new file mode 100644 index 0000000000..e4057260ef --- /dev/null +++ b/lib/doc/build.js @@ -0,0 +1,55 @@ +'use strict'; + +var _ = require('lodash'), + docdown = require('docdown'), + fs = require('fs-extra'), + path = require('path'); + +var basePath = path.join(__dirname, '..', '..'), + docPath = path.join(basePath, 'doc'), + readmePath = path.join(docPath, 'README.md'); + +var pkg = require('../../package.json'), + version = pkg.version; + +var config = { + 'base': { + 'entryLinks': [ + '<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' + + 'print("[Ⓝ](https://www.npmjs.com/package/lodash." + name.toLowerCase() + " \\"See the npm package\\")")' + + '} %>' + ], + 'path': path.join(basePath, 'lodash.js'), + 'title': 'lodash v' + version + '', + 'toc': 'categories', + 'url': 'https://github.com/lodash/lodash/blob/' + version + '/lodash.js' + }, + 'github': { + 'hash': 'github' + }, + 'site': { + 'tocLink': '#docs' + } +}; + +function postprocess(string) { + // Fix docdown bug by wrapping symbol property identifiers in brackets. + return string.replace(/\.(Symbol\.(?:[a-z]+[A-Z]?)+)/g, '[$1]'); +} + +/*----------------------------------------------------------------------------*/ + +function onComplete(error) { + if (error) { + throw error; + } +} + +function build(type) { + var options = _.defaults({}, config.base, config[type]), + markdown = docdown(options); + + fs.writeFile(readmePath, postprocess(markdown), onComplete); +} + +build(_.last(process.argv)); diff --git a/lib/fp/build-dist.js b/lib/fp/build-dist.js index c88dd4e5c2..7ca89e41dd 100644 --- a/lib/fp/build-dist.js +++ b/lib/fp/build-dist.js @@ -44,8 +44,12 @@ function onComplete(error) { } } -async.series([ - _.partial(webpack, mappingConfig), - _.partial(webpack, fpConfig), - _.partial(minify, path.join(distPath, filename)) -], onComplete); +function build() { + async.series([ + _.partial(webpack, mappingConfig), + _.partial(webpack, fpConfig), + _.partial(minify, path.join(distPath, filename)) + ], onComplete); +} + +build(); diff --git a/lib/fp/build-modules.js b/lib/fp/build-modules.js new file mode 100644 index 0000000000..02a1bbfd6c --- /dev/null +++ b/lib/fp/build-modules.js @@ -0,0 +1,115 @@ +'use strict'; + +var _ = require('lodash'), + async = require('async'), + fs = require('fs-extra'), + glob = require('glob'), + path = require('path'); + +var mapping = require('../../fp/_mapping'); + +var templatePath = path.join(__dirname, 'template'); + +var template = _.transform(glob.sync(path.join(templatePath, '*.jst')), function(result, filePath) { + result[path.basename(filePath, '.jst')] = _.template(fs.readFileSync(filePath)); +}, {}); + +var aryMethods = _.union( + mapping.aryMethod[1], + mapping.aryMethod[2], + mapping.aryMethod[3], + mapping.aryMethod[4] +); + +var categories = [ + 'array', + 'collection', + 'date', + 'function', + 'lang', + 'math', + 'number', + 'object', + 'seq', + 'string', + 'util' +]; + +function isAlias(funcName) { + return _.has(mapping.aliasToReal, funcName); +} + +function isCategory(funcName) { + return _.includes(categories, funcName); +} + +function isThru(funcName) { + return !_.includes(aryMethods, funcName); +} + +function getTemplate(moduleName) { + var data = { + 'key': mapping.key, + 'name': _.result(mapping.aliasToReal, moduleName, moduleName) + }; + + if (isAlias(moduleName)) { + return template.alias(data); + } + if (isCategory(moduleName)) { + return template.category(data); + } + if (isThru(moduleName)) { + return template.thru(data); + } + return template.module(data); +} + +/*----------------------------------------------------------------------------*/ + +function onComplete(error) { + if (error) { + throw error; + } +} + +function build(target) { + var fpPath = path.join(target, 'fp'); + + // Glob existing lodash module paths. + var modulePaths = glob.sync(path.join(target, '*.js'), { + 'nodir': true, + 'ignore': [ + '_*.js', + 'core.js', + 'fp.js', + 'index.js', + 'lodash.js' + ].map(function(filename) { + return path.join(target, filename); + }) + }); + + // Add FP alias and remapped module paths. + _.each([mapping.aliasToReal, mapping.key], function(data) { + _.forOwn(data, function(realName, alias) { + modulePaths.push(path.join(target, alias + '.js')); + }); + }); + + modulePaths = _.uniq(modulePaths); + + var actions = modulePaths.map(function(modulePath) { + var moduleName = path.basename(modulePath, '.js'); + return _.partial(fs.writeFile, path.join(fpPath, moduleName + '.js'), getTemplate(moduleName)); + }); + + actions.unshift(_.partial(fs.copy, path.join(__dirname, '../../fp'), fpPath)); + actions.push(_.partial(fs.writeFile, path.join(target, 'fp.js'), template.fp())); + actions.push(_.partial(fs.writeFile, path.join(fpPath, 'convert.js'), template.convert())); + actions.push(_.partial(fs.writeFile, path.join(fpPath, '_util.js'), template._util())); + + async.series(actions, onComplete); +} + +build(_.last(process.argv)); diff --git a/lib/fp/template/_util.jst b/lib/fp/template/_util.jst index 1fb05e435b..d076f46430 100644 --- a/lib/fp/template/_util.jst +++ b/lib/fp/template/_util.jst @@ -2,9 +2,9 @@ module.exports = { 'ary': require('../ary'), 'cloneDeep': require('../cloneDeep'), 'curry': require('../curry'), - 'forEach': require('../internal/arrayEach'), + 'forEach': require('../_arrayEach'), 'isFunction': require('../isFunction'), 'iteratee': require('../iteratee'), - 'keys': require('../internal/baseKeys'), + 'keys': require('../_baseKeys'), 'rearg': require('../rearg') }; diff --git a/lib/fp/template/alias.jst b/lib/fp/template/alias.jst new file mode 100644 index 0000000000..6d72710a34 --- /dev/null +++ b/lib/fp/template/alias.jst @@ -0,0 +1 @@ +module.exports = require('./<%= name %>'); diff --git a/lib/fp/template/category.jst b/lib/fp/template/category.jst new file mode 100644 index 0000000000..62c2db8a16 --- /dev/null +++ b/lib/fp/template/category.jst @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../<%= name %>')); diff --git a/lib/fp/template/fp.jst b/lib/fp/template/fp.jst new file mode 100644 index 0000000000..d8887e0fe7 --- /dev/null +++ b/lib/fp/template/fp.jst @@ -0,0 +1,2 @@ +var _ = require('./lodash').noConflict().runInContext(); +module.exports = require('./fp/convert')(_); diff --git a/lib/fp/template/module.jst b/lib/fp/template/module.jst new file mode 100644 index 0000000000..6a06f20155 --- /dev/null +++ b/lib/fp/template/module.jst @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert('<%= name %>', require('../<%= _.result(key, name, name) %>')); diff --git a/lib/fp/template/thru.jst b/lib/fp/template/thru.jst new file mode 100644 index 0000000000..de0b105e75 --- /dev/null +++ b/lib/fp/template/thru.jst @@ -0,0 +1 @@ +module.exports = require('../<%= name %>'); diff --git a/lib/main/build-dist.js b/lib/main/build-dist.js index 1f5a883594..338dfe9eb3 100644 --- a/lib/main/build-dist.js +++ b/lib/main/build-dist.js @@ -22,7 +22,11 @@ function onComplete(error) { } } -async.series([ - _.partial(fs.copy, baseLodash, distLodash), - _.partial(minify, distLodash) -], onComplete); +function build() { + async.series([ + _.partial(fs.copy, baseLodash, distLodash), + _.partial(minify, distLodash) + ], onComplete); +} + +build(); diff --git a/lib/main/build-modules.js b/lib/main/build-modules.js new file mode 100644 index 0000000000..a7f5183094 --- /dev/null +++ b/lib/main/build-modules.js @@ -0,0 +1,23 @@ +'use strict'; + +var _ = require('lodash'), + fs = require('fs-extra'), + path = require('path'); + +var basePath = path.join(__dirname, '..', '..'), + distPath = path.join(basePath, 'dist'), + corePath = path.join(distPath, 'lodash.core.js'); + +/*----------------------------------------------------------------------------*/ + +function onComplete(error) { + if (error) { + throw error; + } +} + +function build(target) { + fs.copy(corePath, path.join(target, 'core.js'), onComplete); +} + +build(_.last(process.argv)); diff --git a/lodash.js b/lodash.js index 95aef79608..f0b0b6bbea 100644 --- a/lodash.js +++ b/lodash.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.0.1 (Custom Build) + * lodash 4.1.0 (Custom Build) * Build: `lodash -d -o ./lodash.js` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.0.1'; + var VERSION = '4.1.0'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -411,6 +411,27 @@ return func.apply(thisArg, args); } + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + /** * Creates a new array concatenating `array` with `other`. * @@ -820,7 +841,7 @@ result = result === undefined ? current : (result + current); } } - return result; + return length ? result : 0; } /** @@ -1378,20 +1399,21 @@ * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`, - * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, - * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, - * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, - * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`, - * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`, - * `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, - * `reject`, `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, - * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, - * `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, - * `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, - * `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, - * `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `without`, - * `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, and `zipWith` + * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, + * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, + * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, + * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, + * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, + * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, + * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, + * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, + * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, + * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, + * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, + * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, + * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, + * `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, @@ -2123,6 +2145,24 @@ } } + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. @@ -2669,6 +2709,24 @@ return result; } + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + /** * The base implementation of `_.invoke` without support for individual * method arguments. @@ -2999,7 +3057,7 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = object[key], srcValue = source[key], - stacked = stack.get(srcValue) || stack.get(objValue); + stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); @@ -3018,6 +3076,7 @@ newValue = copyArray(objValue); } else { + isCommon = false; newValue = baseClone(srcValue); } } @@ -3026,6 +3085,7 @@ newValue = toPlainObject(objValue); } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + isCommon = false; newValue = baseClone(srcValue); } else { @@ -3626,6 +3686,27 @@ return (result && result.length) ? baseUniq(result, iteratee, comparator) : []; } + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property names. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + assignFunc(result, props[index], index < valsLength ? values[index] : undefined); + } + return result; + } + /** * Creates a clone of `buffer`. * @@ -3843,29 +3924,16 @@ * Creates a function like `_.groupBy`. * * @private - * @param {Function} setter The function to set keys and values of the accumulator object. - * @param {Function} [initializer] The function to initialize the accumulator object. + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { - var result = initializer ? initializer() : {}; - iteratee = getIteratee(iteratee); - - if (isArray(collection)) { - var index = -1, - length = collection.length; + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; - while (++index < length) { - var value = collection[index]; - setter(result, value, iteratee(value), collection); - } - } else { - baseEach(collection, function(value, key, collection) { - setter(result, value, iteratee(value), collection); - }); - } - return result; + return func(collection, setter, getIteratee(iteratee), accumulator); }; } @@ -4198,6 +4266,20 @@ return wrapper; } + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + /** * Creates a function like `_.over`. * @@ -4840,8 +4922,11 @@ result = hasFunc(object, path); } } - return result || (isLength(object && object.length) && isIndex(path, object.length) && - (isArray(object) || isString(object) || isArguments(object))); + var length = object ? object.length : undefined; + return result || ( + !!length && isLength(length) && isIndex(path, length) && + (isArray(object) || isString(object) || isArguments(object)) + ); } /** @@ -4871,6 +4956,9 @@ * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { + if (isPrototype(object)) { + return {}; + } var Ctor = object.constructor; return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); } @@ -4930,9 +5018,11 @@ */ function indexKeys(object) { var length = object ? object.length : undefined; - return (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) - ? baseTimes(length, String) - : null; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; } /** @@ -6908,19 +6998,29 @@ * @returns {Object} Returns the new object. * @example * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { - var index = -1, - length = props ? props.length : 0, - valsLength = values ? values.length : 0, - result = {}; + return baseZipObject(props || [], values || [], assignValue); + } - while (++index < length) { - baseSet(result, props[index], index < valsLength ? values[index] : undefined); - } - return result; + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} [props=[]] The property names. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); } /** @@ -7651,17 +7751,17 @@ * @returns {Object} Returns the composed aggregate object. * @example * - * var keyData = [ + * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * - * _.keyBy(keyData, function(o) { + * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * - * _.keyBy(keyData, 'dir'); + * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { @@ -7820,7 +7920,7 @@ * * _.reduce([1, 2], function(sum, n) { * return sum + n; - * }); + * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { @@ -9458,9 +9558,16 @@ * // => false */ function isEmpty(value) { - return (!isObjectLike(value) || isFunction(value.splice)) - ? !size(value) - : !keys(value).length; + if (isArrayLike(value) && + (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { + return !value.length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; } /** @@ -9685,8 +9792,6 @@ * // => false */ function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } @@ -10932,14 +11037,12 @@ /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values unless `multiVal` is `true`. + * assignments of previous values. * * @static * @memberOf _ * @category Object * @param {Object} object The object to invert. - * @param {boolean} [multiVal] Allow multiple values per key. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @returns {Object} Returns the new inverted object. * @example * @@ -10947,27 +11050,43 @@ * * _.invert(object); * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` through `iteratee`. + * The corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). * - * // with `multiVal` - * _.invert(object, true); + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to invert. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ - function invert(object, multiVal, guard) { - return arrayReduce(keys(object), function(result, key) { - var value = object[key]; - if (multiVal && !guard) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } - else { - result[value] = key; - } - return result; - }, {}); - } + var invertBy = createInverter(function(result, value, key) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); /** * Invokes the method at `path` of `object`. @@ -11468,12 +11587,12 @@ * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; - * }); + * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); - * }); + * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { @@ -13811,7 +13930,7 @@ function sum(array) { return (array && array.length) ? baseSum(array, identity) - : undefined; + : 0; } /** @@ -13839,7 +13958,7 @@ function sumBy(array, iteratee) { return (array && array.length) ? baseSum(array, getIteratee(iteratee)) - : undefined; + : 0; } /*------------------------------------------------------------------------*/ @@ -13928,6 +14047,7 @@ lodash.intersectionBy = intersectionBy; lodash.intersectionWith = intersectionWith; lodash.invert = invert; + lodash.invertBy = invertBy; lodash.invokeMap = invokeMap; lodash.iteratee = iteratee; lodash.keyBy = keyBy; @@ -14016,6 +14136,7 @@ lodash.xorWith = xorWith; lodash.zip = zip; lodash.zipObject = zipObject; + lodash.zipObjectDeep = zipObjectDeep; lodash.zipWith = zipWith; // Add aliases. diff --git a/package.json b/package.json index c142c8573f..bb4464c037 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash", - "version": "4.0.1", + "version": "4.1.0", "main": "lodash.js", "private": true, "devDependencies": { @@ -9,27 +9,40 @@ "codecov.io": "~0.1.6", "coveralls": "^2.11.6", "curl-amd": "~0.8.12", - "docdown": "~0.3.0", + "docdown": "~0.4.0", "dojo": "^1.10.4", "ecstatic": "^1.4.0", - "fs-extra": "~0.26.4", + "fs-extra": "~0.26.5", "glob": "^6.0.4", "istanbul": "0.4.2", "jquery": "^2.2.0", - "jscs": "^2.8.0", + "jscs": "^2.9.0", "lodash": "^3.10.1", "platform": "^1.3.1", "qunit-extras": "^1.4.5", "qunitjs": "~1.20.0", - "request": "^2.67.0", + "request": "^2.69.0", "requirejs": "^2.1.22", "sauce-tunnel": "2.3.0", "uglify-js": "2.6.1", - "webpack": "^1.12.11" + "webpack": "^1.12.12" }, "scripts": { - "build": "node lib/main/build-dist.js && node lib/fp/build-dist.js", - "style": "jscs lodash.js lib/**/*.js", - "test": "npm run build && node test/test && node test/test-fp" + "build": "npm run build:main & npm run build:fp", + "build:fp": "node lib/fp/build-dist.js", + "build:fp-modules": "node lib/fp/build-modules.js", + "build:main": "node lib/main/build-dist.js", + "build:main-modules": "node lib/main/build-modules.js", + "doc": "node lib/doc/build github", + "doc:site": "node lib/doc/build site", + "pretest": "npm run build", + "style": "npm run style:main & npm run style:fp & npm run style:perf & npm run style:test", + "style:fp": "jscs fp/*.js lib/**/*.js", + "style:main": "jscs lodash.js", + "style:perf": "jscs perf/*.js perf/**/*.js", + "style:test": "jscs test/*.js test/**/*.js", + "test": "npm run test:main && npm run test:fp", + "test:fp": "node test/test-fp", + "test:main": "node test/test" } } diff --git a/perf/perf.js b/perf/perf.js index 5ac64ee663..a7da378021 100644 --- a/perf/perf.js +++ b/perf/perf.js @@ -43,11 +43,11 @@ if (!amd) { try { result = require('fs').realpathSync(result); - } catch(e) {} + } catch (e) {} try { result = require.resolve(result); - } catch(e) {} + } catch (e) {} } return result; }()); diff --git a/test/asset/worker.js b/test/asset/worker.js index 513f33bfac..5ce98f6005 100644 --- a/test/asset/worker.js +++ b/test/asset/worker.js @@ -4,7 +4,7 @@ addEventListener('message', function(e) { if (e.data) { try { importScripts('../' + e.data); - } catch(e) { + } catch (e) { self._ = { 'VERSION': e.message }; } postMessage(_.VERSION); diff --git a/test/backbone.html b/test/backbone.html index 78682abdbf..dd3df9fe05 100644 --- a/test/backbone.html +++ b/test/backbone.html @@ -51,6 +51,7 @@ 'groupBy', 'includes', 'invert', + 'invokeMap', 'keyBy', 'omit', 'partition', diff --git a/test/test-fp.js b/test/test-fp.js index 79e960150e..7ac1344bd9 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -115,11 +115,8 @@ QUnit.test('should have correct aliases', function(assert) { assert.expect(1); - var actual = _.transform(mapping.alias, function(result, aliases, methodName) { - var func = fp[methodName]; - _.each(aliases, function(alias) { - result.push([alias, fp[alias] === func]); - }); + var actual = _.transform(mapping.aliasToReal, function(result, realName, alias) { + result.push([alias, fp[alias] === fp[realName]]); }, []); assert.deepEqual(_.reject(actual, 1), []); @@ -373,6 +370,274 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('key methods'); + + (function() { + var object = { 'a': 1 }; + + QUnit.test('should provide the correct `iteratee` arguments', function(assert) { + assert.expect(3); + + _.each(['findKey', 'findLastKey', 'mapKeys'], function(methodName) { + var args; + + var actual = fp[methodName](function() { + args || (args = slice.call(arguments)); + }, object); + + assert.deepEqual(args, ['a'], 'fp.' + methodName); + }); + }); + }()); + + /*--------------------------------------------------------------------------*/ + + QUnit.module('mutation methods'); + + (function() { + var array = [1, 2, 3], + object = { 'a': 1 }, + deepObject = { 'a': { 'b': 2, 'c': 3 } }; + + QUnit.test('should not mutate values', function(assert) { + assert.expect(36); + + function Foo() {} + Foo.prototype = { 'b': 2 }; + + var value = _.clone(object), + actual = fp.assign(value, { 'b': 2 }); + + assert.deepEqual(value, object, 'fp.assign'); + assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assign'); + + value = _.clone(object); + actual = fp.assignWith(function(objValue, srcValue) { + return srcValue; + }, value, { 'b': 2 }); + + assert.deepEqual(value, object, 'fp.assignWith'); + assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assignWith'); + + value = _.clone(object); + actual = fp.assignIn(value, new Foo); + + assert.deepEqual(value, object, 'fp.assignIn'); + assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assignIn'); + + value = _.clone(object); + actual = fp.assignInWith(function(objValue, srcValue) { + return srcValue; + }, value, new Foo); + + assert.deepEqual(value, object, 'fp.assignInWith'); + assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assignInWith'); + + value = _.clone(object); + actual = fp.defaults({ 'a': 2, 'b': 2 }, value); + + assert.deepEqual(value, object, 'fp.defaults'); + assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.defaults'); + + value = _.cloneDeep(deepObject); + actual = fp.defaultsDeep({ 'a': { 'c': 4, 'd': 4 } }, deepObject); + + assert.deepEqual(value, { 'a': { 'b': 2, 'c': 3 } }, 'fp.defaultsDeep'); + assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3, 'd': 4 } }, 'fp.defaultsDeep'); + + value = _.clone(object); + actual = fp.extend(value, new Foo); + + assert.deepEqual(value, object, 'fp.extend'); + assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.extend'); + + value = _.clone(object); + actual = fp.extendWith(function(objValue, srcValue) { + return srcValue; + }, value, new Foo); + + assert.deepEqual(value, object, 'fp.extendWith'); + assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.extendWith'); + + value = _.clone(array); + actual = fp.fill(1, 2, '*', value); + + assert.deepEqual(value, array, 'fp.fill'); + assert.deepEqual(actual, [1, '*', 3], 'fp.fill'); + + value = _.cloneDeep(deepObject); + actual = fp.merge(value, { 'a': { 'd': 4 } }); + + assert.deepEqual(value, { 'a': { 'b': 2, 'c': 3 } }, 'fp.merge'); + assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3, 'd': 4 } }, 'fp.merge'); + + value = _.cloneDeep(deepObject); + value.a.b = [1]; + + actual = fp.mergeWith(function(objValue, srcValue) { + if (_.isArray(objValue)) { + return objValue.concat(srcValue); + } + }, value, { 'a': { 'b': [2, 3] } }); + + assert.deepEqual(value, { 'a': { 'b': [1], 'c': 3 } }, 'fp.mergeWith'); + assert.deepEqual(actual, { 'a': { 'b': [1, 2, 3], 'c': 3 } }, 'fp.mergeWith'); + + value = _.clone(array); + actual = fp.pull(2, value); + + assert.deepEqual(value, array, 'fp.pull'); + assert.deepEqual(actual, [1, 3], 'fp.pull'); + + value = _.clone(array); + actual = fp.pullAll([1, 3], value); + + assert.deepEqual(value, array, 'fp.pullAll'); + assert.deepEqual(actual, [2], 'fp.pullAll'); + + value = _.clone(array); + actual = fp.pullAt([0, 2], value); + + assert.deepEqual(value, array, 'fp.pullAt'); + assert.deepEqual(actual, [2], 'fp.pullAt'); + + value = _.clone(array); + actual = fp.remove(function(value) { + return value === 2; + }, value); + + assert.deepEqual(value, array, 'fp.remove'); + assert.deepEqual(actual, [1, 3], 'fp.remove'); + + value = _.clone(array); + actual = fp.reverse(value); + + assert.deepEqual(value, array, 'fp.reverse'); + assert.deepEqual(actual, [3, 2, 1], 'fp.reverse'); + + value = _.cloneDeep(deepObject); + actual = fp.set('a.b', 3, value); + + assert.deepEqual(value, deepObject, 'fp.set'); + assert.deepEqual(actual, { 'a': { 'b': 3, 'c': 3 } }, 'fp.set'); + + value = _.cloneDeep(deepObject); + actual = fp.setWith(Object, 'd.e', 4, value); + + assert.deepEqual(value, deepObject, 'fp.setWith'); + assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } }, 'fp.setWith'); + }); + }()); + + /*--------------------------------------------------------------------------*/ + + QUnit.module('placeholder methods'); + + _.forOwn(mapping.placeholder, function(truthy, methodName) { + var func = fp[methodName]; + + QUnit.test('`_.' + methodName + '` should have a `placeholder` property', function(assert) { + assert.expect(1); + + assert.ok(_.isObject(func.placeholder)); + }); + }); + + /*--------------------------------------------------------------------------*/ + + QUnit.module('reduce methods'); + + _.each(['reduce', 'reduceRight'], function(methodName) { + var func = fp[methodName], + isReduce = methodName == 'reduce'; + + QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments when iterating an array', function(assert) { + assert.expect(1); + + var args, + array = [1, 2, 3]; + + func(function() { + args || (args = slice.call(arguments)); + })(0, array); + + assert.deepEqual(args, isReduce ? [0, 1] : [0, 3]); + }); + + QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments when iterating an object', function(assert) { + assert.expect(1); + + var args, + object = { 'a': 1, 'b': 2 }, + isFIFO = _.keys(object)[0] == 'a'; + + var expected = isFIFO + ? (isReduce ? [0, 1] : [0, 2]) + : (isReduce ? [0, 2] : [0, 1]); + + func(function() { + args || (args = slice.call(arguments)); + })(0, object); + + assert.deepEqual(args, expected); + }); + }); + + /*--------------------------------------------------------------------------*/ + + QUnit.module('with methods'); + + (function() { + var array = [1, 2, 3], + object = { 'a': 1 }; + + QUnit.test('should provide the correct `customizer` arguments', function(assert) { + assert.expect(4); + + var args, + value = _.clone(object); + + fp.assignWith(function() { + args || (args = _.map(arguments, _.cloneDeep)); + }, value, { 'b': 2 }); + + assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.assignWith'); + + args = undefined; + value = _.clone(object); + + fp.extendWith(function() { + args || (args = _.map(arguments, _.cloneDeep)); + }, value, { 'b': 2 }); + + assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.extendWith'); + + var stack = { '__data__': { 'array': [], 'map': null } }, + expected = [[1], [2, 3], 'a', { 'a': [1] }, { 'a': [2, 3] }, stack]; + + args = undefined; + value = { 'a': [1] }; + + fp.mergeWith(function() { + args || (args = _.map(arguments, _.cloneDeep)); + }, value, { 'a': [2, 3] }); + + args[5] = _.omitBy(args[5], _.isFunction); + assert.deepEqual(args, expected, 'fp.mergeWith'); + + args = undefined; + value = _.clone(object); + + fp.setWith(function() { + args || (args = _.map(arguments, _.cloneDeep)); + }, 'b.c', 2, value); + + assert.deepEqual(args, [undefined, 'b', { 'a': 1 }], 'fp.setWith'); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('fp.difference'); (function() { @@ -385,6 +650,33 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('fp.extend'); + + (function() { + QUnit.test('should convert by name', function(assert) { + assert.expect(2); + + function Foo() {} + Foo.prototype = { 'b': 2 }; + + var object = { 'a': 1 }; + + if (!document) { + var extend = convert('extend', _.extend), + value = _.clone(object), + actual = extend(value, new Foo); + + assert.deepEqual(value, object); + assert.deepEqual(actual, { 'a': 1, 'b': 2 }); + } + else { + skipTest(assert, 2); + } + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('fp.fill'); (function() { @@ -607,20 +899,6 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('placeholder methods'); - - _.forOwn(mapping.placeholder, function(truthy, methodName) { - var func = fp[methodName]; - - QUnit.test('`_.' + methodName + '` should have a `placeholder` property', function(assert) { - assert.expect(1); - - assert.ok(_.isObject(func.placeholder)); - }); - }); - - /*--------------------------------------------------------------------------*/ - QUnit.module('fp.random'); (function() { @@ -653,46 +931,6 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('reduce methods'); - - _.each(['reduce', 'reduceRight'], function(methodName) { - var func = fp[methodName], - isReduce = methodName == 'reduce'; - - QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments when iterating an array', function(assert) { - assert.expect(1); - - var args, - array = [1, 2, 3]; - - func(function() { - args || (args = slice.call(arguments)); - })(0, array); - - assert.deepEqual(args, isReduce ? [0, 1] : [0, 3]); - }); - - QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments when iterating an object', function(assert) { - assert.expect(1); - - var args, - object = { 'a': 1, 'b': 2 }, - isFIFO = _.keys(object)[0] == 'a'; - - var expected = isFIFO - ? (isReduce ? [0, 1] : [0, 2]) - : (isReduce ? [0, 2] : [0, 1]); - - func(function() { - args || (args = slice.call(arguments)); - })(0, object); - - assert.deepEqual(args, expected); - }); - }); - - /*--------------------------------------------------------------------------*/ - QUnit.module('fp.runInContext'); (function() { @@ -773,202 +1011,6 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('key methods'); - - (function() { - var object = { 'a': 1 }; - - QUnit.test('should provide the correct `iteratee` arguments', function(assert) { - assert.expect(3); - - _.each(['findKey', 'findLastKey', 'mapKeys'], function(methodName) { - var args; - - var actual = fp[methodName](function() { - args || (args = slice.call(arguments)); - }, object); - - assert.deepEqual(args, ['a'], 'fp.' + methodName); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('mutation methods'); - - (function() { - var array = [1, 2, 3], - object = { 'a': 1 }, - deepObject = { 'a': { 'b': 2, 'c': 3 } }; - - QUnit.test('should not mutate values', function(assert) { - assert.expect(32); - - function Foo() {} - Foo.prototype = { 'b': 2 }; - - var value = _.clone(object), - actual = fp.assign({ 'b': 2 }, value); - - assert.deepEqual(value, object, 'fp.assign'); - assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assign'); - - value = _.clone(object); - actual = fp.assignWith(function(objValue, srcValue) { - return srcValue; - }, { 'b': 2 }, value); - - assert.deepEqual(value, object, 'fp.assignWith'); - assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assignWith'); - - value = _.clone(object); - actual = fp.defaults(value, { 'a': 2, 'b': 2 }); - - assert.deepEqual(value, object, 'fp.defaults'); - assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.defaults'); - - value = _.clone(object); - value.b = { 'c': 1 }; - actual = fp.defaultsDeep(value, { 'b': { 'c': 2, 'd': 2 } }); - - assert.deepEqual(value, { 'a': 1, 'b': { 'c': 1 } } , 'fp.defaultsDeep'); - assert.deepEqual(actual, { 'a': 1, 'b': { 'c': 1, 'd': 2 } }, 'fp.defaultsDeep'); - - value = _.clone(object); - actual = fp.extend(new Foo, value); - - assert.deepEqual(value, object, 'fp.extend'); - assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.extend'); - - value = _.clone(object); - actual = fp.extendWith(function(objValue, srcValue) { - return srcValue; - }, new Foo, value); - - assert.deepEqual(value, object, 'fp.extendWith'); - assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.extendWith'); - - value = _.clone(array); - actual = fp.fill(1, 2, '*', value); - - assert.deepEqual(value, array, 'fp.fill'); - assert.deepEqual(actual, [1, '*', 3], 'fp.fill'); - - value = { 'a': { 'b': 2 } }; - actual = fp.merge({ 'a': { 'c': 3 } }, value); - - assert.deepEqual(value, { 'a': { 'b': 2 } }, 'fp.merge'); - assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 } }, 'fp.merge'); - - value = { 'a': [1] }; - actual = fp.mergeWith(function(objValue, srcValue) { - if (_.isArray(objValue)) { - return objValue.concat(srcValue); - } - }, { 'a': [2, 3] }, value); - - assert.deepEqual(value, { 'a': [1] }, 'fp.mergeWith'); - assert.deepEqual(actual, { 'a': [1, 2, 3] }, 'fp.mergeWith'); - - value = _.clone(array); - actual = fp.pull(2, value); - - assert.deepEqual(value, array, 'fp.pull'); - assert.deepEqual(actual, [1, 3], 'fp.pull'); - - value = _.clone(array); - actual = fp.pullAll([1, 3], value); - - assert.deepEqual(value, array, 'fp.pullAll'); - assert.deepEqual(actual, [2], 'fp.pullAll'); - - value = _.clone(array); - actual = fp.pullAt([0, 2], value); - - assert.deepEqual(value, array, 'fp.pullAt'); - assert.deepEqual(actual, [2], 'fp.pullAt'); - - value = _.clone(array); - actual = fp.remove(function(value) { - return value === 2; - }, value); - - assert.deepEqual(value, array, 'fp.remove'); - assert.deepEqual(actual, [1, 3], 'fp.remove'); - - value = _.clone(array); - actual = fp.reverse(value); - - assert.deepEqual(value, array, 'fp.reverse'); - assert.deepEqual(actual, [3, 2, 1], 'fp.reverse'); - - value = _.cloneDeep(deepObject); - actual = fp.set('a.b', 3, value); - - assert.deepEqual(value, deepObject, 'fp.set'); - assert.deepEqual(actual, { 'a': { 'b': 3, 'c': 3 } }, 'fp.set'); - - value = _.cloneDeep(deepObject); - actual = fp.setWith(Object, 'd.e', 4, value); - - assert.deepEqual(value, deepObject, 'fp.setWith'); - assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } }, 'fp.setWith'); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('with methods'); - - (function() { - var array = [1, 2, 3], - object = { 'a': 1 }; - - QUnit.test('should provide the correct `customizer` arguments', function(assert) { - assert.expect(4); - - var args, - value = _.clone(object); - - var actual = fp.assignWith(function() { - args || (args = _.map(arguments, _.cloneDeep)); - }, { 'b': 2 }, value); - - assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.assignWith'); - - args = undefined; - value = _.clone(object); - actual = fp.extendWith(function() { - args || (args = _.map(arguments, _.cloneDeep)); - }, { 'b': 2 }, value); - - assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.extendWith'); - - var stack = { '__data__': { 'array': [], 'map': null } }, - expected = [[1], [2, 3], 'a', { 'a': [ 1 ] }, { 'a': [2, 3] }, stack]; - - args = undefined; - value = { 'a': [1] }; - actual = fp.mergeWith(function() { - args || (args = _.map(arguments, _.cloneDeep)); - }, { 'a': [2, 3] }, value); - - args[5] = _.omitBy(args[5], _.isFunction); - assert.deepEqual(args, expected, 'fp.mergeWith'); - - args = undefined; - value = _.clone(object); - actual = fp.setWith(function() { - args || (args = _.map(arguments, _.cloneDeep)); - }, 'b.c', 2, value); - - assert.deepEqual(args, [undefined, 'b', { 'a': 1 }], 'fp.setWith'); - }); - }()); - - /*--------------------------------------------------------------------------*/ - QUnit.config.asyncRetries = 10; QUnit.config.hidepassed = true; diff --git a/test/test.js b/test/test.js index 605125d929..78dcdaa228 100644 --- a/test/test.js +++ b/test/test.js @@ -543,11 +543,11 @@ ' };', '', " ['" + typedArrays.join("', '") + "'].forEach(function(type) {", - " var Ctor = root[type]", + ' var Ctor = root[type]', ' if (Ctor) {', - " object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));", + ' object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));', ' }', - " });", + ' });', '', ' return object;', '}())' @@ -593,7 +593,7 @@ "_.each(['" + typedArrays.join("', '") + "'], function(type) {", ' var Ctor = root[type];', ' if (Ctor) {', - " object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));", + ' object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));', ' }', '});', '', @@ -2367,7 +2367,7 @@ 'undefined values': undefined }; - objects['arrays'].length = 3; + objects.arrays.length = 3; var uncloneable = { 'DOM elements': body, @@ -2520,13 +2520,22 @@ assert.strictEqual(actual.lastIndex, 3); }); + QUnit.test('`_.' + methodName + '` should clone prototype objects', function(assert) { + assert.expect(2); + + var actual = func(Foo.prototype); + + assert.notOk(actual instanceof Foo); + assert.deepEqual(actual, { 'b': 1 }); + }); + QUnit.test('`_.' + methodName + '` should create clone with the same `[[Prototype]]` as `value`', function(assert) { assert.expect(1); assert.ok(func(new Foo) instanceof Foo); }); - QUnit.test('should ensure `value` constructor is a function before using its `[[Prototype]]`', function(assert) { + QUnit.test('`_.' + methodName + '` should ensure `value` constructor is a function before using its `[[Prototype]]`', function(assert) { assert.expect(1); Foo.prototype.constructor = null; @@ -2642,7 +2651,9 @@ var props = []; var objects = lodashStable.transform(_, function(result, value, key) { - if (lodashStable.startsWith(key, '_') && lodashStable.isObject(value) && !lodashStable.isArguments(value) && !lodashStable.isElement(value) && !lodashStable.isFunction(value)) { + if (lodashStable.startsWith(key, '_') && lodashStable.isObject(value) && + !lodashStable.isArguments(value) && !lodashStable.isElement(value) && + !lodashStable.isFunction(value)) { props.push(lodashStable.capitalize(lodashStable.camelCase(key))); result.push(value); } @@ -2664,7 +2675,7 @@ assert.expect(2); if (!isNpm) { - var object = objects['objects'], + var object = objects.objects, actual = _(object)[methodName](); assert.deepEqual(actual, object); @@ -3197,15 +3208,12 @@ QUnit.module('lodash.countBy'); (function() { - var array = [4.2, 6.1, 6.4]; + var array = [6.1, 4.2, 6.3]; - QUnit.test('should work with an iteratee', function(assert) { + QUnit.test('should transform keys by `iteratee`', function(assert) { assert.expect(1); - var actual = _.countBy(array, function(num) { - return Math.floor(num); - }, Math); - + var actual = _.countBy(array, Math.floor); assert.deepEqual(actual, { '4': 1, '6': 2 }); }); @@ -3233,7 +3241,7 @@ QUnit.test('should only add values to own, not inherited, properties', function(assert) { assert.expect(2); - var actual = _.countBy([4.2, 6.1, 6.4], function(num) { + var actual = _.countBy(array, function(num) { return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; }); @@ -3257,7 +3265,7 @@ QUnit.test('should work with an object for `collection`', function(assert) { assert.expect(1); - var actual = _.countBy({ 'a': 4.2, 'b': 6.1, 'c': 6.4 }, function(num) { + var actual = _.countBy({ 'a': 6.1, 'b': 4.2, 'c': 6.3 }, function(num) { return Math.floor(num); }); @@ -6466,12 +6474,19 @@ QUnit.module('lodash.groupBy'); (function() { - var array = [4.2, 6.1, 6.4]; + var array = [6.1, 4.2, 6.3]; + + QUnit.test('should transform keys by `iteratee`', function(assert) { + assert.expect(1); + + var actual = _.groupBy(array, Math.floor); + assert.deepEqual(actual, { '4': [4.2], '6': [6.1, 6.3] }); + }); QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) { assert.expect(1); - var array = [4, 6, 6], + var array = [6, 4, 6], values = [, null, undefined], expected = lodashStable.map(values, lodashStable.constant({ '4': [4], '6': [6, 6] })); @@ -6492,12 +6507,12 @@ QUnit.test('should only add values to own, not inherited, properties', function(assert) { assert.expect(2); - var actual = _.groupBy([4.2, 6.1, 6.4], function(num) { + var actual = _.groupBy(array, function(num) { return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; }); assert.deepEqual(actual.constructor, [4.2]); - assert.deepEqual(actual.hasOwnProperty, [6.1, 6.4]); + assert.deepEqual(actual.hasOwnProperty, [6.1, 6.3]); }); QUnit.test('should work with a number for `iteratee`', function(assert) { @@ -6516,11 +6531,8 @@ QUnit.test('should work with an object for `collection`', function(assert) { assert.expect(1); - var actual = _.groupBy({ 'a': 4.2, 'b': 6.1, 'c': 6.4 }, function(num) { - return Math.floor(num); - }); - - assert.deepEqual(actual, { '4': [4.2], '6': [6.1, 6.4] }); + var actual = _.groupBy({ 'a': 6.1, 'b': 4.2, 'c': 6.3 }, Math.floor); + assert.deepEqual(actual, { '4': [4.2], '6': [6.1, 6.3] }); }); QUnit.test('should work in a lazy sequence', function(assert) { @@ -7374,43 +7386,18 @@ assert.deepEqual(_.invert(actual), { 'a': '1', 'b': '2' }); }); - QUnit.test('should work with an object that has a `length` property', function(assert) { + QUnit.test('should work with values that shadow keys on `Object.prototype`', function(assert) { assert.expect(1); - var object = { '0': 'a', '1': 'b', 'length': 2 }; - assert.deepEqual(_.invert(object), { 'a': '0', 'b': '1', '2': 'length' }); - }); - - QUnit.test('should accept a `multiValue` flag', function(assert) { - assert.expect(1); - - var object = { 'a': 1, 'b': 2, 'c': 1 }; - assert.deepEqual(_.invert(object, true), { '1': ['a', 'c'], '2': ['b'] }); - }); - - QUnit.test('should only add multiple values to own, not inherited, properties', function(assert) { - assert.expect(2); - var object = { 'a': 'hasOwnProperty', 'b': 'constructor' }; - assert.deepEqual(_.invert(object), { 'hasOwnProperty': 'a', 'constructor': 'b' }); - assert.ok(lodashStable.isEqual(_.invert(object, true), { 'hasOwnProperty': ['a'], 'constructor': ['b'] })); }); - QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) { - assert.expect(2); - - var regular = { 'a': 1, 'b': 2, 'c': 1 }, - inverted = { '1': 'c', '2': 'b' }; - - var array = [regular, regular, regular], - object = { 'a': regular, 'b': regular, 'c': regular }, - expected = lodashStable.map(array, lodashStable.constant(inverted)); + QUnit.test('should work with an object that has a `length` property', function(assert) { + assert.expect(1); - lodashStable.each([array, object], function(collection) { - var actual = lodashStable.map(collection, _.invert); - assert.deepEqual(actual, expected); - }); + var object = { '0': 'a', '1': 'b', 'length': 2 }; + assert.deepEqual(_.invert(object), { 'a': '0', 'b': '1', '2': 'length' }); }); QUnit.test('should return a wrapped value when chaining', function(assert) { @@ -7431,6 +7418,61 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.invertBy'); + + (function() { + var object = { 'a': 1, 'b': 2, 'c': 1 }; + + QUnit.test('should transform keys by `iteratee`', function(assert) { + assert.expect(1); + + var expected = { 'group1': ['a', 'c'], 'group2': ['b'] }; + + var actual = _.invertBy(object, function(value) { + return 'group' + value; + }); + + assert.deepEqual(actual, expected); + }); + + QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) { + assert.expect(1); + + var values = [, null, undefined], + expected = lodashStable.map(values, lodashStable.constant({ '1': ['a', 'c'], '2': ['b'] })); + + var actual = lodashStable.map(values, function(value, index) { + return index ? _.invertBy(object, value) : _.invertBy(object); + }); + + assert.deepEqual(actual, expected); + }); + + QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) { + assert.expect(1); + + var values = [, null, undefined], + expected = lodashStable.map(values, lodashStable.constant({ '1': ['a', 'c'], '2': ['b'] })); + + var actual = lodashStable.map(values, function(value, index) { + return index ? _.invertBy(object, value) : _.invertBy(object); + }); + + assert.deepEqual(actual, expected); + }); + + QUnit.test('should only add multiple values to own, not inherited, properties', function(assert) { + assert.expect(1); + + var expected = { 'hasOwnProperty': ['a'], 'constructor': ['b'] }, + object = { 'a': 'hasOwnProperty', 'b': 'constructor' }; + + assert.ok(lodashStable.isEqual(_.invertBy(object), expected)); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.invoke'); (function() { @@ -9420,7 +9462,7 @@ assert.deepEqual(actual, expected); - objects = [{ 'a': { 'b': 1 } }, { 'a':{ 'b': 1, 'c': 1 } }, { 'a': { 'b': 1, 'c': undefined } }]; + objects = [{ 'a': { 'b': 1 } }, { 'a': { 'b': 1, 'c': 1 } }, { 'a': { 'b': 1, 'c': undefined } }]; source = { 'a': { 'c': undefined } }; actual = lodashStable.map(objects, predicate); @@ -11252,6 +11294,23 @@ QUnit.module('lodash.keyBy'); (function() { + var array = [ + { 'dir': 'left', 'code': 97 }, + { 'dir': 'right', 'code': 100 } + ]; + + QUnit.test('should transform keys by `iteratee`', function(assert) { + assert.expect(1); + + var expected = { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }; + + var actual = _.keyBy(array, function(object) { + return String.fromCharCode(object.code); + }); + + assert.deepEqual(actual, expected); + }); + QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) { assert.expect(1); @@ -11269,19 +11328,21 @@ QUnit.test('should work with a "_.property" style `iteratee`', function(assert) { assert.expect(1); - var actual = _.keyBy(['one', 'two', 'three'], 'length'); - assert.deepEqual(actual, { '3': 'two', '5': 'three' }); + var expected = { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }, + actual = _.keyBy(array, 'dir'); + + assert.deepEqual(actual, expected); }); QUnit.test('should only add values to own, not inherited, properties', function(assert) { assert.expect(2); - var actual = _.keyBy([4.2, 6.1, 6.4], function(num) { + var actual = _.keyBy([6.1, 4.2, 6.3], function(num) { return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; }); assert.deepEqual(actual.constructor, 4.2); - assert.deepEqual(actual.hasOwnProperty, 6.4); + assert.deepEqual(actual.hasOwnProperty, 6.3); }); QUnit.test('should work with a number for `iteratee`', function(assert) { @@ -11300,11 +11361,8 @@ QUnit.test('should work with an object for `collection`', function(assert) { assert.expect(1); - var actual = _.keyBy({ 'a': 4.2, 'b': 6.1, 'c': 6.4 }, function(num) { - return Math.floor(num); - }); - - assert.deepEqual(actual, { '4': 4.2, '6': 6.4 }); + var actual = _.keyBy({ 'a': 6.1, 'b': 4.2, 'c': 6.3 }, Math.floor); + assert.deepEqual(actual, { '4': 4.2, '6': 6.3 }); }); QUnit.test('should work in a lazy sequence', function(assert) { @@ -11571,7 +11629,7 @@ }); }()); -/*--------------------------------------------------------------------------*/ + /*--------------------------------------------------------------------------*/ QUnit.module('lodash.lowerCase'); @@ -11585,7 +11643,7 @@ }); }()); -/*--------------------------------------------------------------------------*/ + /*--------------------------------------------------------------------------*/ QUnit.module('lodash.lowerFirst'); @@ -12831,6 +12889,15 @@ var array = [4, 2, 8, 6]; assert.strictEqual(_.mean(array), 5); }); + + QUnit.test('should return `NaN` when passing empty `array` values', function(assert) { + assert.expect(1); + + var expected = lodashStable.map(empties, alwaysNaN), + actual = lodashStable.map(empties, _.mean); + + assert.deepEqual(actual, expected); + }); }()); /*--------------------------------------------------------------------------*/ @@ -13481,6 +13548,16 @@ assert.deepEqual(actual, { 'a': { 'b': [0, 1, 2] } }); }); + + QUnit.test('should overwrite primitives with source object clones', function(assert) { + assert.expect(1); + + var actual = _.mergeWith({ 'a': 0 }, { 'a': { 'b': ['c'] } }, function(a, b) { + return lodashStable.isArray(a) ? a.concat(b) : undefined; + }); + + assert.deepEqual(actual, { 'a': { 'b': ['c'] } }); + }); }()); /*--------------------------------------------------------------------------*/ @@ -15418,7 +15495,7 @@ (function() { var array = [1, 0, 1]; - QUnit.test('should return two groups of elements', function(assert) { + QUnit.test('should split elements into two groups by `predicate`', function(assert) { assert.expect(3); assert.deepEqual(_.partition([], identity), [[], []]); @@ -15464,10 +15541,7 @@ QUnit.test('should work with an object for `collection`', function(assert) { assert.expect(1); - var actual = _.partition({ 'a': 1.1, 'b': 0.2, 'c': 1.3 }, function(num) { - return Math.floor(num); - }); - + var actual = _.partition({ 'a': 1.1, 'b': 0.2, 'c': 1.3 }, Math.floor); assert.deepEqual(actual, [[1.1, 1.3], [0.2]]); }); }()); @@ -18093,7 +18167,7 @@ { 'a': 'y', 'b': 2 } ]; - QUnit.test('should sort in ascending order', function(assert) { + QUnit.test('should sort in ascending order by `iteratee`', function(assert) { assert.expect(1); var actual = lodashStable.map(_.sortBy(objects, function(object) { @@ -18127,10 +18201,7 @@ QUnit.test('should work with an object for `collection`', function(assert) { assert.expect(1); - var actual = _.sortBy({ 'a': 1, 'b': 2, 'c': 3 }, function(num) { - return Math.sin(num); - }); - + var actual = _.sortBy({ 'a': 1, 'b': 2, 'c': 3 }, Math.sin); assert.deepEqual(actual, [3, 1, 2]); }); @@ -18662,10 +18733,10 @@ assert.strictEqual(_.sum(array), 12); }); - QUnit.test('should return `undefined` when passing empty `array` values', function(assert) { + QUnit.test('should return `0` when passing empty `array` values', function(assert) { assert.expect(1); - var expected = lodashStable.map(empties, alwaysUndefined), + var expected = lodashStable.map(empties, alwaysZero), actual = lodashStable.map(empties, _.sum); assert.deepEqual(actual, expected); @@ -20031,7 +20102,7 @@ }); lodashStable.times(2, function(index) { - QUnit.test('should trigger a call when invoked repeatedly' + (index ? ' and `leading` is `false`' : ''), function(assert) { + QUnit.test('should trigger a call when invoked repeatedly' + (index ? ' and `leading` is `false`' : ''), function(assert) { assert.expect(1); var done = assert.async(); @@ -21687,7 +21758,7 @@ lodashStable.each(['uniq', 'uniqBy', 'uniqWith', 'sortedUniq', 'sortedUniqBy'], function(methodName) { var func = _[methodName], - isSorted = /^sorted/.test(methodName); + isSorted = /^sorted/.test(methodName), objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }, { 'a': 2 }, { 'a': 3 }, { 'a': 1 }]; if (isSorted) { @@ -22391,55 +22462,57 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('lodash.zipObject'); + QUnit.module('zipObject methods'); - (function() { - var object = { 'barney': 36, 'fred': 40 }, - array = [['barney', 36], ['fred', 40]]; + lodashStable.each(['zipObject', 'zipObjectDeep'], function(methodName) { + var func = _[methodName], + array = [['barney', 36], ['fred', 40]], + object = { 'barney': 36, 'fred': 40 }, + isDeep = methodName == 'zipObjectDeep'; - QUnit.test('should zip together key/value arrays into an object', function(assert) { + QUnit.test('`_.' + methodName + '` should zip together key/value arrays into an object', function(assert) { assert.expect(1); - var actual = _.zipObject(['barney', 'fred'], [36, 40]); + var actual = func(['barney', 'fred'], [36, 40]); assert.deepEqual(actual, object); }); - QUnit.test('should ignore extra `values`', function(assert) { + QUnit.test('`_.' + methodName + '` should ignore extra `values`', function(assert) { assert.expect(1); - assert.deepEqual(_.zipObject(['a'], [1, 2]), { 'a': 1 }); + assert.deepEqual(func(['a'], [1, 2]), { 'a': 1 }); }); - QUnit.test('should assign `undefined` values for extra `keys`', function(assert) { + QUnit.test('`_.' + methodName + '` should assign `undefined` values for extra `keys`', function(assert) { assert.expect(1); - assert.deepEqual(_.zipObject(['a', 'b'], [1]), { 'a': 1, 'b': undefined }); + assert.deepEqual(func(['a', 'b'], [1]), { 'a': 1, 'b': undefined }); }); - QUnit.test('should support deep paths', function(assert) { + QUnit.test('`_.' + methodName + '` should ' + (isDeep ? '' : 'not ') + 'support deep paths', function(assert) { assert.expect(2); - lodashStable.each(['a.b.c', ['a', 'b', 'c']], function(path) { - var actual = _.zipObject([path], [1]); - assert.deepEqual(actual, { 'a': { 'b': { 'c': 1 } } }); + lodashStable.each(['a.b.c', ['a', 'b', 'c']], function(path, index) { + var expected = isDeep ? ({ 'a': { 'b': { 'c': 1 } } }) : (index ? { 'a,b,c': 1 } : { 'a.b.c': 1 }); + assert.deepEqual(func([path], [1]), expected); }); }); - QUnit.test('should work in a lazy sequence', function(assert) { + QUnit.test('`_.' + methodName + '` should work in a lazy sequence', function(assert) { assert.expect(1); if (!isNpm) { var values = lodashStable.range(LARGE_ARRAY_SIZE), props = lodashStable.map(values, function(value) { return 'key' + value; }), - actual = _(props).zipObject(values).map(square).filter(isEven).take().value(); + actual = _(props)[methodName](values).map(square).filter(isEven).take().value(); - assert.deepEqual(actual, _.take(_.filter(_.map(_.zipObject(props, values), square), isEven))); + assert.deepEqual(actual, _.take(_.filter(_.map(func(props, values), square), isEven))); } else { skipTest(assert); } }); - }()); + }); /*--------------------------------------------------------------------------*/ @@ -22800,8 +22873,8 @@ QUnit.module('lodash(...).push'); (function() { - QUnit.test('should append elements to `array`', function(assert) { - assert.expect(2); + QUnit.test('should append elements to `array`', function(assert) { + assert.expect(2); if (!isNpm) { var array = [1], @@ -23165,7 +23238,7 @@ QUnit.module('"Arrays" category methods'); - (function() { + (function() { var args = (function() { return arguments; }(1, null, [3], null, 5)), sortedArgs = (function() { return arguments; }(1, [3], 5, null, null)), array = [1, 2, 3, 4, 5, 6]; @@ -23187,7 +23260,7 @@ assert.deepEqual(_.drop(args, 3), [null, 5], message('drop')); assert.deepEqual(_.dropRight(args, 3), [1, null], message('dropRight')); assert.deepEqual(_.dropRightWhile(args,identity), [1, null, [3], null], message('dropRightWhile')); - assert.deepEqual(_.dropWhile(args,identity), [ null, [3], null, 5], message('dropWhile')); + assert.deepEqual(_.dropWhile(args,identity), [null, [3], null, 5], message('dropWhile')); assert.deepEqual(_.findIndex(args, identity), 0, message('findIndex')); assert.deepEqual(_.findLastIndex(args, identity), 4, message('findLastIndex')); assert.deepEqual(_.flatten(args), [1, null, 3, null, 5], message('flatten')); @@ -23241,7 +23314,7 @@ QUnit.module('"Strings" category methods'); - (function() { + (function() { var stringMethods = [ 'camelCase', 'capitalize', @@ -23376,7 +23449,7 @@ var acceptFalsey = lodashStable.difference(allMethods, rejectFalsey); QUnit.test('should accept falsey arguments', function(assert) { - assert.expect(287); + assert.expect(289); var emptyArrays = lodashStable.map(falsey, alwaysEmptyArray); @@ -23424,8 +23497,8 @@ switch (methodName) { case 'invokeMap': - actual = func(array, 'toFixed'); - break; + actual = func(array, 'toFixed'); + break; case 'sample': actual = func(array, 1); break; diff --git a/vendor/backbone/backbone.js b/vendor/backbone/backbone.js index caf45ca1c2..62221ba0d9 100644 --- a/vendor/backbone/backbone.js +++ b/vendor/backbone/backbone.js @@ -9,8 +9,8 @@ // Establish the root object, `window` (`self`) in the browser, or `global` on the server. // We use `self` instead of `window` for `WebWorker` support. - var root = (typeof self == 'object' && self.self == self && self) || - (typeof global == 'object' && global.global == global && global); + var root = (typeof self == 'object' && self.self === self && self) || + (typeof global == 'object' && global.global === global && global); // Set up Backbone appropriately for the environment. Start with AMD. if (typeof define === 'function' && define.amd) { @@ -769,7 +769,8 @@ at = Math.min(Math.max(at, 0), array.length); var tail = Array(array.length - at); var length = insert.length; - for (var i = 0; i < tail.length; i++) tail[i] = array[i + at]; + var i; + for (i = 0; i < tail.length; i++) tail[i] = array[i + at]; for (i = 0; i < length; i++) array[i + at] = insert[i]; for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i]; }; @@ -821,10 +822,12 @@ if (models == null) return; options = _.defaults({}, options, setOptions); - if (options.parse && !this._isModel(models)) models = this.parse(models, options); + if (options.parse && !this._isModel(models)) { + models = this.parse(models, options) || []; + } var singular = !_.isArray(models); - models = singular ? (models ? [models] : []) : models.slice(); + models = singular ? [models] : models.slice(); var at = options.at; if (at != null) at = +at; @@ -845,8 +848,8 @@ // Turn bare objects into model references, and prevent invalid models // from being added. - var model; - for (var i = 0; i < models.length; i++) { + var model, i; + for (i = 0; i < models.length; i++) { model = models[i]; // If a duplicate is found, prevent it from being added and @@ -890,7 +893,7 @@ var orderChanged = false; var replace = !sortable && add && remove; if (set.length && replace) { - orderChanged = this.length != set.length || _.some(this.models, function(model, index) { + orderChanged = this.length !== set.length || _.some(this.models, function(model, index) { return model !== set[index]; }); this.models.length = 0; diff --git a/vendor/backbone/test/collection.js b/vendor/backbone/test/collection.js index e9e60cc5f7..eba6526ebc 100644 --- a/vendor/backbone/test/collection.js +++ b/vendor/backbone/test/collection.js @@ -429,7 +429,7 @@ }); var colE = new Backbone.Collection([e]); var colF = new Backbone.Collection([f]); - assert.ok(e != f); + assert.notEqual(e, f); assert.ok(colE.length === 1); assert.ok(colF.length === 1); colE.remove(e); @@ -857,7 +857,7 @@ assert.expect(2); var Model = Backbone.Model.extend({ validate: function(attrs) { - if (attrs.id == 3) return "id can't be 3"; + if (attrs.id === 3) return "id can't be 3"; } }); @@ -1324,7 +1324,7 @@ var col = new Backbone.Collection; var model1 = col.push({id: 101}); var model2 = col.push({id: 101}); - assert.ok(model2.cid == model1.cid); + assert.ok(model2.cid === model1.cid); }); QUnit.test('`set` with non-normal id', function(assert) { diff --git a/vendor/backbone/test/events.js b/vendor/backbone/test/events.js index ffcdde6de3..b9b5053feb 100644 --- a/vendor/backbone/test/events.js +++ b/vendor/backbone/test/events.js @@ -352,8 +352,8 @@ _.extend(obj, Backbone.Events); obj.on('all', function(event) { obj.counter++; - if (event == 'a') a = true; - if (event == 'b') b = true; + if (event === 'a') a = true; + if (event === 'b') b = true; }) .trigger('a b'); assert.ok(a); @@ -477,7 +477,7 @@ QUnit.test('if callback is truthy but not a function, `on` should throw an error just like jQuery', function(assert) { assert.expect(1); var view = _.extend({}, Backbone.Events).on('test', 'noop'); - assert.throws(function() { + assert.raises(function() { view.trigger('test'); }); }); diff --git a/vendor/backbone/test/model.js b/vendor/backbone/test/model.js index b843affb86..773a5524af 100644 --- a/vendor/backbone/test/model.js +++ b/vendor/backbone/test/model.js @@ -89,7 +89,7 @@ doc.collection.url = '/collection/'; assert.equal(doc.url(), '/collection/1-the-tempest'); doc.collection = null; - assert.throws(function() { doc.url(); }); + assert.raises(function() { doc.url(); }); doc.collection = collection; }); @@ -251,12 +251,12 @@ var changeCount = 0; a.on('change:foo', function() { changeCount += 1; }); a.set({foo: 2}); - assert.ok(a.get('foo') == 2, 'Foo should have changed.'); - assert.ok(changeCount == 1, 'Change count should have incremented.'); + assert.equal(a.get('foo'), 2, 'Foo should have changed.'); + assert.equal(changeCount, 1, 'Change count should have incremented.'); // set with value that is not new shouldn't fire change event a.set({foo: 2}); - assert.ok(a.get('foo') == 2, 'Foo should NOT have changed, still 2'); - assert.ok(changeCount == 1, 'Change count should NOT have incremented.'); + assert.equal(a.get('foo'), 2, 'Foo should NOT have changed, still 2'); + assert.equal(changeCount, 1, 'Change count should NOT have incremented.'); a.validate = function(attrs) { assert.equal(attrs.foo, void 0, 'validate:true passed while unsetting'); @@ -264,7 +264,7 @@ a.unset('foo', {validate: true}); assert.equal(a.get('foo'), void 0, 'Foo should have changed'); delete a.validate; - assert.ok(changeCount == 2, 'Change count should have incremented for unset.'); + assert.equal(changeCount, 2, 'Change count should have incremented for unset.'); a.unset('id'); assert.equal(a.id, undefined, 'Unsetting the id should remove the id property.'); @@ -746,7 +746,7 @@ var lastError; var model = new Backbone.Model(); model.validate = function(attrs) { - if (attrs.admin != this.get('admin')) return "Can't change admin status."; + if (attrs.admin !== this.get('admin')) return "Can't change admin status."; }; model.on('invalid', function(model, error) { lastError = error; diff --git a/vendor/backbone/test/router.js b/vendor/backbone/test/router.js index 31769b19f8..38f215dde5 100644 --- a/vendor/backbone/test/router.js +++ b/vendor/backbone/test/router.js @@ -134,7 +134,7 @@ }, optionalItem: function(arg){ - this.arg = arg != void 0 ? arg : null; + this.arg = arg !== void 0 ? arg : null; }, splat: function(args) { diff --git a/vendor/backbone/test/sync.js b/vendor/backbone/test/sync.js index 7ae82a04a3..b176bec72e 100644 --- a/vendor/backbone/test/sync.js +++ b/vendor/backbone/test/sync.js @@ -142,7 +142,7 @@ QUnit.test('urlError', function(assert) { assert.expect(2); var model = new Backbone.Model(); - assert.throws(function() { + assert.raises(function() { model.fetch(); }); model.fetch({url: '/one/two'}); diff --git a/vendor/benchmark.js/LICENSE b/vendor/benchmark.js/LICENSE index feed4c8dec..65d92b588d 100644 --- a/vendor/benchmark.js/LICENSE +++ b/vendor/benchmark.js/LICENSE @@ -1,4 +1,4 @@ -Copyright 2010-2015 Mathias Bynens +Copyright 2010-2016 Mathias Bynens Based on JSLitmus.js, copyright Robert Kieffer Modified by John-David Dalton diff --git a/vendor/benchmark.js/benchmark.js b/vendor/benchmark.js/benchmark.js index 9d71f6b2a4..d521b33b86 100644 --- a/vendor/benchmark.js/benchmark.js +++ b/vendor/benchmark.js/benchmark.js @@ -1,9 +1,9 @@ /*! - * Benchmark.js v2.0.0-pre - * Copyright 2010-2015 Mathias Bynens + * Benchmark.js v2.1.0 + * Copyright 2010-2016 Mathias Bynens * Based on JSLitmus.js, copyright Robert Kieffer * Modified by John-David Dalton - * Available under MIT license + * Available under MIT license */ ;(function() { 'use strict'; @@ -124,7 +124,7 @@ */ function runInContext(context) { // Exit early if unable to acquire lodash. - var _ = context && context._ || req('lodash-compat') || req('lodash') || root._; + var _ = context && context._ || req('lodash') || root._; if (!_) { Benchmark.runInContext = runInContext; return Benchmark; @@ -277,8 +277,7 @@ * methods are: * [`each/forEach`](https://lodash.com/docs#forEach), [`forOwn`](https://lodash.com/docs#forOwn), * [`has`](https://lodash.com/docs#has), [`indexOf`](https://lodash.com/docs#indexOf), - * [`map`](https://lodash.com/docs#map), [`pluck`](https://lodash.com/docs#pluck), - * and [`reduce`](https://lodash.com/docs#reduce) + * [`map`](https://lodash.com/docs#map), and [`reduce`](https://lodash.com/docs#reduce) * * @constructor * @param {string} name A name to identify the benchmark. @@ -355,7 +354,7 @@ var bench = this; // Allow instance creation without the `new` operator. - if (bench == null || bench.constructor != Benchmark) { + if (!(bench instanceof Benchmark)) { return new Benchmark(name, fn, options); } // Juggle arguments. @@ -396,7 +395,7 @@ */ function Deferred(clone) { var deferred = this; - if (deferred == null || deferred.constructor != Deferred) { + if (!(deferred instanceof Deferred)) { return new Deferred(clone); } deferred.benchmark = clone; @@ -415,9 +414,9 @@ if (type instanceof Event) { return type; } - return (event == null || event.constructor != Event) - ? new Event(type) - : _.assign(event, { 'timeStamp': _.now() }, typeof type == 'string' ? { 'type': type } : type); + return (event instanceof Event) + ? _.assign(event, { 'timeStamp': _.now() }, typeof type == 'string' ? { 'type': type } : type) + : new Event(type); } /** @@ -426,8 +425,7 @@ * Note: Each Suite instance has a handful of wrapped lodash methods to * make working with Suites easier. The wrapped lodash methods are: * [`each/forEach`](https://lodash.com/docs#forEach), [`indexOf`](https://lodash.com/docs#indexOf), - * [`map`](https://lodash.com/docs#map), [`pluck`](https://lodash.com/docs#pluck), - * and [`reduce`](https://lodash.com/docs#reduce) + * [`map`](https://lodash.com/docs#map), and [`reduce`](https://lodash.com/docs#reduce) * * @constructor * @memberOf Benchmark @@ -467,7 +465,7 @@ var suite = this; // Allow instance creation without the `new` operator. - if (suite == null || suite.constructor != Suite) { + if (!(suite instanceof Suite)) { return new Suite(name, options); } // Juggle arguments. @@ -491,7 +489,7 @@ * @param {*} value The value to clone. * @returns {*} The cloned value. */ - var cloneDeep = _.partial(_.cloneDeepWith || _.cloneDeep, _, function(value) { + var cloneDeep = _.partial(_.cloneDeepWith, _, function(value) { // Only clone primitives, arrays, and plain objects. return (_.isObject(value) && !_.isArray(value) && !_.isPlainObject(value)) ? value @@ -763,7 +761,7 @@ if (callback === 'successful') { // Callback to exclude those that are errored, unrun, or have hz of Infinity. callback = function(bench) { - return bench.cycles && _.isFinite(bench.hz); + return bench.cycles && _.isFinite(bench.hz) && !bench.error; }; } else if (callback === 'fastest' || callback === 'slowest') { @@ -914,7 +912,7 @@ function isAsync(object) { // Avoid using `instanceof` here because of IE memory leak issues with host objects. var async = args[0] && args[0].async; - return Object(object).constructor == Benchmark && name == 'run' && + return name == 'run' && (object instanceof Benchmark) && ((async == null ? object.options.async : async) && support.timeout || object.defer); } @@ -933,7 +931,6 @@ ? index : (index = false); } - // Juggle arguments. if (_.isString(name)) { // 2 arguments (array, name). @@ -945,7 +942,6 @@ args = _.isArray(args = 'args' in options ? options.args : []) ? args : [args]; queued = options.queued; } - // Start iterating over the array. if (raiseIndex() !== false) { // Emit "start" event. @@ -955,7 +951,7 @@ options.onStart.call(benches, Event(eventProps)); // End early if the suite was aborted in an "onStart" listener. - if (benches.aborted && benches.constructor == Suite && name == 'run') { + if (name == 'run' && (benches instanceof Suite) && benches.aborted) { // Emit "cycle" event. eventProps.type = 'cycle'; options.onCycle.call(benches, Event(eventProps)); @@ -1794,7 +1790,7 @@ timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' }); } // Pick timer with highest resolution. - timer = (_.minBy || _.min)(timers, 'res'); + timer = _.minBy(timers, 'res'); // Error if there are no working timers. if (timer.res == Infinity) { @@ -1977,7 +1973,6 @@ deferred = clone; clone = clone.benchmark; } - var clocked, cycles, divisor, @@ -2008,7 +2003,6 @@ } } } - // Continue, if not errored. if (clone.running) { // Compute the time taken to complete last test cycle. @@ -2257,7 +2251,7 @@ /** * Platform object with properties describing things like browser name, - * version, and operating system. See [`platform.js`](http://mths.be/platform). + * version, and operating system. See [`platform.js`](https://mths.be/platform). * * @static * @memberOf Benchmark @@ -2284,7 +2278,7 @@ * @memberOf Benchmark * @type string */ - 'version': '2.0.0-pre' + 'version': '2.1.0' }); _.assign(Benchmark, { @@ -2297,7 +2291,7 @@ }); // Add lodash methods to Benchmark. - _.each(['each', 'forEach', 'forOwn', 'has', 'indexOf', 'map', 'pluck', 'reduce'], function(methodName) { + _.each(['each', 'forEach', 'forOwn', 'has', 'indexOf', 'map', 'reduce'], function(methodName) { Benchmark[methodName] = _[methodName]; }); @@ -2745,7 +2739,7 @@ /*------------------------------------------------------------------------*/ // Add lodash methods as Suite methods. - _.each(['each', 'forEach', 'indexOf', 'map', 'pluck', 'reduce'], function(methodName) { + _.each(['each', 'forEach', 'indexOf', 'map', 'reduce'], function(methodName) { var func = _[methodName]; Suite.prototype[methodName] = function() { var args = [this]; @@ -2799,17 +2793,15 @@ // Check for `exports` after `define` in case a build optimizer adds an `exports` object. if (freeExports && freeModule) { - // Export for Node.js or RingoJS. + // Export for Node.js. if (moduleExports) { (freeModule.exports = Benchmark).Benchmark = Benchmark; } - // Export for Rhino with CommonJS support. - else { - freeExports.Benchmark = Benchmark; - } + // Export for CommonJS support. + freeExports.Benchmark = Benchmark; } else { - // Export for a browser or Rhino. + // Export to the global object. root.Benchmark = Benchmark; } } diff --git a/vendor/underscore/test/objects.js b/vendor/underscore/test/objects.js index 027e42b6cb..6ca0a106f8 100644 --- a/vendor/underscore/test/objects.js +++ b/vendor/underscore/test/objects.js @@ -639,6 +639,17 @@ assert.strictEqual(_.isString(1), false); }); + QUnit.test('isSymbol', function(assert) { + assert.ok(!_.isSymbol(0), 'numbers are not symbols'); + assert.ok(!_.isSymbol(''), 'strings are not symbols'); + assert.ok(!_.isSymbol(_.isSymbol), 'functions are not symbols'); + if (typeof Symbol === 'function') { + assert.ok(_.isSymbol(Symbol()), 'symbols are symbols'); + assert.ok(_.isSymbol(Symbol('description')), 'described symbols are symbols'); + assert.ok(_.isSymbol(Object(Symbol())), 'boxed symbols are symbols'); + } + }); + QUnit.test('isNumber', function(assert) { assert.ok(!_.isNumber('string'), 'a string is not a number'); assert.ok(!_.isNumber(arguments), 'the arguments object is not a number'); diff --git a/vendor/underscore/underscore.js b/vendor/underscore/underscore.js index 19b3f7c9c0..d8c741b221 100644 --- a/vendor/underscore/underscore.js +++ b/vendor/underscore/underscore.js @@ -1286,7 +1286,7 @@ }; // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. - _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error', 'Symbol'], function(name) { _['is' + name] = function(obj) { return toString.call(obj) === '[object ' + name + ']'; };