lodash-rails 4.13.1 → 4.14.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,26 +3,26 @@
3
3
  * lodash (Custom Build) /license | Underscore.js 1.8.3 underscorejs.org/LICENSE
4
4
  * Build: `lodash core -o ./dist/lodash.core.js`
5
5
  */
6
- ;(function(){function n(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function t(n){return mn(Object(n))}function r(n,t){return n.push.apply(n,t),n}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return x(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return cn[n]}function c(n){return n instanceof f?n:new f(n)}function f(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function a(n,t,r,e){
7
- var u;return(u=n===rn)||(u=hn[r],u=(n===u||n!==n&&u!==u)&&!vn.call(e,r)),u?t:n}function l(n){return L(n)?_n(n):{}}function p(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(rn,r)},t)}function s(n,t){var r=true;return xn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function h(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===rn?i===i:r(i,c)))var c=i,f=o}return f}function v(n,t){var r=[];return xn(n,function(n,e,u){t(n,e,u)&&r.push(n);
8
- }),r}function y(n,t,e,u,o){var i=-1,c=n.length;for(e||(e=z),o||(o=[]);++i<c;){var f=n[i];t>0&&e(f)?t>1?y(f,t-1,e,u,o):r(o,f):u||(o[o.length]=f)}return o}function b(n,r){return n&&En(n,r,t)}function g(n,t){return v(t,function(t){return K(n[t])})}function _(n,t){return n>t}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!L(n)&&!Q(t)?n!==n&&t!==t:d(n,t,j,r,e,u)}function d(n,t,r,e,u,o){var i=Tn(n),c=Tn(t),f="[object Array]",a="[object Array]";i||(f=bn.call(n),f="[object Arguments]"==f?"[object Object]":f),
9
- c||(a=bn.call(t),a="[object Arguments]"==a?"[object Object]":a);var l="[object Object]"==f&&true,c="[object Object]"==a&&true,a=f==a;o||(o=[]);var p=kn(o,function(t){return t[0]===n});return p&&p[1]?p[1]==t:(o.push([n,t]),a&&!l?(r=i?I(n,t,r,e,u,o):q(n,t,f),o.pop(),r):2&u||(i=l&&vn.call(n,"__wrapped__"),f=c&&vn.call(t,"__wrapped__"),!i&&!f)?a?(r=$(n,t,r,e,u,o),o.pop(),r):false:(i=i?n.value():n,t=f?t.value():t,r=r(i,t,e,u,o),o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?nn:(typeof n=="object"?E:w)(n);
10
- }function O(n,t){return t>n}function x(n,t){var r=-1,e=H(n)?Array(n.length):[];return xn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function E(n){var r=t(n);return function(t){var e=r.length;if(null==t)return!e;for(t=Object(t);e--;){var u=r[e];if(!(u in t&&j(n[u],t[u],rn,3)))return false}return true}}function A(n,t){return n=Object(n),M(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function w(n){return function(t){return null==t?rn:t[n]}}function k(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,
11
- 0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function N(n){return k(n,0,n.length)}function S(n,t){var r;return xn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function F(n,t){return M(t,function(n,t){return t.func.apply(t.thisArg,r([n],t.args))},n)}function T(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];vn.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==rn||i in f)||(f[i]=c)}return r}function B(n){return U(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:rn,o=n.length>3&&typeof o=="function"?(u--,
12
- o):rn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function R(n){return function(){var t=arguments,r=l(n.prototype),t=n.apply(r,t);return L(t)?t:r}}function D(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==pn&&this instanceof e?u:n;++c<f;)a[c]=r[c];for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=R(n);return e}function I(n,t,r,e,u,o){var i=n.length,c=t.length;
13
- if(i!=c&&!(2&u&&c>i))return false;for(var c=-1,f=true,a=1&u?[]:rn;++c<i;){var l=n[c],p=t[c];if(void 0!==rn){f=false;break}if(a){if(!S(t,function(n,t){return G(a,t)||l!==n&&!r(l,n,e,u,o)?void 0:a.push(t)})){f=false;break}}else if(l!==p&&!r(l,p,e,u,o)){f=false;break}}return f}function q(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]":return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+"";
14
- }return false}function $(n,r,e,u,o,i){var c=2&o,f=t(n),a=f.length,l=t(r).length;if(a!=l&&!c)return false;for(var p=a;p--;){var s=f[p];if(!(c?s in r:vn.call(r,s)))return false}for(l=true;++p<a;){var s=f[p],h=n[s],v=r[s];if(void 0!==rn||h!==v&&!e(h,v,u,o,i)){l=false;break}c||(c="constructor"==s)}return l&&!c&&(e=n.constructor,u=r.constructor,e!=u&&"constructor"in n&&"constructor"in r&&!(typeof e=="function"&&e instanceof e&&typeof u=="function"&&u instanceof u)&&(l=false)),l}function z(n){return Tn(n)||V(n)}function C(n){
15
- return n&&n.length?n[0]:rn}function G(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?On(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1}function J(n,t){return xn(n,m(t))}function M(n,t,r){return e(n,m(t),r,3>arguments.length,xn)}function P(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Bn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=rn),r}}function U(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");
16
- return t=On(t===rn?n.length-1:Bn(t),0),function(){for(var r=arguments,e=-1,u=On(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function V(n){return Q(n)&&H(n)&&vn.call(n,"callee")&&(!jn.call(n,"callee")||"[object Arguments]"==bn.call(n))}function H(n){var t;return(t=null!=n)&&(t=An(n),t=typeof t=="number"&&t>-1&&0==t%1&&9007199254740991>=t),t&&!K(n)}function K(n){return n=L(n)?bn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n;
17
- }function L(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function Q(n){return!!n&&typeof n=="object"}function W(n){return typeof n=="number"||Q(n)&&"[object Number]"==bn.call(n)}function X(n){return typeof n=="string"||!Tn(n)&&Q(n)&&"[object String]"==bn.call(n)}function Y(n){return typeof n=="string"?n:null==n?"":n+""}function Z(n){return n?u(n,t(n)):[]}function nn(n){return n}function tn(n,e,u){var o=t(e),i=g(e,o);null!=u||L(e)&&(i.length||!o.length)||(u=e,e=n,n=this,i=g(e,t(e)));var c=!(L(u)&&"chain"in u&&!u.chain),f=K(n);
18
- return xn(i,function(t){var u=e[t];n[t]=u,f&&(n.prototype[t]=function(){var t=this.__chain__;if(c||t){var e=n(this.__wrapped__);return(e.__actions__=N(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=t,e}return u.apply(n,r([this.value()],arguments))})}),n}var rn,en=1/0,un=/[&<>"'`]/g,on=RegExp(un.source),cn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},fn=typeof exports=="object"&&exports,an=fn&&typeof module=="object"&&module,ln=o(typeof self=="object"&&self),pn=o(typeof global=="object"&&global)||ln||o(typeof this=="object"&&this)||Function("return this")(),sn=Array.prototype,hn=Object.prototype,vn=hn.hasOwnProperty,yn=0,bn=hn.toString,gn=pn._,_n=Object.create,jn=hn.propertyIsEnumerable,dn=pn.isFinite,mn=Object.keys,On=Math.max;
19
- f.prototype=l(c.prototype),f.prototype.constructor=f;var xn=function(n,t){return function(r,e){if(null==r)return r;if(!H(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(b),En=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}(),An=w("length"),wn=String,kn=function(n){return function(r,e,u){var o=Object(r);if(e=m(e),!H(r))var i=t(r);return u=n(i||r,function(n,t){
20
- return i&&(t=n,n=o[t]),e(n,t,o)},u),u>-1?r[i?i[u]:u]:rn}}(function(n,t,r){var e=n?n.length:0;if(!e)return-1;r=null==r?0:Bn(r),0>r&&(r=On(e+r,0));n:{for(t=m(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),Nn=U(function(n,t,r){return D(n,t,r)}),Sn=U(function(n,t){return p(n,1,t)}),Fn=U(function(n,t,r){return p(n,Rn(t)||0,r)}),Tn=Array.isArray,Bn=Number,Rn=Number,Dn=B(function(n,r){T(r,t(r),n)}),In=B(function(t,r){T(r,n(r),t)}),qn=B(function(t,r,e,u){T(r,n(r),t,u)}),$n=U(function(n){
21
- return n.push(rn,a),qn.apply(rn,n)}),zn=U(function(n,t){return null==n?{}:A(n,x(y(t,1),wn))});c.assignIn=In,c.before=P,c.bind=Nn,c.chain=function(n){return n=c(n),n.__chain__=true,n},c.compact=function(n){return v(n,Boolean)},c.concat=function(){for(var n=arguments.length,t=Array(n?n-1:0),e=arguments[0],u=n;u--;)t[u-1]=arguments[u];return n?r(Tn(e)?N(e):[e],y(t,1)):[]},c.create=function(n,t){var r=l(n);return t?Dn(r,t):r},c.defaults=$n,c.defer=Sn,c.delay=Fn,c.filter=function(n,t){return v(n,m(t))},
22
- c.flatten=function(n){return n&&n.length?y(n,1):[]},c.flattenDeep=function(n){return n&&n.length?y(n,en):[]},c.iteratee=m,c.keys=t,c.map=function(n,t){return x(n,m(t))},c.matches=function(n){return E(Dn({},n))},c.mixin=tn,c.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},c.once=function(n){return P(2,n)},c.pick=zn,c.slice=function(n,t,r){var e=n?n.length:0;return r=r===rn?e:+r,e?k(n,null==t?0:+t,r):[]},c.sortBy=function(n,t){
23
- var r=0;return t=m(t),x(x(n,function(n,e,u){return{value:n,index:r++,criteria:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==rn,o=null===r,i=r===r,c=e!==rn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&e>r||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),w("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return H(n)?n.length?N(n):[]:Z(n)},c.values=Z,c.extend=In,
24
- tn(c,c),c.clone=function(n){return L(n)?Tn(n)?N(n):T(n,t(n)):n},c.escape=function(n){return(n=Y(n))&&on.test(n)?n.replace(un,i):n},c.every=function(n,t,r){return t=r?rn:t,s(n,m(t))},c.find=kn,c.forEach=J,c.has=function(n,t){return null!=n&&vn.call(n,t)},c.head=C,c.identity=nn,c.indexOf=G,c.isArguments=V,c.isArray=Tn,c.isBoolean=function(n){return true===n||false===n||Q(n)&&"[object Boolean]"==bn.call(n)},c.isDate=function(n){return Q(n)&&"[object Date]"==bn.call(n)},c.isEmpty=function(n){return H(n)&&(Tn(n)||X(n)||K(n.splice)||V(n))?!n.length:!t(n).length;
25
- },c.isEqual=function(n,t){return j(n,t)},c.isFinite=function(n){return typeof n=="number"&&dn(n)},c.isFunction=K,c.isNaN=function(n){return W(n)&&n!=+n},c.isNull=function(n){return null===n},c.isNumber=W,c.isObject=L,c.isRegExp=function(n){return L(n)&&"[object RegExp]"==bn.call(n)},c.isString=X,c.isUndefined=function(n){return n===rn},c.last=function(n){var t=n?n.length:0;return t?n[t-1]:rn},c.max=function(n){return n&&n.length?h(n,nn,_):rn},c.min=function(n){return n&&n.length?h(n,nn,O):rn},c.noConflict=function(){
26
- return pn._===this&&(pn._=gn),this},c.noop=function(){},c.reduce=M,c.result=function(n,t,r){return t=null==n?rn:n[t],t===rn&&(t=r),K(t)?t.call(n):t},c.size=function(n){return null==n?0:(n=H(n)?n:t(n),n.length)},c.some=function(n,t,r){return t=r?rn:t,S(n,m(t))},c.uniqueId=function(n){var t=++yn;return Y(n)+t},c.each=J,c.first=C,tn(c,function(){var n={};return b(c,function(t,r){vn.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION="4.13.1",xn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){
27
- var t=(/^(?:replace|split)$/.test(n)?String.prototype:sn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);c.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Tn(u)?u:[],n)}return this[r](function(r){return t.apply(Tn(r)?r:[],n)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=function(){return F(this.__wrapped__,this.__actions__)},(ln||{})._=c,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){
28
- return c}):an?((an.exports=c)._=c,fn._=c):pn._=c}).call(this);
6
+ ;(function(){function n(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return m(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r,e){return n===Z||J(n,an[r])&&!ln.call(e,r)?t:n;
7
+ }function f(n){return V(n)?vn(n):{}}function a(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(Z,r)},t)}function l(n,t){var r=true;return jn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function p(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===Z?i===i:r(i,c)))var c=i,f=o}return f}function s(n,t){var r=[];return jn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function h(n,r,e,u,o){var i=-1,c=n.length;for(e||(e=I),o||(o=[]);++i<c;){
8
+ var f=n[i];0<r&&e(f)?1<r?h(f,r-1,e,u,o):t(o,f):u||(o[o.length]=f)}return o}function v(n,t){return n&&dn(n,t,Dn)}function b(n,t){return s(t,function(t){return U(n[t])})}function y(n,t){return n>t}function g(n,t,r,e,u){return n===t||(null==n||null==t||!V(n)&&!H(t)?n!==n&&t!==t:_(n,t,g,r,e,u))}function _(n,t,r,e,u,o){var i=kn(n),c=kn(t),f="[object Array]",a="[object Array]";i||(f=sn.call(n),f="[object Arguments]"==f?"[object Object]":f),c||(a=sn.call(t),a="[object Arguments]"==a?"[object Object]":a);
9
+ var l="[object Object]"==f&&true,c="[object Object]"==a&&true,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=R(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 2&u||(i=l&&ln.call(n,"__wrapped__"),
10
+ f=c&&ln.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=D(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t,r=r(i,f,e,u,o),o.pop(),r)}function j(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?O:r)(n)}function d(n,t){return n<t}function m(n,t){var r=-1,e=P(n)?Array(n.length):[];return jn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function O(n){var t=Dn(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&g(n[u],r[u],Z,3)))return false}return true}}
11
+ function x(n,t){return n=Object(n),C(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function A(n){var t;return t=_n(t===Z?n.length-1:t,0),function(){for(var r=arguments,e=-1,u=_n(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(e=-1,u=Array(t+1);++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function E(n,t,r){var e=-1,u=n.length;for(0>t&&(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;)r[e]=n[e+t];return r}function w(n){return E(n,0,n.length)}function k(n,t){var r;return jn(n,function(n,e,u){
12
+ return r=t(n,e,u),!r}),!!r}function N(n,r){return C(r,function(n,r){return r.func.apply(r.thisArg,t([n],r.args))},n)}function S(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){var i=t[u],c=e?e(r[i],n[i],i,r,n):Z,f=r,a=i,i=c===Z?n[i]:c,c=f[a];ln.call(f,a)&&J(c,i)&&(i!==Z||a in f)||(f[a]=i)}return r}function T(n){return A(function(t,r){var e=-1,u=r.length,o=1<u?r[u-1]:Z,o=3<n.length&&typeof o=="function"?(u--,o):Z;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function F(n){return function(){
13
+ var t=arguments,r=f(n.prototype),t=n.apply(r,t);return V(t)?t:r}}function B(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==un&&this instanceof e?u:n;++c<f;)a[c]=r[c];for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=F(n);return e}function R(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(2&u&&c>i))return false;for(var c=-1,f=true,a=1&u?[]:Z;++c<i;){var l=n[c],p=t[c];if(void 0!==Z){
14
+ f=false;break}if(a){if(!k(t,function(n,t){if(!$(a,t)&&(l===n||r(l,n,e,u,o)))return a.push(t)})){f=false;break}}else if(l!==p&&!r(l,p,e,u,o)){f=false;break}}return f}function D(n,t,r,e,u,o){var i=2&u,c=Dn(n),f=c.length,a=Dn(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:ln.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==Z||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),
15
+ a}function I(n){return kn(n)||M(n)}function q(n){return n&&n.length?n[0]:Z}function $(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?_n(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1}function z(n,t){return jn(n,j(t))}function C(n,t,r){return e(n,j(t),r,3>arguments.length,jn)}function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Nn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){
16
+ return n===t||n!==n&&t!==t}function M(n){return H(n)&&P(n)&&ln.call(n,"callee")&&(!bn.call(n,"callee")||"[object Arguments]"==sn.call(n))}function P(n){var t;return(t=null!=n)&&(t=On(n),t=typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t),t&&!U(n)}function U(n){return n=V(n)?sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function V(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function H(n){return!!n&&typeof n=="object"}function K(n){return typeof n=="number"||H(n)&&"[object Number]"==sn.call(n);
17
+ }function L(n){return typeof n=="string"||!kn(n)&&H(n)&&"[object String]"==sn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return n?u(n,Dn(n)):[]}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=b(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=b(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);return jn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=w(this.__actions__)).push({
18
+ func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"'`]/g,rn=RegExp(tn.source),en=typeof self=="object"&&self&&self.Object===Object&&self,un=typeof global=="object"&&global&&global.Object===Object&&global||en||Function("return this")(),on=(en=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,cn=function(n){return function(t){return null==n?Z:n[t]}}({"&":"&amp;",
19
+ "<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"}),fn=Array.prototype,an=Object.prototype,ln=an.hasOwnProperty,pn=0,sn=an.toString,hn=un._,vn=Object.create,bn=an.propertyIsEnumerable,yn=un.isFinite,gn=Object.keys,_n=Math.max;i.prototype=f(o.prototype),i.prototype.constructor=i;var jn=function(n,t){return function(r,e){if(null==r)return r;if(!P(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(v),dn=function(n){return function(t,r,e){var u=-1,o=Object(t);
20
+ e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}(),mn=function(n,t){return function(r){return n(t(r))}}(gn,Object),On=r("length"),xn=String,An=function(n){return function(t,r,e){var u=Object(t);if(!P(t)){var o=j(r);t=Dn(t),r=function(n){return o(u[n],n,u)}}return r=n(t,r,e),-1<r?u[o?t[r]:r]:Z}}(function(n,t,r){var e=n?n.length:0;if(!e)return-1;r=null==r?0:Nn(r),0>r&&(r=_n(e+r,0));n:{for(t=j(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),gn=A(function(n,t,r){
21
+ return B(n,t,r)}),En=A(function(n,t){return a(n,1,t)}),wn=A(function(n,t,r){return a(n,Sn(t)||0,r)}),kn=Array.isArray,Nn=Number,Sn=Number,Tn=T(function(n,t){S(t,Dn(t),n)}),Fn=T(function(t,r){S(r,n(r),t)}),Bn=T(function(t,r,e,u){S(r,n(r),t,u)}),Rn=A(function(n){return n.push(Z,c),Bn.apply(Z,n)}),Dn=mn,mn=A(function(n,t){return null==n?{}:x(n,m(h(t,1),xn))});o.assignIn=Fn,o.before=G,o.bind=gn,o.chain=function(n){return n=o(n),n.__chain__=true,n},o.compact=function(n){return s(n,Boolean)},o.concat=function(){
22
+ for(var n=arguments.length,r=Array(n?n-1:0),e=arguments[0],u=n;u--;)r[u-1]=arguments[u];return n?t(kn(e)?w(e):[e],h(r,1)):[]},o.create=function(n,t){var r=f(n);return t?Tn(r,t):r},o.defaults=Rn,o.defer=En,o.delay=wn,o.filter=function(n,t){return s(n,j(t))},o.flatten=function(n){return n&&n.length?h(n,1):[]},o.flattenDeep=function(n){return n&&n.length?h(n,nn):[]},o.iteratee=j,o.keys=Dn,o.map=function(n,t){return m(n,j(t))},o.matches=function(n){return O(Tn({},n))},o.mixin=Y,o.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");
23
+ return function(){return!n.apply(this,arguments)}},o.once=function(n){return G(2,n)},o.pick=mn,o.slice=function(n,t,r){var e=n?n.length:0;return r=r===Z?e:+r,e?E(n,null==t?0:+t,r):[]},o.sortBy=function(n,t){var e=0;return t=j(t),m(m(n,function(n,r,u){return{value:n,index:e++,criteria:t(n,r,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==Z,o=null===r,i=r===r,c=e!==Z,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r<e||f&&u&&i||!c&&i||!a){r=-1;
24
+ break n}}r=0}return r||n.index-t.index}),r("value"))},o.tap=function(n,t){return t(n),n},o.thru=function(n,t){return t(n)},o.toArray=function(n){return P(n)?n.length?w(n):[]:W(n)},o.values=W,o.extend=Fn,Y(o,o),o.clone=function(n){return V(n)?kn(n)?w(n):S(n,Dn(n)):n},o.escape=function(n){return(n=Q(n))&&rn.test(n)?n.replace(tn,cn):n},o.every=function(n,t,r){return t=r?Z:t,l(n,j(t))},o.find=An,o.forEach=z,o.has=function(n,t){return null!=n&&ln.call(n,t)},o.head=q,o.identity=X,o.indexOf=$,o.isArguments=M,
25
+ o.isArray=kn,o.isBoolean=function(n){return true===n||false===n||H(n)&&"[object Boolean]"==sn.call(n)},o.isDate=function(n){return H(n)&&"[object Date]"==sn.call(n)},o.isEmpty=function(n){return P(n)&&(kn(n)||L(n)||U(n.splice)||M(n))?!n.length:!Dn(n).length},o.isEqual=function(n,t){return g(n,t)},o.isFinite=function(n){return typeof n=="number"&&yn(n)},o.isFunction=U,o.isNaN=function(n){return K(n)&&n!=+n},o.isNull=function(n){return null===n},o.isNumber=K,o.isObject=V,o.isRegExp=function(n){return V(n)&&"[object RegExp]"==sn.call(n);
26
+ },o.isString=L,o.isUndefined=function(n){return n===Z},o.last=function(n){var t=n?n.length:0;return t?n[t-1]:Z},o.max=function(n){return n&&n.length?p(n,X,y):Z},o.min=function(n){return n&&n.length?p(n,X,d):Z},o.noConflict=function(){return un._===this&&(un._=hn),this},o.noop=function(){},o.reduce=C,o.result=function(n,t,r){return t=null==n?Z:n[t],t===Z&&(t=r),U(t)?t.call(n):t},o.size=function(n){return null==n?0:(n=P(n)?n:Dn(n),n.length)},o.some=function(n,t,r){return t=r?Z:t,k(n,j(t))},o.uniqueId=function(n){
27
+ var t=++pn;return Q(n)+t},o.each=z,o.first=q,Y(o,function(){var n={};return v(o,function(t,r){ln.call(o.prototype,r)||(n[r]=t)}),n}(),{chain:false}),o.VERSION="4.14.1",jn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:fn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);o.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(kn(u)?u:[],n);
28
+ }return this[r](function(r){return t.apply(kn(r)?r:[],n)})}}),o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=function(){return N(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(un._=o, define(function(){return o})):on?((on.exports=o)._=o,en._=o):un._=o}).call(this);
@@ -12,7 +12,7 @@
12
12
  var undefined;
13
13
 
14
14
  /** Used as the semantic version number. */
15
- var VERSION = '4.13.1';
15
+ var VERSION = '4.14.1';
16
16
 
17
17
  /** Used as the size to enable large array optimizations. */
18
18
  var LARGE_ARRAY_SIZE = 200;
@@ -26,7 +26,7 @@
26
26
  /** Used as the internal argument placeholder. */
27
27
  var PLACEHOLDER = '__lodash_placeholder__';
28
28
 
29
- /** Used to compose bitmasks for wrapper metadata. */
29
+ /** Used to compose bitmasks for function metadata. */
30
30
  var BIND_FLAG = 1,
31
31
  BIND_KEY_FLAG = 2,
32
32
  CURRY_BOUND_FLAG = 4,
@@ -66,6 +66,19 @@
66
66
  MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
67
67
  HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
68
68
 
69
+ /** Used to associate wrap methods with their bit flags. */
70
+ var wrapFlags = [
71
+ ['ary', ARY_FLAG],
72
+ ['bind', BIND_FLAG],
73
+ ['bindKey', BIND_KEY_FLAG],
74
+ ['curry', CURRY_FLAG],
75
+ ['curryRight', CURRY_RIGHT_FLAG],
76
+ ['flip', FLIP_FLAG],
77
+ ['partial', PARTIAL_FLAG],
78
+ ['partialRight', PARTIAL_RIGHT_FLAG],
79
+ ['rearg', REARG_FLAG]
80
+ ];
81
+
69
82
  /** `Object#toString` result references. */
70
83
  var argsTag = '[object Arguments]',
71
84
  arrayTag = '[object Array]',
@@ -116,7 +129,8 @@
116
129
  /** Used to match property names within property paths. */
117
130
  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
118
131
  reIsPlainProp = /^\w*$/,
119
- rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g;
132
+ reLeadingDot = /^\./,
133
+ rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
120
134
 
121
135
  /**
122
136
  * Used to match `RegExp`
@@ -130,6 +144,11 @@
130
144
  reTrimStart = /^\s+/,
131
145
  reTrimEnd = /\s+$/;
132
146
 
147
+ /** Used to match wrap detail comments. */
148
+ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
149
+ reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
150
+ reSplitDetails = /,? & /;
151
+
133
152
  /** Used to match non-compound words composed of alphanumeric characters. */
134
153
  var reBasicWord = /[a-zA-Z0-9]+/g;
135
154
 
@@ -249,7 +268,7 @@
249
268
  'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
250
269
  'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError',
251
270
  'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
252
- '_', 'isFinite', 'parseInt', 'setTimeout'
271
+ '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
253
272
  ];
254
273
 
255
274
  /** Used to make template sourceURLs easier to identify. */
@@ -342,26 +361,41 @@
342
361
  var freeParseFloat = parseFloat,
343
362
  freeParseInt = parseInt;
344
363
 
364
+ /** Detect free variable `global` from Node.js. */
365
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
366
+
367
+ /** Detect free variable `self`. */
368
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
369
+
370
+ /** Used as a reference to the global object. */
371
+ var root = freeGlobal || freeSelf || Function('return this')();
372
+
345
373
  /** Detect free variable `exports`. */
346
- var freeExports = typeof exports == 'object' && exports;
374
+ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
347
375
 
348
376
  /** Detect free variable `module`. */
349
- var freeModule = freeExports && typeof module == 'object' && module;
377
+ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
350
378
 
351
379
  /** Detect the popular CommonJS extension `module.exports`. */
352
380
  var moduleExports = freeModule && freeModule.exports === freeExports;
353
381
 
354
- /** Detect free variable `global` from Node.js. */
355
- var freeGlobal = checkGlobal(typeof global == 'object' && global);
382
+ /** Detect free variable `process` from Node.js. */
383
+ var freeProcess = moduleExports && freeGlobal.process;
356
384
 
357
- /** Detect free variable `self`. */
358
- var freeSelf = checkGlobal(typeof self == 'object' && self);
385
+ /** Used to access faster Node.js helpers. */
386
+ var nodeUtil = (function() {
387
+ try {
388
+ return freeProcess && freeProcess.binding('util');
389
+ } catch (e) {}
390
+ }());
359
391
 
360
- /** Detect `this` as the global object. */
361
- var thisGlobal = checkGlobal(typeof this == 'object' && this);
362
-
363
- /** Used as a reference to the global object. */
364
- var root = freeGlobal || freeSelf || thisGlobal || Function('return this')();
392
+ /* Node.js helper references. */
393
+ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
394
+ nodeIsDate = nodeUtil && nodeUtil.isDate,
395
+ nodeIsMap = nodeUtil && nodeUtil.isMap,
396
+ nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
397
+ nodeIsSet = nodeUtil && nodeUtil.isSet,
398
+ nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
365
399
 
366
400
  /*--------------------------------------------------------------------------*/
367
401
 
@@ -374,7 +408,7 @@
374
408
  * @returns {Object} Returns `map`.
375
409
  */
376
410
  function addMapEntry(map, pair) {
377
- // Don't return `Map#set` because it doesn't return the map instance in IE 11.
411
+ // Don't return `map.set` because it's not chainable in IE 11.
378
412
  map.set(pair[0], pair[1]);
379
413
  return map;
380
414
  }
@@ -388,6 +422,7 @@
388
422
  * @returns {Object} Returns `set`.
389
423
  */
390
424
  function addSetEntry(set, value) {
425
+ // Don't return `set.add` because it's not chainable in IE 11.
391
426
  set.add(value);
392
427
  return set;
393
428
  }
@@ -403,8 +438,7 @@
403
438
  * @returns {*} Returns the result of `func`.
404
439
  */
405
440
  function apply(func, thisArg, args) {
406
- var length = args.length;
407
- switch (length) {
441
+ switch (args.length) {
408
442
  case 0: return func.call(thisArg);
409
443
  case 1: return func.call(thisArg, args[0]);
410
444
  case 2: return func.call(thisArg, args[0], args[1]);
@@ -721,7 +755,7 @@
721
755
  */
722
756
  function baseIndexOf(array, value, fromIndex) {
723
757
  if (value !== value) {
724
- return indexOfNaN(array, fromIndex);
758
+ return baseFindIndex(array, baseIsNaN, fromIndex);
725
759
  }
726
760
  var index = fromIndex - 1,
727
761
  length = array.length;
@@ -756,6 +790,17 @@
756
790
  return -1;
757
791
  }
758
792
 
793
+ /**
794
+ * The base implementation of `_.isNaN` without support for number objects.
795
+ *
796
+ * @private
797
+ * @param {*} value The value to check.
798
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
799
+ */
800
+ function baseIsNaN(value) {
801
+ return value !== value;
802
+ }
803
+
759
804
  /**
760
805
  * The base implementation of `_.mean` and `_.meanBy` without support for
761
806
  * iteratee shorthands.
@@ -770,6 +815,32 @@
770
815
  return length ? (baseSum(array, iteratee) / length) : NAN;
771
816
  }
772
817
 
818
+ /**
819
+ * The base implementation of `_.property` without support for deep paths.
820
+ *
821
+ * @private
822
+ * @param {string} key The key of the property to get.
823
+ * @returns {Function} Returns the new accessor function.
824
+ */
825
+ function baseProperty(key) {
826
+ return function(object) {
827
+ return object == null ? undefined : object[key];
828
+ };
829
+ }
830
+
831
+ /**
832
+ * The base implementation of `_.propertyOf` without support for deep paths.
833
+ *
834
+ * @private
835
+ * @param {Object} object The object to query.
836
+ * @returns {Function} Returns the new accessor function.
837
+ */
838
+ function basePropertyOf(object) {
839
+ return function(key) {
840
+ return object == null ? undefined : object[key];
841
+ };
842
+ }
843
+
773
844
  /**
774
845
  * The base implementation of `_.reduce` and `_.reduceRight`, without support
775
846
  * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
@@ -870,7 +941,7 @@
870
941
  }
871
942
 
872
943
  /**
873
- * The base implementation of `_.unary` without support for storing wrapper metadata.
944
+ * The base implementation of `_.unary` without support for storing metadata.
874
945
  *
875
946
  * @private
876
947
  * @param {Function} func The function to cap arguments for.
@@ -943,17 +1014,6 @@
943
1014
  return index;
944
1015
  }
945
1016
 
946
- /**
947
- * Checks if `value` is a global object.
948
- *
949
- * @private
950
- * @param {*} value The value to check.
951
- * @returns {null|Object} Returns `value` if it's a global object, else `null`.
952
- */
953
- function checkGlobal(value) {
954
- return (value && value.Object === Object) ? value : null;
955
- }
956
-
957
1017
  /**
958
1018
  * Gets the number of `placeholder` occurrences in `array`.
959
1019
  *
@@ -981,9 +1041,7 @@
981
1041
  * @param {string} letter The matched letter to deburr.
982
1042
  * @returns {string} Returns the deburred letter.
983
1043
  */
984
- function deburrLetter(letter) {
985
- return deburredLetters[letter];
986
- }
1044
+ var deburrLetter = basePropertyOf(deburredLetters);
987
1045
 
988
1046
  /**
989
1047
  * Used by `_.escape` to convert characters to HTML entities.
@@ -992,9 +1050,7 @@
992
1050
  * @param {string} chr The matched character to escape.
993
1051
  * @returns {string} Returns the escaped character.
994
1052
  */
995
- function escapeHtmlChar(chr) {
996
- return htmlEscapes[chr];
997
- }
1053
+ var escapeHtmlChar = basePropertyOf(htmlEscapes);
998
1054
 
999
1055
  /**
1000
1056
  * Used by `_.template` to escape characters for inclusion in compiled string literals.
@@ -1019,28 +1075,6 @@
1019
1075
  return object == null ? undefined : object[key];
1020
1076
  }
1021
1077
 
1022
- /**
1023
- * Gets the index at which the first occurrence of `NaN` is found in `array`.
1024
- *
1025
- * @private
1026
- * @param {Array} array The array to search.
1027
- * @param {number} fromIndex The index to search from.
1028
- * @param {boolean} [fromRight] Specify iterating from right to left.
1029
- * @returns {number} Returns the index of the matched `NaN`, else `-1`.
1030
- */
1031
- function indexOfNaN(array, fromIndex, fromRight) {
1032
- var length = array.length,
1033
- index = fromIndex + (fromRight ? 1 : -1);
1034
-
1035
- while ((fromRight ? index-- : ++index < length)) {
1036
- var other = array[index];
1037
- if (other !== other) {
1038
- return index;
1039
- }
1040
- }
1041
- return -1;
1042
- }
1043
-
1044
1078
  /**
1045
1079
  * Checks if `value` is a host object in IE < 9.
1046
1080
  *
@@ -1094,6 +1128,20 @@
1094
1128
  return result;
1095
1129
  }
1096
1130
 
1131
+ /**
1132
+ * Creates a function that invokes `func` with its first argument transformed.
1133
+ *
1134
+ * @private
1135
+ * @param {Function} func The function to wrap.
1136
+ * @param {Function} transform The argument transform.
1137
+ * @returns {Function} Returns the new function.
1138
+ */
1139
+ function overArg(func, transform) {
1140
+ return function(arg) {
1141
+ return func(transform(arg));
1142
+ };
1143
+ }
1144
+
1097
1145
  /**
1098
1146
  * Replaces all `placeholder` elements in `array` with an internal placeholder
1099
1147
  * and returns an array of their indexes.
@@ -1189,9 +1237,7 @@
1189
1237
  * @param {string} chr The matched character to unescape.
1190
1238
  * @returns {string} Returns the unescaped character.
1191
1239
  */
1192
- function unescapeHtmlChar(chr) {
1193
- return htmlUnescapes[chr];
1194
- }
1240
+ var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
1195
1241
 
1196
1242
  /*--------------------------------------------------------------------------*/
1197
1243
 
@@ -1235,7 +1281,8 @@
1235
1281
  context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root;
1236
1282
 
1237
1283
  /** Built-in constructor references. */
1238
- var Date = context.Date,
1284
+ var Array = context.Array,
1285
+ Date = context.Date,
1239
1286
  Error = context.Error,
1240
1287
  Math = context.Math,
1241
1288
  RegExp = context.RegExp,
@@ -1289,19 +1336,22 @@
1289
1336
  Symbol = context.Symbol,
1290
1337
  Uint8Array = context.Uint8Array,
1291
1338
  enumerate = Reflect ? Reflect.enumerate : undefined,
1292
- getOwnPropertySymbols = Object.getOwnPropertySymbols,
1293
- iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined,
1294
- objectCreate = Object.create,
1339
+ iteratorSymbol = Symbol ? Symbol.iterator : undefined,
1340
+ objectCreate = context.Object.create,
1295
1341
  propertyIsEnumerable = objectProto.propertyIsEnumerable,
1296
- splice = arrayProto.splice;
1342
+ splice = arrayProto.splice,
1343
+ spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
1297
1344
 
1298
1345
  /** Built-in method references that are mockable. */
1299
- var setTimeout = function(func, wait) { return context.setTimeout.call(root, func, wait); };
1346
+ var clearTimeout = function(id) { return context.clearTimeout.call(root, id); },
1347
+ setTimeout = function(func, wait) { return context.setTimeout.call(root, func, wait); };
1300
1348
 
1301
1349
  /* Built-in method references for those with the same name as other `lodash` methods. */
1302
1350
  var nativeCeil = Math.ceil,
1303
1351
  nativeFloor = Math.floor,
1304
1352
  nativeGetPrototype = Object.getPrototypeOf,
1353
+ nativeGetSymbols = Object.getOwnPropertySymbols,
1354
+ nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
1305
1355
  nativeIsFinite = context.isFinite,
1306
1356
  nativeJoin = arrayProto.join,
1307
1357
  nativeKeys = Object.keys,
@@ -1319,7 +1369,15 @@
1319
1369
  Promise = getNative(context, 'Promise'),
1320
1370
  Set = getNative(context, 'Set'),
1321
1371
  WeakMap = getNative(context, 'WeakMap'),
1322
- nativeCreate = getNative(Object, 'create');
1372
+ nativeCreate = getNative(context.Object, 'create');
1373
+
1374
+ /* Used to set `toString` methods. */
1375
+ var defineProperty = (function() {
1376
+ var func = getNative(context.Object, 'defineProperty'),
1377
+ name = getNative.name;
1378
+
1379
+ return (name && name.length > 2) ? func : undefined;
1380
+ }());
1323
1381
 
1324
1382
  /** Used to store function metadata. */
1325
1383
  var metaMap = WeakMap && new WeakMap;
@@ -1410,16 +1468,16 @@
1410
1468
  *
1411
1469
  * The wrapper methods that are **not** chainable by default are:
1412
1470
  * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
1413
- * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`,
1414
- * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`,
1415
- * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`,
1416
- * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`,
1417
- * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`,
1418
- * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`,
1419
- * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
1420
- * `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`,
1421
- * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`,
1422
- * `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
1471
+ * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
1472
+ * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
1473
+ * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
1474
+ * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
1475
+ * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
1476
+ * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
1477
+ * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
1478
+ * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
1479
+ * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
1480
+ * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
1423
1481
  * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
1424
1482
  * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
1425
1483
  * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
@@ -2122,8 +2180,13 @@
2122
2180
  */
2123
2181
  function stackSet(key, value) {
2124
2182
  var cache = this.__data__;
2125
- if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) {
2126
- cache = this.__data__ = new MapCache(cache.__data__);
2183
+ if (cache instanceof ListCache) {
2184
+ var pairs = cache.__data__;
2185
+ if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
2186
+ pairs.push([key, value]);
2187
+ return this;
2188
+ }
2189
+ cache = this.__data__ = new MapCache(pairs);
2127
2190
  }
2128
2191
  cache.set(key, value);
2129
2192
  return this;
@@ -2260,7 +2323,7 @@
2260
2323
  }
2261
2324
 
2262
2325
  /**
2263
- * The base implementation of `_.clamp` which doesn't coerce arguments to numbers.
2326
+ * The base implementation of `_.clamp` which doesn't coerce arguments.
2264
2327
  *
2265
2328
  * @private
2266
2329
  * @param {number} number The number to clamp.
@@ -2344,12 +2407,12 @@
2344
2407
  if (!isArr) {
2345
2408
  var props = isFull ? getAllKeys(value) : keys(value);
2346
2409
  }
2347
- // Recursively populate clone (susceptible to call stack limits).
2348
2410
  arrayEach(props || value, function(subValue, key) {
2349
2411
  if (props) {
2350
2412
  key = subValue;
2351
2413
  subValue = value[key];
2352
2414
  }
2415
+ // Recursively populate clone (susceptible to call stack limits).
2353
2416
  assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
2354
2417
  });
2355
2418
  return result;
@@ -2363,26 +2426,37 @@
2363
2426
  * @returns {Function} Returns the new spec function.
2364
2427
  */
2365
2428
  function baseConforms(source) {
2366
- var props = keys(source),
2367
- length = props.length;
2368
-
2429
+ var props = keys(source);
2369
2430
  return function(object) {
2370
- if (object == null) {
2371
- return !length;
2372
- }
2373
- var index = length;
2374
- while (index--) {
2375
- var key = props[index],
2376
- predicate = source[key],
2377
- value = object[key];
2431
+ return baseConformsTo(object, source, props);
2432
+ };
2433
+ }
2378
2434
 
2379
- if ((value === undefined &&
2380
- !(key in Object(object))) || !predicate(value)) {
2381
- return false;
2382
- }
2435
+ /**
2436
+ * The base implementation of `_.conformsTo` which accepts `props` to check.
2437
+ *
2438
+ * @private
2439
+ * @param {Object} object The object to inspect.
2440
+ * @param {Object} source The object of property predicates to conform to.
2441
+ * @returns {boolean} Returns `true` if `object` conforms, else `false`.
2442
+ */
2443
+ function baseConformsTo(object, source, props) {
2444
+ var length = props.length;
2445
+ if (object == null) {
2446
+ return !length;
2447
+ }
2448
+ var index = length;
2449
+ while (index--) {
2450
+ var key = props[index],
2451
+ predicate = source[key],
2452
+ value = object[key];
2453
+
2454
+ if ((value === undefined &&
2455
+ !(key in Object(object))) || !predicate(value)) {
2456
+ return false;
2383
2457
  }
2384
- return true;
2385
- };
2458
+ }
2459
+ return true;
2386
2460
  }
2387
2461
 
2388
2462
  /**
@@ -2398,13 +2472,13 @@
2398
2472
  }
2399
2473
 
2400
2474
  /**
2401
- * The base implementation of `_.delay` and `_.defer` which accepts an array
2402
- * of `func` arguments.
2475
+ * The base implementation of `_.delay` and `_.defer` which accepts `args`
2476
+ * to provide to `func`.
2403
2477
  *
2404
2478
  * @private
2405
2479
  * @param {Function} func The function to delay.
2406
2480
  * @param {number} wait The number of milliseconds to delay invocation.
2407
- * @param {Object} args The arguments to provide to `func`.
2481
+ * @param {Array} args The arguments to provide to `func`.
2408
2482
  * @returns {number} Returns the timer id.
2409
2483
  */
2410
2484
  function baseDelay(func, wait, args) {
@@ -2718,7 +2792,18 @@
2718
2792
  }
2719
2793
 
2720
2794
  /**
2721
- * The base implementation of `_.gt` which doesn't coerce arguments to numbers.
2795
+ * The base implementation of `getTag`.
2796
+ *
2797
+ * @private
2798
+ * @param {*} value The value to query.
2799
+ * @returns {string} Returns the `toStringTag`.
2800
+ */
2801
+ function baseGetTag(value) {
2802
+ return objectToString.call(value);
2803
+ }
2804
+
2805
+ /**
2806
+ * The base implementation of `_.gt` which doesn't coerce arguments.
2722
2807
  *
2723
2808
  * @private
2724
2809
  * @param {*} value The value to compare.
@@ -2760,7 +2845,7 @@
2760
2845
  }
2761
2846
 
2762
2847
  /**
2763
- * The base implementation of `_.inRange` which doesn't coerce arguments to numbers.
2848
+ * The base implementation of `_.inRange` which doesn't coerce arguments.
2764
2849
  *
2765
2850
  * @private
2766
2851
  * @param {number} number The number to check.
@@ -2873,6 +2958,28 @@
2873
2958
  return func == null ? undefined : apply(func, object, args);
2874
2959
  }
2875
2960
 
2961
+ /**
2962
+ * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
2963
+ *
2964
+ * @private
2965
+ * @param {*} value The value to check.
2966
+ * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
2967
+ */
2968
+ function baseIsArrayBuffer(value) {
2969
+ return isObjectLike(value) && objectToString.call(value) == arrayBufferTag;
2970
+ }
2971
+
2972
+ /**
2973
+ * The base implementation of `_.isDate` without Node.js optimizations.
2974
+ *
2975
+ * @private
2976
+ * @param {*} value The value to check.
2977
+ * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
2978
+ */
2979
+ function baseIsDate(value) {
2980
+ return isObjectLike(value) && objectToString.call(value) == dateTag;
2981
+ }
2982
+
2876
2983
  /**
2877
2984
  * The base implementation of `_.isEqual` which supports partial comparisons
2878
2985
  * and tracks traversed objects.
@@ -2956,6 +3063,17 @@
2956
3063
  return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
2957
3064
  }
2958
3065
 
3066
+ /**
3067
+ * The base implementation of `_.isMap` without Node.js optimizations.
3068
+ *
3069
+ * @private
3070
+ * @param {*} value The value to check.
3071
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
3072
+ */
3073
+ function baseIsMap(value) {
3074
+ return isObjectLike(value) && getTag(value) == mapTag;
3075
+ }
3076
+
2959
3077
  /**
2960
3078
  * The base implementation of `_.isMatch` without support for iteratee shorthands.
2961
3079
  *
@@ -3026,6 +3144,40 @@
3026
3144
  return pattern.test(toSource(value));
3027
3145
  }
3028
3146
 
3147
+ /**
3148
+ * The base implementation of `_.isRegExp` without Node.js optimizations.
3149
+ *
3150
+ * @private
3151
+ * @param {*} value The value to check.
3152
+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
3153
+ */
3154
+ function baseIsRegExp(value) {
3155
+ return isObject(value) && objectToString.call(value) == regexpTag;
3156
+ }
3157
+
3158
+ /**
3159
+ * The base implementation of `_.isSet` without Node.js optimizations.
3160
+ *
3161
+ * @private
3162
+ * @param {*} value The value to check.
3163
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
3164
+ */
3165
+ function baseIsSet(value) {
3166
+ return isObjectLike(value) && getTag(value) == setTag;
3167
+ }
3168
+
3169
+ /**
3170
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
3171
+ *
3172
+ * @private
3173
+ * @param {*} value The value to check.
3174
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
3175
+ */
3176
+ function baseIsTypedArray(value) {
3177
+ return isObjectLike(value) &&
3178
+ isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
3179
+ }
3180
+
3029
3181
  /**
3030
3182
  * The base implementation of `_.iteratee`.
3031
3183
  *
@@ -3058,9 +3210,7 @@
3058
3210
  * @param {Object} object The object to query.
3059
3211
  * @returns {Array} Returns the array of property names.
3060
3212
  */
3061
- function baseKeys(object) {
3062
- return nativeKeys(Object(object));
3063
- }
3213
+ var baseKeys = overArg(nativeKeys, Object);
3064
3214
 
3065
3215
  /**
3066
3216
  * The base implementation of `_.keysIn` which doesn't skip the constructor
@@ -3088,7 +3238,7 @@
3088
3238
  }
3089
3239
 
3090
3240
  /**
3091
- * The base implementation of `_.lt` which doesn't coerce arguments to numbers.
3241
+ * The base implementation of `_.lt` which doesn't coerce arguments.
3092
3242
  *
3093
3243
  * @private
3094
3244
  * @param {*} value The value to compare.
@@ -3255,18 +3405,17 @@
3255
3405
  isCommon = false;
3256
3406
  }
3257
3407
  }
3258
- stack.set(srcValue, newValue);
3259
-
3260
3408
  if (isCommon) {
3261
3409
  // Recursively merge objects and arrays (susceptible to call stack limits).
3410
+ stack.set(srcValue, newValue);
3262
3411
  mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
3412
+ stack['delete'](srcValue);
3263
3413
  }
3264
- stack['delete'](srcValue);
3265
3414
  assignMergeValue(object, key, newValue);
3266
3415
  }
3267
3416
 
3268
3417
  /**
3269
- * The base implementation of `_.nth` which doesn't coerce `n` to an integer.
3418
+ * The base implementation of `_.nth` which doesn't coerce arguments.
3270
3419
  *
3271
3420
  * @private
3272
3421
  * @param {Array} array The array to query.
@@ -3318,12 +3467,9 @@
3318
3467
  */
3319
3468
  function basePick(object, props) {
3320
3469
  object = Object(object);
3321
- return arrayReduce(props, function(result, key) {
3322
- if (key in object) {
3323
- result[key] = object[key];
3324
- }
3325
- return result;
3326
- }, {});
3470
+ return basePickBy(object, props, function(value, key) {
3471
+ return key in object;
3472
+ });
3327
3473
  }
3328
3474
 
3329
3475
  /**
@@ -3331,12 +3477,12 @@
3331
3477
  *
3332
3478
  * @private
3333
3479
  * @param {Object} object The source object.
3480
+ * @param {string[]} props The property identifiers to pick from.
3334
3481
  * @param {Function} predicate The function invoked per property.
3335
3482
  * @returns {Object} Returns the new object.
3336
3483
  */
3337
- function basePickBy(object, predicate) {
3484
+ function basePickBy(object, props, predicate) {
3338
3485
  var index = -1,
3339
- props = getAllKeysIn(object),
3340
3486
  length = props.length,
3341
3487
  result = {};
3342
3488
 
@@ -3351,19 +3497,6 @@
3351
3497
  return result;
3352
3498
  }
3353
3499
 
3354
- /**
3355
- * The base implementation of `_.property` without support for deep paths.
3356
- *
3357
- * @private
3358
- * @param {string} key The key of the property to get.
3359
- * @returns {Function} Returns the new accessor function.
3360
- */
3361
- function baseProperty(key) {
3362
- return function(object) {
3363
- return object == null ? undefined : object[key];
3364
- };
3365
- }
3366
-
3367
3500
  /**
3368
3501
  * A specialized version of `baseProperty` which supports deep paths.
3369
3502
  *
@@ -3466,7 +3599,7 @@
3466
3599
 
3467
3600
  /**
3468
3601
  * The base implementation of `_.range` and `_.rangeRight` which doesn't
3469
- * coerce arguments to numbers.
3602
+ * coerce arguments.
3470
3603
  *
3471
3604
  * @private
3472
3605
  * @param {number} start The start of the range.
@@ -3515,6 +3648,35 @@
3515
3648
  return result;
3516
3649
  }
3517
3650
 
3651
+ /**
3652
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
3653
+ *
3654
+ * @private
3655
+ * @param {Function} func The function to apply a rest parameter to.
3656
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
3657
+ * @returns {Function} Returns the new function.
3658
+ */
3659
+ function baseRest(func, start) {
3660
+ start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
3661
+ return function() {
3662
+ var args = arguments,
3663
+ index = -1,
3664
+ length = nativeMax(args.length - start, 0),
3665
+ array = Array(length);
3666
+
3667
+ while (++index < length) {
3668
+ array[index] = args[start + index];
3669
+ }
3670
+ index = -1;
3671
+ var otherArgs = Array(start + 1);
3672
+ while (++index < start) {
3673
+ otherArgs[index] = args[index];
3674
+ }
3675
+ otherArgs[start] = array;
3676
+ return apply(func, this, otherArgs);
3677
+ };
3678
+ }
3679
+
3518
3680
  /**
3519
3681
  * The base implementation of `_.set`.
3520
3682
  *
@@ -4294,9 +4456,9 @@
4294
4456
 
4295
4457
  var newValue = customizer
4296
4458
  ? customizer(object[key], source[key], key, object, source)
4297
- : source[key];
4459
+ : undefined;
4298
4460
 
4299
- assignValue(object, key, newValue);
4461
+ assignValue(object, key, newValue === undefined ? source[key] : newValue);
4300
4462
  }
4301
4463
  return object;
4302
4464
  }
@@ -4326,7 +4488,7 @@
4326
4488
  var func = isArray(collection) ? arrayAggregator : baseAggregator,
4327
4489
  accumulator = initializer ? initializer() : {};
4328
4490
 
4329
- return func(collection, setter, getIteratee(iteratee), accumulator);
4491
+ return func(collection, setter, getIteratee(iteratee, 2), accumulator);
4330
4492
  };
4331
4493
  }
4332
4494
 
@@ -4338,7 +4500,7 @@
4338
4500
  * @returns {Function} Returns the new assigner function.
4339
4501
  */
4340
4502
  function createAssigner(assigner) {
4341
- return rest(function(object, sources) {
4503
+ return baseRest(function(object, sources) {
4342
4504
  var index = -1,
4343
4505
  length = sources.length,
4344
4506
  customizer = length > 1 ? sources[length - 1] : undefined,
@@ -4422,14 +4584,13 @@
4422
4584
  *
4423
4585
  * @private
4424
4586
  * @param {Function} func The function to wrap.
4425
- * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
4426
- * for more details.
4587
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
4427
4588
  * @param {*} [thisArg] The `this` binding of `func`.
4428
4589
  * @returns {Function} Returns the new wrapped function.
4429
4590
  */
4430
- function createBaseWrapper(func, bitmask, thisArg) {
4591
+ function createBind(func, bitmask, thisArg) {
4431
4592
  var isBind = bitmask & BIND_FLAG,
4432
- Ctor = createCtorWrapper(func);
4593
+ Ctor = createCtor(func);
4433
4594
 
4434
4595
  function wrapper() {
4435
4596
  var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
@@ -4486,7 +4647,7 @@
4486
4647
  * @param {Function} Ctor The constructor to wrap.
4487
4648
  * @returns {Function} Returns the new wrapped function.
4488
4649
  */
4489
- function createCtorWrapper(Ctor) {
4650
+ function createCtor(Ctor) {
4490
4651
  return function() {
4491
4652
  // Use a `switch` statement to work with class constructors. See
4492
4653
  // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
@@ -4516,13 +4677,12 @@
4516
4677
  *
4517
4678
  * @private
4518
4679
  * @param {Function} func The function to wrap.
4519
- * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
4520
- * for more details.
4680
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
4521
4681
  * @param {number} arity The arity of `func`.
4522
4682
  * @returns {Function} Returns the new wrapped function.
4523
4683
  */
4524
- function createCurryWrapper(func, bitmask, arity) {
4525
- var Ctor = createCtorWrapper(func);
4684
+ function createCurry(func, bitmask, arity) {
4685
+ var Ctor = createCtor(func);
4526
4686
 
4527
4687
  function wrapper() {
4528
4688
  var length = arguments.length,
@@ -4539,8 +4699,8 @@
4539
4699
 
4540
4700
  length -= holders.length;
4541
4701
  if (length < arity) {
4542
- return createRecurryWrapper(
4543
- func, bitmask, createHybridWrapper, wrapper.placeholder, undefined,
4702
+ return createRecurry(
4703
+ func, bitmask, createHybrid, wrapper.placeholder, undefined,
4544
4704
  args, holders, undefined, undefined, arity - length);
4545
4705
  }
4546
4706
  var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
@@ -4559,18 +4719,13 @@
4559
4719
  function createFind(findIndexFunc) {
4560
4720
  return function(collection, predicate, fromIndex) {
4561
4721
  var iterable = Object(collection);
4562
- predicate = getIteratee(predicate, 3);
4563
4722
  if (!isArrayLike(collection)) {
4564
- var props = keys(collection);
4723
+ var iteratee = getIteratee(predicate, 3);
4724
+ collection = keys(collection);
4725
+ predicate = function(key) { return iteratee(iterable[key], key, iterable); };
4565
4726
  }
4566
- var index = findIndexFunc(props || collection, function(value, key) {
4567
- if (props) {
4568
- key = value;
4569
- value = iterable[key];
4570
- }
4571
- return predicate(value, key, iterable);
4572
- }, fromIndex);
4573
- return index > -1 ? collection[props ? props[index] : index] : undefined;
4727
+ var index = findIndexFunc(collection, predicate, fromIndex);
4728
+ return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
4574
4729
  };
4575
4730
  }
4576
4731
 
@@ -4582,7 +4737,7 @@
4582
4737
  * @returns {Function} Returns the new flow function.
4583
4738
  */
4584
4739
  function createFlow(fromRight) {
4585
- return rest(function(funcs) {
4740
+ return baseRest(function(funcs) {
4586
4741
  funcs = baseFlatten(funcs, 1);
4587
4742
 
4588
4743
  var length = funcs.length,
@@ -4644,8 +4799,7 @@
4644
4799
  *
4645
4800
  * @private
4646
4801
  * @param {Function|string} func The function or method name to wrap.
4647
- * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
4648
- * for more details.
4802
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
4649
4803
  * @param {*} [thisArg] The `this` binding of `func`.
4650
4804
  * @param {Array} [partials] The arguments to prepend to those provided to
4651
4805
  * the new function.
@@ -4658,13 +4812,13 @@
4658
4812
  * @param {number} [arity] The arity of `func`.
4659
4813
  * @returns {Function} Returns the new wrapped function.
4660
4814
  */
4661
- function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
4815
+ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
4662
4816
  var isAry = bitmask & ARY_FLAG,
4663
4817
  isBind = bitmask & BIND_FLAG,
4664
4818
  isBindKey = bitmask & BIND_KEY_FLAG,
4665
4819
  isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG),
4666
4820
  isFlip = bitmask & FLIP_FLAG,
4667
- Ctor = isBindKey ? undefined : createCtorWrapper(func);
4821
+ Ctor = isBindKey ? undefined : createCtor(func);
4668
4822
 
4669
4823
  function wrapper() {
4670
4824
  var length = arguments.length,
@@ -4687,8 +4841,8 @@
4687
4841
  length -= holdersCount;
4688
4842
  if (isCurried && length < arity) {
4689
4843
  var newHolders = replaceHolders(args, placeholder);
4690
- return createRecurryWrapper(
4691
- func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg,
4844
+ return createRecurry(
4845
+ func, bitmask, createHybrid, wrapper.placeholder, thisArg,
4692
4846
  args, newHolders, argPos, ary, arity - length
4693
4847
  );
4694
4848
  }
@@ -4705,7 +4859,7 @@
4705
4859
  args.length = ary;
4706
4860
  }
4707
4861
  if (this && this !== root && this instanceof wrapper) {
4708
- fn = Ctor || createCtorWrapper(fn);
4862
+ fn = Ctor || createCtor(fn);
4709
4863
  }
4710
4864
  return fn.apply(thisBinding, args);
4711
4865
  }
@@ -4731,13 +4885,14 @@
4731
4885
  *
4732
4886
  * @private
4733
4887
  * @param {Function} operator The function to perform the operation.
4888
+ * @param {number} [defaultValue] The value used for `undefined` arguments.
4734
4889
  * @returns {Function} Returns the new mathematical operation function.
4735
4890
  */
4736
- function createMathOperation(operator) {
4891
+ function createMathOperation(operator, defaultValue) {
4737
4892
  return function(value, other) {
4738
4893
  var result;
4739
4894
  if (value === undefined && other === undefined) {
4740
- return 0;
4895
+ return defaultValue;
4741
4896
  }
4742
4897
  if (value !== undefined) {
4743
4898
  result = value;
@@ -4767,12 +4922,12 @@
4767
4922
  * @returns {Function} Returns the new over function.
4768
4923
  */
4769
4924
  function createOver(arrayFunc) {
4770
- return rest(function(iteratees) {
4925
+ return baseRest(function(iteratees) {
4771
4926
  iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
4772
4927
  ? arrayMap(iteratees[0], baseUnary(getIteratee()))
4773
- : arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(getIteratee()));
4928
+ : arrayMap(baseFlatten(iteratees, 1), baseUnary(getIteratee()));
4774
4929
 
4775
- return rest(function(args) {
4930
+ return baseRest(function(args) {
4776
4931
  var thisArg = this;
4777
4932
  return arrayFunc(iteratees, function(iteratee) {
4778
4933
  return apply(iteratee, thisArg, args);
@@ -4809,16 +4964,15 @@
4809
4964
  *
4810
4965
  * @private
4811
4966
  * @param {Function} func The function to wrap.
4812
- * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
4813
- * for more details.
4967
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
4814
4968
  * @param {*} thisArg The `this` binding of `func`.
4815
4969
  * @param {Array} partials The arguments to prepend to those provided to
4816
4970
  * the new function.
4817
4971
  * @returns {Function} Returns the new wrapped function.
4818
4972
  */
4819
- function createPartialWrapper(func, bitmask, thisArg, partials) {
4973
+ function createPartial(func, bitmask, thisArg, partials) {
4820
4974
  var isBind = bitmask & BIND_FLAG,
4821
- Ctor = createCtorWrapper(func);
4975
+ Ctor = createCtor(func);
4822
4976
 
4823
4977
  function wrapper() {
4824
4978
  var argsIndex = -1,
@@ -4852,15 +5006,14 @@
4852
5006
  end = step = undefined;
4853
5007
  }
4854
5008
  // Ensure the sign of `-0` is preserved.
4855
- start = toNumber(start);
4856
- start = start === start ? start : 0;
5009
+ start = toFinite(start);
4857
5010
  if (end === undefined) {
4858
5011
  end = start;
4859
5012
  start = 0;
4860
5013
  } else {
4861
- end = toNumber(end) || 0;
5014
+ end = toFinite(end);
4862
5015
  }
4863
- step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
5016
+ step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
4864
5017
  return baseRange(start, end, step, fromRight);
4865
5018
  };
4866
5019
  }
@@ -4887,8 +5040,7 @@
4887
5040
  *
4888
5041
  * @private
4889
5042
  * @param {Function} func The function to wrap.
4890
- * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
4891
- * for more details.
5043
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
4892
5044
  * @param {Function} wrapFunc The function to create the `func` wrapper.
4893
5045
  * @param {*} placeholder The placeholder value.
4894
5046
  * @param {*} [thisArg] The `this` binding of `func`.
@@ -4900,7 +5052,7 @@
4900
5052
  * @param {number} [arity] The arity of `func`.
4901
5053
  * @returns {Function} Returns the new wrapped function.
4902
5054
  */
4903
- function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
5055
+ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
4904
5056
  var isCurry = bitmask & CURRY_FLAG,
4905
5057
  newHolders = isCurry ? holders : undefined,
4906
5058
  newHoldersRight = isCurry ? undefined : holders,
@@ -4923,7 +5075,7 @@
4923
5075
  setData(result, newData);
4924
5076
  }
4925
5077
  result.placeholder = placeholder;
4926
- return result;
5078
+ return setWrapToString(result, func, bitmask);
4927
5079
  }
4928
5080
 
4929
5081
  /**
@@ -4952,7 +5104,7 @@
4952
5104
  }
4953
5105
 
4954
5106
  /**
4955
- * Creates a set of `values`.
5107
+ * Creates a set object of `values`.
4956
5108
  *
4957
5109
  * @private
4958
5110
  * @param {Array} values The values to add to the set.
@@ -4988,7 +5140,7 @@
4988
5140
  *
4989
5141
  * @private
4990
5142
  * @param {Function|string} func The function or method name to wrap.
4991
- * @param {number} bitmask The bitmask of wrapper flags.
5143
+ * @param {number} bitmask The bitmask flags.
4992
5144
  * The bitmask may be composed of the following flags:
4993
5145
  * 1 - `_.bind`
4994
5146
  * 2 - `_.bindKey`
@@ -5008,7 +5160,7 @@
5008
5160
  * @param {number} [arity] The arity of `func`.
5009
5161
  * @returns {Function} Returns the new wrapped function.
5010
5162
  */
5011
- function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
5163
+ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
5012
5164
  var isBindKey = bitmask & BIND_KEY_FLAG;
5013
5165
  if (!isBindKey && typeof func != 'function') {
5014
5166
  throw new TypeError(FUNC_ERROR_TEXT);
@@ -5051,16 +5203,16 @@
5051
5203
  bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG);
5052
5204
  }
5053
5205
  if (!bitmask || bitmask == BIND_FLAG) {
5054
- var result = createBaseWrapper(func, bitmask, thisArg);
5206
+ var result = createBind(func, bitmask, thisArg);
5055
5207
  } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) {
5056
- result = createCurryWrapper(func, bitmask, arity);
5208
+ result = createCurry(func, bitmask, arity);
5057
5209
  } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) {
5058
- result = createPartialWrapper(func, bitmask, thisArg, partials);
5210
+ result = createPartial(func, bitmask, thisArg, partials);
5059
5211
  } else {
5060
- result = createHybridWrapper.apply(undefined, newData);
5212
+ result = createHybrid.apply(undefined, newData);
5061
5213
  }
5062
5214
  var setter = data ? baseSetData : setData;
5063
- return setter(result, newData);
5215
+ return setWrapToString(setter(result, newData), func, bitmask);
5064
5216
  }
5065
5217
 
5066
5218
  /**
@@ -5087,7 +5239,7 @@
5087
5239
  }
5088
5240
  // Assume cyclic values are equal.
5089
5241
  var stacked = stack.get(array);
5090
- if (stacked) {
5242
+ if (stacked && stack.get(other)) {
5091
5243
  return stacked == other;
5092
5244
  }
5093
5245
  var index = -1,
@@ -5095,6 +5247,7 @@
5095
5247
  seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;
5096
5248
 
5097
5249
  stack.set(array, other);
5250
+ stack.set(other, array);
5098
5251
 
5099
5252
  // Ignore non-index properties.
5100
5253
  while (++index < arrLength) {
@@ -5133,6 +5286,7 @@
5133
5286
  }
5134
5287
  }
5135
5288
  stack['delete'](array);
5289
+ stack['delete'](other);
5136
5290
  return result;
5137
5291
  }
5138
5292
 
@@ -5173,18 +5327,14 @@
5173
5327
 
5174
5328
  case boolTag:
5175
5329
  case dateTag:
5176
- // Coerce dates and booleans to numbers, dates to milliseconds and
5177
- // booleans to `1` or `0` treating invalid dates coerced to `NaN` as
5178
- // not equal.
5179
- return +object == +other;
5330
+ case numberTag:
5331
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
5332
+ // Invalid dates are coerced to `NaN`.
5333
+ return eq(+object, +other);
5180
5334
 
5181
5335
  case errorTag:
5182
5336
  return object.name == other.name && object.message == other.message;
5183
5337
 
5184
- case numberTag:
5185
- // Treat `NaN` vs. `NaN` as equal.
5186
- return (object != +object) ? other != +other : object == +other;
5187
-
5188
5338
  case regexpTag:
5189
5339
  case stringTag:
5190
5340
  // Coerce regexes to strings and treat strings, primitives and objects,
@@ -5208,10 +5358,12 @@
5208
5358
  return stacked == other;
5209
5359
  }
5210
5360
  bitmask |= UNORDERED_COMPARE_FLAG;
5211
- stack.set(object, other);
5212
5361
 
5213
5362
  // Recursively compare objects (susceptible to call stack limits).
5214
- return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
5363
+ stack.set(object, other);
5364
+ var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
5365
+ stack['delete'](object);
5366
+ return result;
5215
5367
 
5216
5368
  case symbolTag:
5217
5369
  if (symbolValueOf) {
@@ -5254,11 +5406,12 @@
5254
5406
  }
5255
5407
  // Assume cyclic values are equal.
5256
5408
  var stacked = stack.get(object);
5257
- if (stacked) {
5409
+ if (stacked && stack.get(other)) {
5258
5410
  return stacked == other;
5259
5411
  }
5260
5412
  var result = true;
5261
5413
  stack.set(object, other);
5414
+ stack.set(other, object);
5262
5415
 
5263
5416
  var skipCtor = isPartial;
5264
5417
  while (++index < objLength) {
@@ -5294,6 +5447,7 @@
5294
5447
  }
5295
5448
  }
5296
5449
  stack['delete'](object);
5450
+ stack['delete'](other);
5297
5451
  return result;
5298
5452
  }
5299
5453
 
@@ -5450,9 +5604,7 @@
5450
5604
  * @param {*} value The value to query.
5451
5605
  * @returns {null|Object} Returns the `[[Prototype]]`.
5452
5606
  */
5453
- function getPrototype(value) {
5454
- return nativeGetPrototype(Object(value));
5455
- }
5607
+ var getPrototype = overArg(nativeGetPrototype, Object);
5456
5608
 
5457
5609
  /**
5458
5610
  * Creates an array of the own enumerable symbol properties of `object`.
@@ -5461,16 +5613,7 @@
5461
5613
  * @param {Object} object The object to query.
5462
5614
  * @returns {Array} Returns the array of symbols.
5463
5615
  */
5464
- function getSymbols(object) {
5465
- // Coerce `object` to an object to avoid non-object errors in V8.
5466
- // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details.
5467
- return getOwnPropertySymbols(Object(object));
5468
- }
5469
-
5470
- // Fallback for IE < 11.
5471
- if (!getOwnPropertySymbols) {
5472
- getSymbols = stubArray;
5473
- }
5616
+ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
5474
5617
 
5475
5618
  /**
5476
5619
  * Creates an array of the own and inherited enumerable symbol properties
@@ -5480,7 +5623,7 @@
5480
5623
  * @param {Object} object The object to query.
5481
5624
  * @returns {Array} Returns the array of symbols.
5482
5625
  */
5483
- var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) {
5626
+ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
5484
5627
  var result = [];
5485
5628
  while (object) {
5486
5629
  arrayPush(result, getSymbols(object));
@@ -5496,9 +5639,7 @@
5496
5639
  * @param {*} value The value to query.
5497
5640
  * @returns {string} Returns the `toStringTag`.
5498
5641
  */
5499
- function getTag(value) {
5500
- return objectToString.call(value);
5501
- }
5642
+ var getTag = baseGetTag;
5502
5643
 
5503
5644
  // Fallback for data views, maps, sets, and weak maps in IE 11,
5504
5645
  // for data views in Edge, and promises in Node.js.
@@ -5553,6 +5694,18 @@
5553
5694
  return { 'start': start, 'end': end };
5554
5695
  }
5555
5696
 
5697
+ /**
5698
+ * Extracts wrapper details from the `source` body comment.
5699
+ *
5700
+ * @private
5701
+ * @param {string} source The source to inspect.
5702
+ * @returns {Array} Returns the wrapper details.
5703
+ */
5704
+ function getWrapDetails(source) {
5705
+ var match = source.match(reWrapDetails);
5706
+ return match ? match[1].split(reSplitDetails) : [];
5707
+ }
5708
+
5556
5709
  /**
5557
5710
  * Checks if `path` exists on `object`.
5558
5711
  *
@@ -5683,26 +5836,32 @@
5683
5836
  }
5684
5837
 
5685
5838
  /**
5686
- * Checks if `value` is a flattenable `arguments` object or array.
5839
+ * Inserts wrapper `details` in a comment at the top of the `source` body.
5687
5840
  *
5688
5841
  * @private
5689
- * @param {*} value The value to check.
5690
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
5842
+ * @param {string} source The source to modify.
5843
+ * @returns {Array} details The details to insert.
5844
+ * @returns {string} Returns the modified source.
5691
5845
  */
5692
- function isFlattenable(value) {
5693
- return isArray(value) || isArguments(value);
5846
+ function insertWrapDetails(source, details) {
5847
+ var length = details.length,
5848
+ lastIndex = length - 1;
5849
+
5850
+ details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
5851
+ details = details.join(length > 2 ? ', ' : ' ');
5852
+ return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
5694
5853
  }
5695
5854
 
5696
5855
  /**
5697
- * Checks if `value` is a flattenable array and not a `_.matchesProperty`
5698
- * iteratee shorthand.
5856
+ * Checks if `value` is a flattenable `arguments` object or array.
5699
5857
  *
5700
5858
  * @private
5701
5859
  * @param {*} value The value to check.
5702
5860
  * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
5703
5861
  */
5704
- function isFlattenableIteratee(value) {
5705
- return isArray(value) && !(value.length == 2 && !isFunction(value[0]));
5862
+ function isFlattenable(value) {
5863
+ return isArray(value) || isArguments(value) ||
5864
+ !!(spreadableSymbol && value && value[spreadableSymbol]);
5706
5865
  }
5707
5866
 
5708
5867
  /**
@@ -5952,7 +6111,10 @@
5952
6111
  */
5953
6112
  function mergeDefaults(objValue, srcValue, key, object, source, stack) {
5954
6113
  if (isObject(objValue) && isObject(srcValue)) {
5955
- baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue));
6114
+ // Recursively merge objects and arrays (susceptible to call stack limits).
6115
+ stack.set(srcValue, objValue);
6116
+ baseMerge(objValue, srcValue, undefined, mergeDefaults, stack);
6117
+ stack['delete'](srcValue);
5956
6118
  }
5957
6119
  return objValue;
5958
6120
  }
@@ -6025,6 +6187,25 @@
6025
6187
  };
6026
6188
  }());
6027
6189
 
6190
+ /**
6191
+ * Sets the `toString` method of `wrapper` to mimic the source of `reference`
6192
+ * with wrapper details in a comment at the top of the source body.
6193
+ *
6194
+ * @private
6195
+ * @param {Function} wrapper The function to modify.
6196
+ * @param {Function} reference The reference function.
6197
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
6198
+ * @returns {Function} Returns `wrapper`.
6199
+ */
6200
+ var setWrapToString = !defineProperty ? identity : function(wrapper, reference, bitmask) {
6201
+ var source = (reference + '');
6202
+ return defineProperty(wrapper, 'toString', {
6203
+ 'configurable': true,
6204
+ 'enumerable': false,
6205
+ 'value': constant(insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)))
6206
+ });
6207
+ };
6208
+
6028
6209
  /**
6029
6210
  * Converts `string` to a property path array.
6030
6211
  *
@@ -6033,8 +6214,13 @@
6033
6214
  * @returns {Array} Returns the property path array.
6034
6215
  */
6035
6216
  var stringToPath = memoize(function(string) {
6217
+ string = toString(string);
6218
+
6036
6219
  var result = [];
6037
- toString(string).replace(rePropName, function(match, number, quote, string) {
6220
+ if (reLeadingDot.test(string)) {
6221
+ result.push('');
6222
+ }
6223
+ string.replace(rePropName, function(match, number, quote, string) {
6038
6224
  result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
6039
6225
  });
6040
6226
  return result;
@@ -6074,6 +6260,24 @@
6074
6260
  return '';
6075
6261
  }
6076
6262
 
6263
+ /**
6264
+ * Updates wrapper `details` based on `bitmask` flags.
6265
+ *
6266
+ * @private
6267
+ * @returns {Array} details The details to modify.
6268
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
6269
+ * @returns {Array} Returns `details`.
6270
+ */
6271
+ function updateWrapDetails(details, bitmask) {
6272
+ arrayEach(wrapFlags, function(pair) {
6273
+ var value = '_.' + pair[0];
6274
+ if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
6275
+ details.push(value);
6276
+ }
6277
+ });
6278
+ return details.sort();
6279
+ }
6280
+
6077
6281
  /**
6078
6282
  * Creates a clone of `wrapper`.
6079
6283
  *
@@ -6202,11 +6406,13 @@
6202
6406
  }
6203
6407
 
6204
6408
  /**
6205
- * Creates an array of unique `array` values not included in the other given
6206
- * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
6409
+ * Creates an array of `array` values not included in the other given arrays
6410
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
6207
6411
  * for equality comparisons. The order of result values is determined by the
6208
6412
  * order they occur in the first array.
6209
6413
  *
6414
+ * **Note:** Unlike `_.pullAll`, this method returns a new array.
6415
+ *
6210
6416
  * @static
6211
6417
  * @memberOf _
6212
6418
  * @since 0.1.0
@@ -6220,7 +6426,7 @@
6220
6426
  * _.difference([2, 1], [2, 3]);
6221
6427
  * // => [1]
6222
6428
  */
6223
- var difference = rest(function(array, values) {
6429
+ var difference = baseRest(function(array, values) {
6224
6430
  return isArrayLikeObject(array)
6225
6431
  ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
6226
6432
  : [];
@@ -6232,14 +6438,15 @@
6232
6438
  * by which they're compared. Result values are chosen from the first array.
6233
6439
  * The iteratee is invoked with one argument: (value).
6234
6440
  *
6441
+ * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
6442
+ *
6235
6443
  * @static
6236
6444
  * @memberOf _
6237
6445
  * @since 4.0.0
6238
6446
  * @category Array
6239
6447
  * @param {Array} array The array to inspect.
6240
6448
  * @param {...Array} [values] The values to exclude.
6241
- * @param {Array|Function|Object|string} [iteratee=_.identity]
6242
- * The iteratee invoked per element.
6449
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
6243
6450
  * @returns {Array} Returns the new array of filtered values.
6244
6451
  * @example
6245
6452
  *
@@ -6250,13 +6457,13 @@
6250
6457
  * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
6251
6458
  * // => [{ 'x': 2 }]
6252
6459
  */
6253
- var differenceBy = rest(function(array, values) {
6460
+ var differenceBy = baseRest(function(array, values) {
6254
6461
  var iteratee = last(values);
6255
6462
  if (isArrayLikeObject(iteratee)) {
6256
6463
  iteratee = undefined;
6257
6464
  }
6258
6465
  return isArrayLikeObject(array)
6259
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee))
6466
+ ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
6260
6467
  : [];
6261
6468
  });
6262
6469
 
@@ -6266,6 +6473,8 @@
6266
6473
  * are chosen from the first array. The comparator is invoked with two arguments:
6267
6474
  * (arrVal, othVal).
6268
6475
  *
6476
+ * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
6477
+ *
6269
6478
  * @static
6270
6479
  * @memberOf _
6271
6480
  * @since 4.0.0
@@ -6281,7 +6490,7 @@
6281
6490
  * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
6282
6491
  * // => [{ 'x': 2, 'y': 1 }]
6283
6492
  */
6284
- var differenceWith = rest(function(array, values) {
6493
+ var differenceWith = baseRest(function(array, values) {
6285
6494
  var comparator = last(values);
6286
6495
  if (isArrayLikeObject(comparator)) {
6287
6496
  comparator = undefined;
@@ -6370,8 +6579,7 @@
6370
6579
  * @since 3.0.0
6371
6580
  * @category Array
6372
6581
  * @param {Array} array The array to query.
6373
- * @param {Array|Function|Object|string} [predicate=_.identity]
6374
- * The function invoked per iteration.
6582
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
6375
6583
  * @returns {Array} Returns the slice of `array`.
6376
6584
  * @example
6377
6585
  *
@@ -6412,7 +6620,7 @@
6412
6620
  * @since 3.0.0
6413
6621
  * @category Array
6414
6622
  * @param {Array} array The array to query.
6415
- * @param {Array|Function|Object|string} [predicate=_.identity]
6623
+ * @param {Function} [predicate=_.identity]
6416
6624
  * The function invoked per iteration.
6417
6625
  * @returns {Array} Returns the slice of `array`.
6418
6626
  * @example
@@ -6494,7 +6702,7 @@
6494
6702
  * @since 1.1.0
6495
6703
  * @category Array
6496
6704
  * @param {Array} array The array to search.
6497
- * @param {Array|Function|Object|string} [predicate=_.identity]
6705
+ * @param {Function} [predicate=_.identity]
6498
6706
  * The function invoked per iteration.
6499
6707
  * @param {number} [fromIndex=0] The index to search from.
6500
6708
  * @returns {number} Returns the index of the found element, else `-1`.
@@ -6542,7 +6750,7 @@
6542
6750
  * @since 2.0.0
6543
6751
  * @category Array
6544
6752
  * @param {Array} array The array to search.
6545
- * @param {Array|Function|Object|string} [predicate=_.identity]
6753
+ * @param {Function} [predicate=_.identity]
6546
6754
  * The function invoked per iteration.
6547
6755
  * @param {number} [fromIndex=array.length-1] The index to search from.
6548
6756
  * @returns {number} Returns the index of the found element, else `-1`.
@@ -6663,8 +6871,8 @@
6663
6871
  * @returns {Object} Returns the new object.
6664
6872
  * @example
6665
6873
  *
6666
- * _.fromPairs([['fred', 30], ['barney', 40]]);
6667
- * // => { 'fred': 30, 'barney': 40 }
6874
+ * _.fromPairs([['a', 1], ['b', 2]]);
6875
+ * // => { 'a': 1, 'b': 2 }
6668
6876
  */
6669
6877
  function fromPairs(pairs) {
6670
6878
  var index = -1,
@@ -6770,7 +6978,7 @@
6770
6978
  * _.intersection([2, 1], [2, 3]);
6771
6979
  * // => [2]
6772
6980
  */
6773
- var intersection = rest(function(arrays) {
6981
+ var intersection = baseRest(function(arrays) {
6774
6982
  var mapped = arrayMap(arrays, castArrayLikeObject);
6775
6983
  return (mapped.length && mapped[0] === arrays[0])
6776
6984
  ? baseIntersection(mapped)
@@ -6788,8 +6996,7 @@
6788
6996
  * @since 4.0.0
6789
6997
  * @category Array
6790
6998
  * @param {...Array} [arrays] The arrays to inspect.
6791
- * @param {Array|Function|Object|string} [iteratee=_.identity]
6792
- * The iteratee invoked per element.
6999
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
6793
7000
  * @returns {Array} Returns the new array of intersecting values.
6794
7001
  * @example
6795
7002
  *
@@ -6800,7 +7007,7 @@
6800
7007
  * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
6801
7008
  * // => [{ 'x': 1 }]
6802
7009
  */
6803
- var intersectionBy = rest(function(arrays) {
7010
+ var intersectionBy = baseRest(function(arrays) {
6804
7011
  var iteratee = last(arrays),
6805
7012
  mapped = arrayMap(arrays, castArrayLikeObject);
6806
7013
 
@@ -6810,7 +7017,7 @@
6810
7017
  mapped.pop();
6811
7018
  }
6812
7019
  return (mapped.length && mapped[0] === arrays[0])
6813
- ? baseIntersection(mapped, getIteratee(iteratee))
7020
+ ? baseIntersection(mapped, getIteratee(iteratee, 2))
6814
7021
  : [];
6815
7022
  });
6816
7023
 
@@ -6835,7 +7042,7 @@
6835
7042
  * _.intersectionWith(objects, others, _.isEqual);
6836
7043
  * // => [{ 'x': 1, 'y': 2 }]
6837
7044
  */
6838
- var intersectionWith = rest(function(arrays) {
7045
+ var intersectionWith = baseRest(function(arrays) {
6839
7046
  var comparator = last(arrays),
6840
7047
  mapped = arrayMap(arrays, castArrayLikeObject);
6841
7048
 
@@ -6923,7 +7130,7 @@
6923
7130
  ) + 1;
6924
7131
  }
6925
7132
  if (value !== value) {
6926
- return indexOfNaN(array, index - 1, true);
7133
+ return baseFindIndex(array, baseIsNaN, index - 1, true);
6927
7134
  }
6928
7135
  while (index--) {
6929
7136
  if (array[index] === value) {
@@ -6981,7 +7188,7 @@
6981
7188
  * console.log(array);
6982
7189
  * // => ['b', 'b']
6983
7190
  */
6984
- var pull = rest(pullAll);
7191
+ var pull = baseRest(pullAll);
6985
7192
 
6986
7193
  /**
6987
7194
  * This method is like `_.pull` except that it accepts an array of values to remove.
@@ -7022,7 +7229,7 @@
7022
7229
  * @category Array
7023
7230
  * @param {Array} array The array to modify.
7024
7231
  * @param {Array} values The values to remove.
7025
- * @param {Array|Function|Object|string} [iteratee=_.identity]
7232
+ * @param {Function} [iteratee=_.identity]
7026
7233
  * The iteratee invoked per element.
7027
7234
  * @returns {Array} Returns `array`.
7028
7235
  * @example
@@ -7035,7 +7242,7 @@
7035
7242
  */
7036
7243
  function pullAllBy(array, values, iteratee) {
7037
7244
  return (array && array.length && values && values.length)
7038
- ? basePullAll(array, values, getIteratee(iteratee))
7245
+ ? basePullAll(array, values, getIteratee(iteratee, 2))
7039
7246
  : array;
7040
7247
  }
7041
7248
 
@@ -7092,7 +7299,7 @@
7092
7299
  * console.log(pulled);
7093
7300
  * // => ['b', 'd']
7094
7301
  */
7095
- var pullAt = rest(function(array, indexes) {
7302
+ var pullAt = baseRest(function(array, indexes) {
7096
7303
  indexes = baseFlatten(indexes, 1);
7097
7304
 
7098
7305
  var length = array ? array.length : 0,
@@ -7118,7 +7325,7 @@
7118
7325
  * @since 2.0.0
7119
7326
  * @category Array
7120
7327
  * @param {Array} array The array to modify.
7121
- * @param {Array|Function|Object|string} [predicate=_.identity]
7328
+ * @param {Function} [predicate=_.identity]
7122
7329
  * The function invoked per iteration.
7123
7330
  * @returns {Array} Returns the new array of removed elements.
7124
7331
  * @example
@@ -7246,7 +7453,7 @@
7246
7453
  * @category Array
7247
7454
  * @param {Array} array The sorted array to inspect.
7248
7455
  * @param {*} value The value to evaluate.
7249
- * @param {Array|Function|Object|string} [iteratee=_.identity]
7456
+ * @param {Function} [iteratee=_.identity]
7250
7457
  * The iteratee invoked per element.
7251
7458
  * @returns {number} Returns the index at which `value` should be inserted
7252
7459
  * into `array`.
@@ -7262,7 +7469,7 @@
7262
7469
  * // => 0
7263
7470
  */
7264
7471
  function sortedIndexBy(array, value, iteratee) {
7265
- return baseSortedIndexBy(array, value, getIteratee(iteratee));
7472
+ return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
7266
7473
  }
7267
7474
 
7268
7475
  /**
@@ -7325,7 +7532,7 @@
7325
7532
  * @category Array
7326
7533
  * @param {Array} array The sorted array to inspect.
7327
7534
  * @param {*} value The value to evaluate.
7328
- * @param {Array|Function|Object|string} [iteratee=_.identity]
7535
+ * @param {Function} [iteratee=_.identity]
7329
7536
  * The iteratee invoked per element.
7330
7537
  * @returns {number} Returns the index at which `value` should be inserted
7331
7538
  * into `array`.
@@ -7341,7 +7548,7 @@
7341
7548
  * // => 1
7342
7549
  */
7343
7550
  function sortedLastIndexBy(array, value, iteratee) {
7344
- return baseSortedIndexBy(array, value, getIteratee(iteratee), true);
7551
+ return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
7345
7552
  }
7346
7553
 
7347
7554
  /**
@@ -7410,7 +7617,7 @@
7410
7617
  */
7411
7618
  function sortedUniqBy(array, iteratee) {
7412
7619
  return (array && array.length)
7413
- ? baseSortedUniq(array, getIteratee(iteratee))
7620
+ ? baseSortedUniq(array, getIteratee(iteratee, 2))
7414
7621
  : [];
7415
7622
  }
7416
7623
 
@@ -7510,7 +7717,7 @@
7510
7717
  * @since 3.0.0
7511
7718
  * @category Array
7512
7719
  * @param {Array} array The array to query.
7513
- * @param {Array|Function|Object|string} [predicate=_.identity]
7720
+ * @param {Function} [predicate=_.identity]
7514
7721
  * The function invoked per iteration.
7515
7722
  * @returns {Array} Returns the slice of `array`.
7516
7723
  * @example
@@ -7552,7 +7759,7 @@
7552
7759
  * @since 3.0.0
7553
7760
  * @category Array
7554
7761
  * @param {Array} array The array to query.
7555
- * @param {Array|Function|Object|string} [predicate=_.identity]
7762
+ * @param {Function} [predicate=_.identity]
7556
7763
  * The function invoked per iteration.
7557
7764
  * @returns {Array} Returns the slice of `array`.
7558
7765
  * @example
@@ -7600,14 +7807,15 @@
7600
7807
  * _.union([2], [1, 2]);
7601
7808
  * // => [2, 1]
7602
7809
  */
7603
- var union = rest(function(arrays) {
7810
+ var union = baseRest(function(arrays) {
7604
7811
  return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
7605
7812
  });
7606
7813
 
7607
7814
  /**
7608
7815
  * This method is like `_.union` except that it accepts `iteratee` which is
7609
7816
  * invoked for each element of each `arrays` to generate the criterion by
7610
- * which uniqueness is computed. The iteratee is invoked with one argument:
7817
+ * which uniqueness is computed. Result values are chosen from the first
7818
+ * array in which the value occurs. The iteratee is invoked with one argument:
7611
7819
  * (value).
7612
7820
  *
7613
7821
  * @static
@@ -7615,7 +7823,7 @@
7615
7823
  * @since 4.0.0
7616
7824
  * @category Array
7617
7825
  * @param {...Array} [arrays] The arrays to inspect.
7618
- * @param {Array|Function|Object|string} [iteratee=_.identity]
7826
+ * @param {Function} [iteratee=_.identity]
7619
7827
  * The iteratee invoked per element.
7620
7828
  * @returns {Array} Returns the new array of combined values.
7621
7829
  * @example
@@ -7627,17 +7835,18 @@
7627
7835
  * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
7628
7836
  * // => [{ 'x': 1 }, { 'x': 2 }]
7629
7837
  */
7630
- var unionBy = rest(function(arrays) {
7838
+ var unionBy = baseRest(function(arrays) {
7631
7839
  var iteratee = last(arrays);
7632
7840
  if (isArrayLikeObject(iteratee)) {
7633
7841
  iteratee = undefined;
7634
7842
  }
7635
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee));
7843
+ return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
7636
7844
  });
7637
7845
 
7638
7846
  /**
7639
7847
  * This method is like `_.union` except that it accepts `comparator` which
7640
- * is invoked to compare elements of `arrays`. The comparator is invoked
7848
+ * is invoked to compare elements of `arrays`. Result values are chosen from
7849
+ * the first array in which the value occurs. The comparator is invoked
7641
7850
  * with two arguments: (arrVal, othVal).
7642
7851
  *
7643
7852
  * @static
@@ -7655,7 +7864,7 @@
7655
7864
  * _.unionWith(objects, others, _.isEqual);
7656
7865
  * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
7657
7866
  */
7658
- var unionWith = rest(function(arrays) {
7867
+ var unionWith = baseRest(function(arrays) {
7659
7868
  var comparator = last(arrays);
7660
7869
  if (isArrayLikeObject(comparator)) {
7661
7870
  comparator = undefined;
@@ -7696,7 +7905,7 @@
7696
7905
  * @since 4.0.0
7697
7906
  * @category Array
7698
7907
  * @param {Array} array The array to inspect.
7699
- * @param {Array|Function|Object|string} [iteratee=_.identity]
7908
+ * @param {Function} [iteratee=_.identity]
7700
7909
  * The iteratee invoked per element.
7701
7910
  * @returns {Array} Returns the new duplicate free array.
7702
7911
  * @example
@@ -7710,7 +7919,7 @@
7710
7919
  */
7711
7920
  function uniqBy(array, iteratee) {
7712
7921
  return (array && array.length)
7713
- ? baseUniq(array, getIteratee(iteratee))
7922
+ ? baseUniq(array, getIteratee(iteratee, 2))
7714
7923
  : [];
7715
7924
  }
7716
7925
 
@@ -7752,11 +7961,11 @@
7752
7961
  * @returns {Array} Returns the new array of regrouped elements.
7753
7962
  * @example
7754
7963
  *
7755
- * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
7756
- * // => [['fred', 30, true], ['barney', 40, false]]
7964
+ * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
7965
+ * // => [['a', 1, true], ['b', 2, false]]
7757
7966
  *
7758
7967
  * _.unzip(zipped);
7759
- * // => [['fred', 'barney'], [30, 40], [true, false]]
7968
+ * // => [['a', 'b'], [1, 2], [true, false]]
7760
7969
  */
7761
7970
  function unzip(array) {
7762
7971
  if (!(array && array.length)) {
@@ -7813,6 +8022,8 @@
7813
8022
  * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
7814
8023
  * for equality comparisons.
7815
8024
  *
8025
+ * **Note:** Unlike `_.pull`, this method returns a new array.
8026
+ *
7816
8027
  * @static
7817
8028
  * @memberOf _
7818
8029
  * @since 0.1.0
@@ -7826,7 +8037,7 @@
7826
8037
  * _.without([2, 1, 2, 3], 1, 2);
7827
8038
  * // => [3]
7828
8039
  */
7829
- var without = rest(function(array, values) {
8040
+ var without = baseRest(function(array, values) {
7830
8041
  return isArrayLikeObject(array)
7831
8042
  ? baseDifference(array, values)
7832
8043
  : [];
@@ -7850,7 +8061,7 @@
7850
8061
  * _.xor([2, 1], [2, 3]);
7851
8062
  * // => [1, 3]
7852
8063
  */
7853
- var xor = rest(function(arrays) {
8064
+ var xor = baseRest(function(arrays) {
7854
8065
  return baseXor(arrayFilter(arrays, isArrayLikeObject));
7855
8066
  });
7856
8067
 
@@ -7865,7 +8076,7 @@
7865
8076
  * @since 4.0.0
7866
8077
  * @category Array
7867
8078
  * @param {...Array} [arrays] The arrays to inspect.
7868
- * @param {Array|Function|Object|string} [iteratee=_.identity]
8079
+ * @param {Function} [iteratee=_.identity]
7869
8080
  * The iteratee invoked per element.
7870
8081
  * @returns {Array} Returns the new array of filtered values.
7871
8082
  * @example
@@ -7877,12 +8088,12 @@
7877
8088
  * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
7878
8089
  * // => [{ 'x': 2 }]
7879
8090
  */
7880
- var xorBy = rest(function(arrays) {
8091
+ var xorBy = baseRest(function(arrays) {
7881
8092
  var iteratee = last(arrays);
7882
8093
  if (isArrayLikeObject(iteratee)) {
7883
8094
  iteratee = undefined;
7884
8095
  }
7885
- return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee));
8096
+ return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
7886
8097
  });
7887
8098
 
7888
8099
  /**
@@ -7905,7 +8116,7 @@
7905
8116
  * _.xorWith(objects, others, _.isEqual);
7906
8117
  * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
7907
8118
  */
7908
- var xorWith = rest(function(arrays) {
8119
+ var xorWith = baseRest(function(arrays) {
7909
8120
  var comparator = last(arrays);
7910
8121
  if (isArrayLikeObject(comparator)) {
7911
8122
  comparator = undefined;
@@ -7926,10 +8137,10 @@
7926
8137
  * @returns {Array} Returns the new array of grouped elements.
7927
8138
  * @example
7928
8139
  *
7929
- * _.zip(['fred', 'barney'], [30, 40], [true, false]);
7930
- * // => [['fred', 30, true], ['barney', 40, false]]
8140
+ * _.zip(['a', 'b'], [1, 2], [true, false]);
8141
+ * // => [['a', 1, true], ['b', 2, false]]
7931
8142
  */
7932
- var zip = rest(unzip);
8143
+ var zip = baseRest(unzip);
7933
8144
 
7934
8145
  /**
7935
8146
  * This method is like `_.fromPairs` except that it accepts two arrays,
@@ -7989,7 +8200,7 @@
7989
8200
  * });
7990
8201
  * // => [111, 222]
7991
8202
  */
7992
- var zipWith = rest(function(arrays) {
8203
+ var zipWith = baseRest(function(arrays) {
7993
8204
  var length = arrays.length,
7994
8205
  iteratee = length > 1 ? arrays[length - 1] : undefined;
7995
8206
 
@@ -8105,7 +8316,7 @@
8105
8316
  * _(object).at(['a[0].b.c', 'a[1]']).value();
8106
8317
  * // => [3, 4]
8107
8318
  */
8108
- var wrapperAt = rest(function(paths) {
8319
+ var wrapperAt = baseRest(function(paths) {
8109
8320
  paths = baseFlatten(paths, 1);
8110
8321
  var length = paths.length,
8111
8322
  start = length ? paths[0] : 0,
@@ -8358,7 +8569,7 @@
8358
8569
  * @since 0.5.0
8359
8570
  * @category Collection
8360
8571
  * @param {Array|Object} collection The collection to iterate over.
8361
- * @param {Array|Function|Object|string} [iteratee=_.identity]
8572
+ * @param {Function} [iteratee=_.identity]
8362
8573
  * The iteratee to transform keys.
8363
8574
  * @returns {Object} Returns the composed aggregate object.
8364
8575
  * @example
@@ -8384,7 +8595,7 @@
8384
8595
  * @since 0.1.0
8385
8596
  * @category Collection
8386
8597
  * @param {Array|Object} collection The collection to iterate over.
8387
- * @param {Array|Function|Object|string} [predicate=_.identity]
8598
+ * @param {Function} [predicate=_.identity]
8388
8599
  * The function invoked per iteration.
8389
8600
  * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
8390
8601
  * @returns {boolean} Returns `true` if all elements pass the predicate check,
@@ -8424,12 +8635,14 @@
8424
8635
  * `predicate` returns truthy for. The predicate is invoked with three
8425
8636
  * arguments: (value, index|key, collection).
8426
8637
  *
8638
+ * **Note:** Unlike `_.remove`, this method returns a new array.
8639
+ *
8427
8640
  * @static
8428
8641
  * @memberOf _
8429
8642
  * @since 0.1.0
8430
8643
  * @category Collection
8431
8644
  * @param {Array|Object} collection The collection to iterate over.
8432
- * @param {Array|Function|Object|string} [predicate=_.identity]
8645
+ * @param {Function} [predicate=_.identity]
8433
8646
  * The function invoked per iteration.
8434
8647
  * @returns {Array} Returns the new filtered array.
8435
8648
  * @see _.reject
@@ -8470,7 +8683,7 @@
8470
8683
  * @since 0.1.0
8471
8684
  * @category Collection
8472
8685
  * @param {Array|Object} collection The collection to search.
8473
- * @param {Array|Function|Object|string} [predicate=_.identity]
8686
+ * @param {Function} [predicate=_.identity]
8474
8687
  * The function invoked per iteration.
8475
8688
  * @param {number} [fromIndex=0] The index to search from.
8476
8689
  * @returns {*} Returns the matched element, else `undefined`.
@@ -8508,7 +8721,7 @@
8508
8721
  * @since 2.0.0
8509
8722
  * @category Collection
8510
8723
  * @param {Array|Object} collection The collection to search.
8511
- * @param {Array|Function|Object|string} [predicate=_.identity]
8724
+ * @param {Function} [predicate=_.identity]
8512
8725
  * The function invoked per iteration.
8513
8726
  * @param {number} [fromIndex=collection.length-1] The index to search from.
8514
8727
  * @returns {*} Returns the matched element, else `undefined`.
@@ -8531,7 +8744,7 @@
8531
8744
  * @since 4.0.0
8532
8745
  * @category Collection
8533
8746
  * @param {Array|Object} collection The collection to iterate over.
8534
- * @param {Array|Function|Object|string} [iteratee=_.identity]
8747
+ * @param {Function} [iteratee=_.identity]
8535
8748
  * The function invoked per iteration.
8536
8749
  * @returns {Array} Returns the new flattened array.
8537
8750
  * @example
@@ -8556,7 +8769,7 @@
8556
8769
  * @since 4.7.0
8557
8770
  * @category Collection
8558
8771
  * @param {Array|Object} collection The collection to iterate over.
8559
- * @param {Array|Function|Object|string} [iteratee=_.identity]
8772
+ * @param {Function} [iteratee=_.identity]
8560
8773
  * The function invoked per iteration.
8561
8774
  * @returns {Array} Returns the new flattened array.
8562
8775
  * @example
@@ -8581,7 +8794,7 @@
8581
8794
  * @since 4.7.0
8582
8795
  * @category Collection
8583
8796
  * @param {Array|Object} collection The collection to iterate over.
8584
- * @param {Array|Function|Object|string} [iteratee=_.identity]
8797
+ * @param {Function} [iteratee=_.identity]
8585
8798
  * The function invoked per iteration.
8586
8799
  * @param {number} [depth=1] The maximum recursion depth.
8587
8800
  * @returns {Array} Returns the new flattened array.
@@ -8671,7 +8884,7 @@
8671
8884
  * @since 0.1.0
8672
8885
  * @category Collection
8673
8886
  * @param {Array|Object} collection The collection to iterate over.
8674
- * @param {Array|Function|Object|string} [iteratee=_.identity]
8887
+ * @param {Function} [iteratee=_.identity]
8675
8888
  * The iteratee to transform keys.
8676
8889
  * @returns {Object} Returns the composed aggregate object.
8677
8890
  * @example
@@ -8715,10 +8928,10 @@
8715
8928
  * _.includes([1, 2, 3], 1, 2);
8716
8929
  * // => false
8717
8930
  *
8718
- * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
8931
+ * _.includes({ 'a': 1, 'b': 2 }, 1);
8719
8932
  * // => true
8720
8933
  *
8721
- * _.includes('pebbles', 'eb');
8934
+ * _.includes('abcd', 'bc');
8722
8935
  * // => true
8723
8936
  */
8724
8937
  function includes(collection, value, fromIndex, guard) {
@@ -8737,8 +8950,8 @@
8737
8950
  /**
8738
8951
  * Invokes the method at `path` of each element in `collection`, returning
8739
8952
  * an array of the results of each invoked method. Any additional arguments
8740
- * are provided to each invoked method. If `methodName` is a function, it's
8741
- * invoked for and `this` bound to, each element in `collection`.
8953
+ * are provided to each invoked method. If `path` is a function, it's invoked
8954
+ * for, and `this` bound to, each element in `collection`.
8742
8955
  *
8743
8956
  * @static
8744
8957
  * @memberOf _
@@ -8757,7 +8970,7 @@
8757
8970
  * _.invokeMap([123, 456], String.prototype.split, '');
8758
8971
  * // => [['1', '2', '3'], ['4', '5', '6']]
8759
8972
  */
8760
- var invokeMap = rest(function(collection, path, args) {
8973
+ var invokeMap = baseRest(function(collection, path, args) {
8761
8974
  var index = -1,
8762
8975
  isFunc = typeof path == 'function',
8763
8976
  isProp = isKey(path),
@@ -8781,7 +8994,7 @@
8781
8994
  * @since 4.0.0
8782
8995
  * @category Collection
8783
8996
  * @param {Array|Object} collection The collection to iterate over.
8784
- * @param {Array|Function|Object|string} [iteratee=_.identity]
8997
+ * @param {Function} [iteratee=_.identity]
8785
8998
  * The iteratee to transform keys.
8786
8999
  * @returns {Object} Returns the composed aggregate object.
8787
9000
  * @example
@@ -8822,8 +9035,7 @@
8822
9035
  * @since 0.1.0
8823
9036
  * @category Collection
8824
9037
  * @param {Array|Object} collection The collection to iterate over.
8825
- * @param {Array|Function|Object|string} [iteratee=_.identity]
8826
- * The function invoked per iteration.
9038
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
8827
9039
  * @returns {Array} Returns the new mapped array.
8828
9040
  * @example
8829
9041
  *
@@ -8905,8 +9117,7 @@
8905
9117
  * @since 3.0.0
8906
9118
  * @category Collection
8907
9119
  * @param {Array|Object} collection The collection to iterate over.
8908
- * @param {Array|Function|Object|string} [predicate=_.identity]
8909
- * The function invoked per iteration.
9120
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
8910
9121
  * @returns {Array} Returns the array of grouped elements.
8911
9122
  * @example
8912
9123
  *
@@ -9017,8 +9228,7 @@
9017
9228
  * @since 0.1.0
9018
9229
  * @category Collection
9019
9230
  * @param {Array|Object} collection The collection to iterate over.
9020
- * @param {Array|Function|Object|string} [predicate=_.identity]
9021
- * The function invoked per iteration.
9231
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
9022
9232
  * @returns {Array} Returns the new filtered array.
9023
9233
  * @see _.filter
9024
9234
  * @example
@@ -9045,10 +9255,7 @@
9045
9255
  */
9046
9256
  function reject(collection, predicate) {
9047
9257
  var func = isArray(collection) ? arrayFilter : baseFilter;
9048
- predicate = getIteratee(predicate, 3);
9049
- return func(collection, function(value, index, collection) {
9050
- return !predicate(value, index, collection);
9051
- });
9258
+ return func(collection, negate(getIteratee(predicate, 3)));
9052
9259
  }
9053
9260
 
9054
9261
  /**
@@ -9181,8 +9388,7 @@
9181
9388
  * @since 0.1.0
9182
9389
  * @category Collection
9183
9390
  * @param {Array|Object} collection The collection to iterate over.
9184
- * @param {Array|Function|Object|string} [predicate=_.identity]
9185
- * The function invoked per iteration.
9391
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
9186
9392
  * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
9187
9393
  * @returns {boolean} Returns `true` if any element passes the predicate check,
9188
9394
  * else `false`.
@@ -9227,8 +9433,8 @@
9227
9433
  * @since 0.1.0
9228
9434
  * @category Collection
9229
9435
  * @param {Array|Object} collection The collection to iterate over.
9230
- * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
9231
- * [iteratees=[_.identity]] The iteratees to sort by.
9436
+ * @param {...(Function|Function[])} [iteratees=[_.identity]]
9437
+ * The iteratees to sort by.
9232
9438
  * @returns {Array} Returns the new sorted array.
9233
9439
  * @example
9234
9440
  *
@@ -9250,7 +9456,7 @@
9250
9456
  * });
9251
9457
  * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
9252
9458
  */
9253
- var sortBy = rest(function(collection, iteratees) {
9459
+ var sortBy = baseRest(function(collection, iteratees) {
9254
9460
  if (collection == null) {
9255
9461
  return [];
9256
9462
  }
@@ -9260,11 +9466,7 @@
9260
9466
  } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
9261
9467
  iteratees = [iteratees[0]];
9262
9468
  }
9263
- iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
9264
- ? iteratees[0]
9265
- : baseFlatten(iteratees, 1, isFlattenableIteratee);
9266
-
9267
- return baseOrderBy(collection, iteratees, []);
9469
+ return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
9268
9470
  });
9269
9471
 
9270
9472
  /*------------------------------------------------------------------------*/
@@ -9347,7 +9549,7 @@
9347
9549
  function ary(func, n, guard) {
9348
9550
  n = guard ? undefined : n;
9349
9551
  n = (func && n == null) ? func.length : n;
9350
- return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
9552
+ return createWrap(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
9351
9553
  }
9352
9554
 
9353
9555
  /**
@@ -9365,7 +9567,7 @@
9365
9567
  * @example
9366
9568
  *
9367
9569
  * jQuery(element).on('click', _.before(5, addContactToList));
9368
- * // => allows adding up to 4 contacts to the list
9570
+ * // => Allows adding up to 4 contacts to the list.
9369
9571
  */
9370
9572
  function before(n, func) {
9371
9573
  var result;
@@ -9404,9 +9606,9 @@
9404
9606
  * @returns {Function} Returns the new bound function.
9405
9607
  * @example
9406
9608
  *
9407
- * var greet = function(greeting, punctuation) {
9609
+ * function greet(greeting, punctuation) {
9408
9610
  * return greeting + ' ' + this.user + punctuation;
9409
- * };
9611
+ * }
9410
9612
  *
9411
9613
  * var object = { 'user': 'fred' };
9412
9614
  *
@@ -9419,13 +9621,13 @@
9419
9621
  * bound('hi');
9420
9622
  * // => 'hi fred!'
9421
9623
  */
9422
- var bind = rest(function(func, thisArg, partials) {
9624
+ var bind = baseRest(function(func, thisArg, partials) {
9423
9625
  var bitmask = BIND_FLAG;
9424
9626
  if (partials.length) {
9425
9627
  var holders = replaceHolders(partials, getHolder(bind));
9426
9628
  bitmask |= PARTIAL_FLAG;
9427
9629
  }
9428
- return createWrapper(func, bitmask, thisArg, partials, holders);
9630
+ return createWrap(func, bitmask, thisArg, partials, holders);
9429
9631
  });
9430
9632
 
9431
9633
  /**
@@ -9473,13 +9675,13 @@
9473
9675
  * bound('hi');
9474
9676
  * // => 'hiya fred!'
9475
9677
  */
9476
- var bindKey = rest(function(object, key, partials) {
9678
+ var bindKey = baseRest(function(object, key, partials) {
9477
9679
  var bitmask = BIND_FLAG | BIND_KEY_FLAG;
9478
9680
  if (partials.length) {
9479
9681
  var holders = replaceHolders(partials, getHolder(bindKey));
9480
9682
  bitmask |= PARTIAL_FLAG;
9481
9683
  }
9482
- return createWrapper(key, bitmask, object, partials, holders);
9684
+ return createWrap(key, bitmask, object, partials, holders);
9483
9685
  });
9484
9686
 
9485
9687
  /**
@@ -9525,7 +9727,7 @@
9525
9727
  */
9526
9728
  function curry(func, arity, guard) {
9527
9729
  arity = guard ? undefined : arity;
9528
- var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
9730
+ var result = createWrap(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
9529
9731
  result.placeholder = curry.placeholder;
9530
9732
  return result;
9531
9733
  }
@@ -9570,7 +9772,7 @@
9570
9772
  */
9571
9773
  function curryRight(func, arity, guard) {
9572
9774
  arity = guard ? undefined : arity;
9573
- var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
9775
+ var result = createWrap(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
9574
9776
  result.placeholder = curryRight.placeholder;
9575
9777
  return result;
9576
9778
  }
@@ -9580,14 +9782,18 @@
9580
9782
  * milliseconds have elapsed since the last time the debounced function was
9581
9783
  * invoked. The debounced function comes with a `cancel` method to cancel
9582
9784
  * delayed `func` invocations and a `flush` method to immediately invoke them.
9583
- * Provide an options object to indicate whether `func` should be invoked on
9584
- * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
9585
- * with the last arguments provided to the debounced function. Subsequent calls
9586
- * to the debounced function return the result of the last `func` invocation.
9785
+ * Provide `options` to indicate whether `func` should be invoked on the
9786
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
9787
+ * with the last arguments provided to the debounced function. Subsequent
9788
+ * calls to the debounced function return the result of the last `func`
9789
+ * invocation.
9587
9790
  *
9588
- * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
9589
- * on the trailing edge of the timeout only if the debounced function is
9590
- * invoked more than once during the `wait` timeout.
9791
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
9792
+ * invoked on the trailing edge of the timeout only if the debounced function
9793
+ * is invoked more than once during the `wait` timeout.
9794
+ *
9795
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
9796
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
9591
9797
  *
9592
9798
  * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
9593
9799
  * for details over the differences between `_.debounce` and `_.throttle`.
@@ -9708,6 +9914,9 @@
9708
9914
  }
9709
9915
 
9710
9916
  function cancel() {
9917
+ if (timerId !== undefined) {
9918
+ clearTimeout(timerId);
9919
+ }
9711
9920
  lastInvokeTime = 0;
9712
9921
  lastArgs = lastCallTime = lastThis = timerId = undefined;
9713
9922
  }
@@ -9762,7 +9971,7 @@
9762
9971
  * }, 'deferred');
9763
9972
  * // => Logs 'deferred' after one or more milliseconds.
9764
9973
  */
9765
- var defer = rest(function(func, args) {
9974
+ var defer = baseRest(function(func, args) {
9766
9975
  return baseDelay(func, 1, args);
9767
9976
  });
9768
9977
 
@@ -9785,7 +9994,7 @@
9785
9994
  * }, 1000, 'later');
9786
9995
  * // => Logs 'later' after one second.
9787
9996
  */
9788
- var delay = rest(function(func, wait, args) {
9997
+ var delay = baseRest(function(func, wait, args) {
9789
9998
  return baseDelay(func, toNumber(wait) || 0, args);
9790
9999
  });
9791
10000
 
@@ -9808,7 +10017,7 @@
9808
10017
  * // => ['d', 'c', 'b', 'a']
9809
10018
  */
9810
10019
  function flip(func) {
9811
- return createWrapper(func, FLIP_FLAG);
10020
+ return createWrap(func, FLIP_FLAG);
9812
10021
  }
9813
10022
 
9814
10023
  /**
@@ -9903,7 +10112,14 @@
9903
10112
  throw new TypeError(FUNC_ERROR_TEXT);
9904
10113
  }
9905
10114
  return function() {
9906
- return !predicate.apply(this, arguments);
10115
+ var args = arguments;
10116
+ switch (args.length) {
10117
+ case 0: return !predicate.call(this);
10118
+ case 1: return !predicate.call(this, args[0]);
10119
+ case 2: return !predicate.call(this, args[0], args[1]);
10120
+ case 3: return !predicate.call(this, args[0], args[1], args[2]);
10121
+ }
10122
+ return !predicate.apply(this, args);
9907
10123
  };
9908
10124
  }
9909
10125
 
@@ -9923,23 +10139,22 @@
9923
10139
  * var initialize = _.once(createApplication);
9924
10140
  * initialize();
9925
10141
  * initialize();
9926
- * // `initialize` invokes `createApplication` once
10142
+ * // => `createApplication` is invoked once
9927
10143
  */
9928
10144
  function once(func) {
9929
10145
  return before(2, func);
9930
10146
  }
9931
10147
 
9932
10148
  /**
9933
- * Creates a function that invokes `func` with arguments transformed by
9934
- * corresponding `transforms`.
10149
+ * Creates a function that invokes `func` with its arguments transformed.
9935
10150
  *
9936
10151
  * @static
9937
10152
  * @since 4.0.0
9938
10153
  * @memberOf _
9939
10154
  * @category Function
9940
10155
  * @param {Function} func The function to wrap.
9941
- * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
9942
- * [transforms[_.identity]] The functions to transform.
10156
+ * @param {...(Function|Function[])} [transforms=[_.identity]]
10157
+ * The argument transforms.
9943
10158
  * @returns {Function} Returns the new function.
9944
10159
  * @example
9945
10160
  *
@@ -9961,13 +10176,13 @@
9961
10176
  * func(10, 5);
9962
10177
  * // => [100, 10]
9963
10178
  */
9964
- var overArgs = rest(function(func, transforms) {
10179
+ var overArgs = baseRest(function(func, transforms) {
9965
10180
  transforms = (transforms.length == 1 && isArray(transforms[0]))
9966
10181
  ? arrayMap(transforms[0], baseUnary(getIteratee()))
9967
- : arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), baseUnary(getIteratee()));
10182
+ : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
9968
10183
 
9969
10184
  var funcsLength = transforms.length;
9970
- return rest(function(args) {
10185
+ return baseRest(function(args) {
9971
10186
  var index = -1,
9972
10187
  length = nativeMin(args.length, funcsLength);
9973
10188
 
@@ -9998,9 +10213,9 @@
9998
10213
  * @returns {Function} Returns the new partially applied function.
9999
10214
  * @example
10000
10215
  *
10001
- * var greet = function(greeting, name) {
10216
+ * function greet(greeting, name) {
10002
10217
  * return greeting + ' ' + name;
10003
- * };
10218
+ * }
10004
10219
  *
10005
10220
  * var sayHelloTo = _.partial(greet, 'hello');
10006
10221
  * sayHelloTo('fred');
@@ -10011,9 +10226,9 @@
10011
10226
  * greetFred('hi');
10012
10227
  * // => 'hi fred'
10013
10228
  */
10014
- var partial = rest(function(func, partials) {
10229
+ var partial = baseRest(function(func, partials) {
10015
10230
  var holders = replaceHolders(partials, getHolder(partial));
10016
- return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
10231
+ return createWrap(func, PARTIAL_FLAG, undefined, partials, holders);
10017
10232
  });
10018
10233
 
10019
10234
  /**
@@ -10035,9 +10250,9 @@
10035
10250
  * @returns {Function} Returns the new partially applied function.
10036
10251
  * @example
10037
10252
  *
10038
- * var greet = function(greeting, name) {
10253
+ * function greet(greeting, name) {
10039
10254
  * return greeting + ' ' + name;
10040
- * };
10255
+ * }
10041
10256
  *
10042
10257
  * var greetFred = _.partialRight(greet, 'fred');
10043
10258
  * greetFred('hi');
@@ -10048,9 +10263,9 @@
10048
10263
  * sayHelloTo('fred');
10049
10264
  * // => 'hello fred'
10050
10265
  */
10051
- var partialRight = rest(function(func, partials) {
10266
+ var partialRight = baseRest(function(func, partials) {
10052
10267
  var holders = replaceHolders(partials, getHolder(partialRight));
10053
- return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
10268
+ return createWrap(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
10054
10269
  });
10055
10270
 
10056
10271
  /**
@@ -10075,8 +10290,8 @@
10075
10290
  * rearged('b', 'c', 'a')
10076
10291
  * // => ['a', 'b', 'c']
10077
10292
  */
10078
- var rearg = rest(function(func, indexes) {
10079
- return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1));
10293
+ var rearg = baseRest(function(func, indexes) {
10294
+ return createWrap(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1));
10080
10295
  });
10081
10296
 
10082
10297
  /**
@@ -10108,29 +10323,8 @@
10108
10323
  if (typeof func != 'function') {
10109
10324
  throw new TypeError(FUNC_ERROR_TEXT);
10110
10325
  }
10111
- start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);
10112
- return function() {
10113
- var args = arguments,
10114
- index = -1,
10115
- length = nativeMax(args.length - start, 0),
10116
- array = Array(length);
10117
-
10118
- while (++index < length) {
10119
- array[index] = args[start + index];
10120
- }
10121
- switch (start) {
10122
- case 0: return func.call(this, array);
10123
- case 1: return func.call(this, args[0], array);
10124
- case 2: return func.call(this, args[0], args[1], array);
10125
- }
10126
- var otherArgs = Array(start + 1);
10127
- index = -1;
10128
- while (++index < start) {
10129
- otherArgs[index] = args[index];
10130
- }
10131
- otherArgs[start] = array;
10132
- return apply(func, this, otherArgs);
10133
- };
10326
+ start = start === undefined ? start : toInteger(start);
10327
+ return baseRest(func, start);
10134
10328
  }
10135
10329
 
10136
10330
  /**
@@ -10172,7 +10366,7 @@
10172
10366
  throw new TypeError(FUNC_ERROR_TEXT);
10173
10367
  }
10174
10368
  start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
10175
- return rest(function(args) {
10369
+ return baseRest(function(args) {
10176
10370
  var array = args[start],
10177
10371
  otherArgs = castSlice(args, 0, start);
10178
10372
 
@@ -10187,8 +10381,8 @@
10187
10381
  * Creates a throttled function that only invokes `func` at most once per
10188
10382
  * every `wait` milliseconds. The throttled function comes with a `cancel`
10189
10383
  * method to cancel delayed `func` invocations and a `flush` method to
10190
- * immediately invoke them. Provide an options object to indicate whether
10191
- * `func` should be invoked on the leading and/or trailing edge of the `wait`
10384
+ * immediately invoke them. Provide `options` to indicate whether `func`
10385
+ * should be invoked on the leading and/or trailing edge of the `wait`
10192
10386
  * timeout. The `func` is invoked with the last arguments provided to the
10193
10387
  * throttled function. Subsequent calls to the throttled function return the
10194
10388
  * result of the last `func` invocation.
@@ -10197,6 +10391,9 @@
10197
10391
  * invoked on the trailing edge of the timeout only if the throttled function
10198
10392
  * is invoked more than once during the `wait` timeout.
10199
10393
  *
10394
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
10395
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
10396
+ *
10200
10397
  * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
10201
10398
  * for details over the differences between `_.throttle` and `_.debounce`.
10202
10399
  *
@@ -10262,10 +10459,10 @@
10262
10459
  }
10263
10460
 
10264
10461
  /**
10265
- * Creates a function that provides `value` to the wrapper function as its
10266
- * first argument. Any additional arguments provided to the function are
10267
- * appended to those provided to the wrapper function. The wrapper is invoked
10268
- * with the `this` binding of the created function.
10462
+ * Creates a function that provides `value` to `wrapper` as its first
10463
+ * argument. Any additional arguments provided to the function are appended
10464
+ * to those provided to the `wrapper`. The wrapper is invoked with the `this`
10465
+ * binding of the created function.
10269
10466
  *
10270
10467
  * @static
10271
10468
  * @memberOf _
@@ -10450,6 +10647,34 @@
10450
10647
  return baseClone(value, true, true, customizer);
10451
10648
  }
10452
10649
 
10650
+ /**
10651
+ * Checks if `object` conforms to `source` by invoking the predicate
10652
+ * properties of `source` with the corresponding property values of `object`.
10653
+ *
10654
+ * **Note:** This method is equivalent to `_.conforms` when `source` is
10655
+ * partially applied.
10656
+ *
10657
+ * @static
10658
+ * @memberOf _
10659
+ * @since 4.14.0
10660
+ * @category Lang
10661
+ * @param {Object} object The object to inspect.
10662
+ * @param {Object} source The object of property predicates to conform to.
10663
+ * @returns {boolean} Returns `true` if `object` conforms, else `false`.
10664
+ * @example
10665
+ *
10666
+ * var object = { 'a': 1, 'b': 2 };
10667
+ *
10668
+ * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
10669
+ * // => true
10670
+ *
10671
+ * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
10672
+ * // => false
10673
+ */
10674
+ function conformsTo(object, source) {
10675
+ return source == null || baseConformsTo(object, source, keys(source));
10676
+ }
10677
+
10453
10678
  /**
10454
10679
  * Performs a
10455
10680
  * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
@@ -10464,8 +10689,8 @@
10464
10689
  * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
10465
10690
  * @example
10466
10691
  *
10467
- * var object = { 'user': 'fred' };
10468
- * var other = { 'user': 'fred' };
10692
+ * var object = { 'a': 1 };
10693
+ * var other = { 'a': 1 };
10469
10694
  *
10470
10695
  * _.eq(object, object);
10471
10696
  * // => true
@@ -10546,7 +10771,7 @@
10546
10771
  * @since 0.1.0
10547
10772
  * @category Lang
10548
10773
  * @param {*} value The value to check.
10549
- * @returns {boolean} Returns `true` if `value` is correctly classified,
10774
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
10550
10775
  * else `false`.
10551
10776
  * @example
10552
10777
  *
@@ -10568,11 +10793,9 @@
10568
10793
  * @static
10569
10794
  * @memberOf _
10570
10795
  * @since 0.1.0
10571
- * @type {Function}
10572
10796
  * @category Lang
10573
10797
  * @param {*} value The value to check.
10574
- * @returns {boolean} Returns `true` if `value` is correctly classified,
10575
- * else `false`.
10798
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
10576
10799
  * @example
10577
10800
  *
10578
10801
  * _.isArray([1, 2, 3]);
@@ -10597,8 +10820,7 @@
10597
10820
  * @since 4.3.0
10598
10821
  * @category Lang
10599
10822
  * @param {*} value The value to check.
10600
- * @returns {boolean} Returns `true` if `value` is correctly classified,
10601
- * else `false`.
10823
+ * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
10602
10824
  * @example
10603
10825
  *
10604
10826
  * _.isArrayBuffer(new ArrayBuffer(2));
@@ -10607,9 +10829,7 @@
10607
10829
  * _.isArrayBuffer(new Array(2));
10608
10830
  * // => false
10609
10831
  */
10610
- function isArrayBuffer(value) {
10611
- return isObjectLike(value) && objectToString.call(value) == arrayBufferTag;
10612
- }
10832
+ var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
10613
10833
 
10614
10834
  /**
10615
10835
  * Checks if `value` is array-like. A value is considered array-like if it's
@@ -10677,8 +10897,7 @@
10677
10897
  * @since 0.1.0
10678
10898
  * @category Lang
10679
10899
  * @param {*} value The value to check.
10680
- * @returns {boolean} Returns `true` if `value` is correctly classified,
10681
- * else `false`.
10900
+ * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
10682
10901
  * @example
10683
10902
  *
10684
10903
  * _.isBoolean(false);
@@ -10709,9 +10928,7 @@
10709
10928
  * _.isBuffer(new Uint8Array(2));
10710
10929
  * // => false
10711
10930
  */
10712
- var isBuffer = !Buffer ? stubFalse : function(value) {
10713
- return value instanceof Buffer;
10714
- };
10931
+ var isBuffer = nativeIsBuffer || stubFalse;
10715
10932
 
10716
10933
  /**
10717
10934
  * Checks if `value` is classified as a `Date` object.
@@ -10721,8 +10938,7 @@
10721
10938
  * @since 0.1.0
10722
10939
  * @category Lang
10723
10940
  * @param {*} value The value to check.
10724
- * @returns {boolean} Returns `true` if `value` is correctly classified,
10725
- * else `false`.
10941
+ * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
10726
10942
  * @example
10727
10943
  *
10728
10944
  * _.isDate(new Date);
@@ -10731,9 +10947,7 @@
10731
10947
  * _.isDate('Mon April 23 2012');
10732
10948
  * // => false
10733
10949
  */
10734
- function isDate(value) {
10735
- return isObjectLike(value) && objectToString.call(value) == dateTag;
10736
- }
10950
+ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
10737
10951
 
10738
10952
  /**
10739
10953
  * Checks if `value` is likely a DOM element.
@@ -10830,8 +11044,8 @@
10830
11044
  * else `false`.
10831
11045
  * @example
10832
11046
  *
10833
- * var object = { 'user': 'fred' };
10834
- * var other = { 'user': 'fred' };
11047
+ * var object = { 'a': 1 };
11048
+ * var other = { 'a': 1 };
10835
11049
  *
10836
11050
  * _.isEqual(object, other);
10837
11051
  * // => true
@@ -10948,8 +11162,7 @@
10948
11162
  * @since 0.1.0
10949
11163
  * @category Lang
10950
11164
  * @param {*} value The value to check.
10951
- * @returns {boolean} Returns `true` if `value` is correctly classified,
10952
- * else `false`.
11165
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
10953
11166
  * @example
10954
11167
  *
10955
11168
  * _.isFunction(_);
@@ -11094,8 +11307,7 @@
11094
11307
  * @since 4.3.0
11095
11308
  * @category Lang
11096
11309
  * @param {*} value The value to check.
11097
- * @returns {boolean} Returns `true` if `value` is correctly classified,
11098
- * else `false`.
11310
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
11099
11311
  * @example
11100
11312
  *
11101
11313
  * _.isMap(new Map);
@@ -11104,16 +11316,14 @@
11104
11316
  * _.isMap(new WeakMap);
11105
11317
  * // => false
11106
11318
  */
11107
- function isMap(value) {
11108
- return isObjectLike(value) && getTag(value) == mapTag;
11109
- }
11319
+ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
11110
11320
 
11111
11321
  /**
11112
11322
  * Performs a partial deep comparison between `object` and `source` to
11113
- * determine if `object` contains equivalent property values. This method is
11114
- * equivalent to a `_.matches` function when `source` is partially applied.
11323
+ * determine if `object` contains equivalent property values.
11115
11324
  *
11116
- * **Note:** This method supports comparing the same values as `_.isEqual`.
11325
+ * **Note:** This method supports comparing the same values as `_.isEqual`
11326
+ * and is equivalent to `_.matches` when `source` is partially applied.
11117
11327
  *
11118
11328
  * @static
11119
11329
  * @memberOf _
@@ -11124,12 +11334,12 @@
11124
11334
  * @returns {boolean} Returns `true` if `object` is a match, else `false`.
11125
11335
  * @example
11126
11336
  *
11127
- * var object = { 'user': 'fred', 'age': 40 };
11337
+ * var object = { 'a': 1, 'b': 2 };
11128
11338
  *
11129
- * _.isMatch(object, { 'age': 40 });
11339
+ * _.isMatch(object, { 'b': 2 });
11130
11340
  * // => true
11131
11341
  *
11132
- * _.isMatch(object, { 'age': 36 });
11342
+ * _.isMatch(object, { 'b': 1 });
11133
11343
  * // => false
11134
11344
  */
11135
11345
  function isMatch(object, source) {
@@ -11211,13 +11421,13 @@
11211
11421
  /**
11212
11422
  * Checks if `value` is a pristine native function.
11213
11423
  *
11214
- * **Note:** This method can't reliably detect native functions in the
11215
- * presence of the `core-js` package because `core-js` circumvents this kind
11216
- * of detection. Despite multiple requests, the `core-js` maintainer has made
11217
- * it clear: any attempt to fix the detection will be obstructed. As a result,
11218
- * we're left with little choice but to throw an error. Unfortunately, this
11219
- * also affects packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
11220
- * which rely on `core-js`.
11424
+ * **Note:** This method can't reliably detect native functions in the presence
11425
+ * of the core-js package because core-js circumvents this kind of detection.
11426
+ * Despite multiple requests, the core-js maintainer has made it clear: any
11427
+ * attempt to fix the detection will be obstructed. As a result, we're left
11428
+ * with little choice but to throw an error. Unfortunately, this also affects
11429
+ * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
11430
+ * which rely on core-js.
11221
11431
  *
11222
11432
  * @static
11223
11433
  * @memberOf _
@@ -11236,7 +11446,7 @@
11236
11446
  */
11237
11447
  function isNative(value) {
11238
11448
  if (isMaskable(value)) {
11239
- throw new Error('This method is not supported with `core-js`. Try https://github.com/es-shims.');
11449
+ throw new Error('This method is not supported with core-js. Try https://github.com/es-shims.');
11240
11450
  }
11241
11451
  return baseIsNative(value);
11242
11452
  }
@@ -11297,8 +11507,7 @@
11297
11507
  * @since 0.1.0
11298
11508
  * @category Lang
11299
11509
  * @param {*} value The value to check.
11300
- * @returns {boolean} Returns `true` if `value` is correctly classified,
11301
- * else `false`.
11510
+ * @returns {boolean} Returns `true` if `value` is a number, else `false`.
11302
11511
  * @example
11303
11512
  *
11304
11513
  * _.isNumber(3);
@@ -11369,8 +11578,7 @@
11369
11578
  * @since 0.1.0
11370
11579
  * @category Lang
11371
11580
  * @param {*} value The value to check.
11372
- * @returns {boolean} Returns `true` if `value` is correctly classified,
11373
- * else `false`.
11581
+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
11374
11582
  * @example
11375
11583
  *
11376
11584
  * _.isRegExp(/abc/);
@@ -11379,9 +11587,7 @@
11379
11587
  * _.isRegExp('/abc/');
11380
11588
  * // => false
11381
11589
  */
11382
- function isRegExp(value) {
11383
- return isObject(value) && objectToString.call(value) == regexpTag;
11384
- }
11590
+ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
11385
11591
 
11386
11592
  /**
11387
11593
  * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
@@ -11423,8 +11629,7 @@
11423
11629
  * @since 4.3.0
11424
11630
  * @category Lang
11425
11631
  * @param {*} value The value to check.
11426
- * @returns {boolean} Returns `true` if `value` is correctly classified,
11427
- * else `false`.
11632
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
11428
11633
  * @example
11429
11634
  *
11430
11635
  * _.isSet(new Set);
@@ -11433,9 +11638,7 @@
11433
11638
  * _.isSet(new WeakSet);
11434
11639
  * // => false
11435
11640
  */
11436
- function isSet(value) {
11437
- return isObjectLike(value) && getTag(value) == setTag;
11438
- }
11641
+ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
11439
11642
 
11440
11643
  /**
11441
11644
  * Checks if `value` is classified as a `String` primitive or object.
@@ -11445,8 +11648,7 @@
11445
11648
  * @memberOf _
11446
11649
  * @category Lang
11447
11650
  * @param {*} value The value to check.
11448
- * @returns {boolean} Returns `true` if `value` is correctly classified,
11449
- * else `false`.
11651
+ * @returns {boolean} Returns `true` if `value` is a string, else `false`.
11450
11652
  * @example
11451
11653
  *
11452
11654
  * _.isString('abc');
@@ -11468,8 +11670,7 @@
11468
11670
  * @since 4.0.0
11469
11671
  * @category Lang
11470
11672
  * @param {*} value The value to check.
11471
- * @returns {boolean} Returns `true` if `value` is correctly classified,
11472
- * else `false`.
11673
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
11473
11674
  * @example
11474
11675
  *
11475
11676
  * _.isSymbol(Symbol.iterator);
@@ -11491,8 +11692,7 @@
11491
11692
  * @since 3.0.0
11492
11693
  * @category Lang
11493
11694
  * @param {*} value The value to check.
11494
- * @returns {boolean} Returns `true` if `value` is correctly classified,
11495
- * else `false`.
11695
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
11496
11696
  * @example
11497
11697
  *
11498
11698
  * _.isTypedArray(new Uint8Array);
@@ -11501,10 +11701,7 @@
11501
11701
  * _.isTypedArray([]);
11502
11702
  * // => false
11503
11703
  */
11504
- function isTypedArray(value) {
11505
- return isObjectLike(value) &&
11506
- isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
11507
- }
11704
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
11508
11705
 
11509
11706
  /**
11510
11707
  * Checks if `value` is `undefined`.
@@ -11535,8 +11732,7 @@
11535
11732
  * @since 4.3.0
11536
11733
  * @category Lang
11537
11734
  * @param {*} value The value to check.
11538
- * @returns {boolean} Returns `true` if `value` is correctly classified,
11539
- * else `false`.
11735
+ * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
11540
11736
  * @example
11541
11737
  *
11542
11738
  * _.isWeakMap(new WeakMap);
@@ -11557,8 +11753,7 @@
11557
11753
  * @since 4.3.0
11558
11754
  * @category Lang
11559
11755
  * @param {*} value The value to check.
11560
- * @returns {boolean} Returns `true` if `value` is correctly classified,
11561
- * else `false`.
11756
+ * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
11562
11757
  * @example
11563
11758
  *
11564
11759
  * _.isWeakSet(new WeakSet);
@@ -11907,18 +12102,18 @@
11907
12102
  * @example
11908
12103
  *
11909
12104
  * function Foo() {
11910
- * this.c = 3;
12105
+ * this.a = 1;
11911
12106
  * }
11912
12107
  *
11913
12108
  * function Bar() {
11914
- * this.e = 5;
12109
+ * this.c = 3;
11915
12110
  * }
11916
12111
  *
11917
- * Foo.prototype.d = 4;
11918
- * Bar.prototype.f = 6;
12112
+ * Foo.prototype.b = 2;
12113
+ * Bar.prototype.d = 4;
11919
12114
  *
11920
- * _.assign({ 'a': 1 }, new Foo, new Bar);
11921
- * // => { 'a': 1, 'c': 3, 'e': 5 }
12115
+ * _.assign({ 'a': 0 }, new Foo, new Bar);
12116
+ * // => { 'a': 1, 'c': 3 }
11922
12117
  */
11923
12118
  var assign = createAssigner(function(object, source) {
11924
12119
  if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
@@ -11950,18 +12145,18 @@
11950
12145
  * @example
11951
12146
  *
11952
12147
  * function Foo() {
11953
- * this.b = 2;
12148
+ * this.a = 1;
11954
12149
  * }
11955
12150
  *
11956
12151
  * function Bar() {
11957
- * this.d = 4;
12152
+ * this.c = 3;
11958
12153
  * }
11959
12154
  *
11960
- * Foo.prototype.c = 3;
11961
- * Bar.prototype.e = 5;
12155
+ * Foo.prototype.b = 2;
12156
+ * Bar.prototype.d = 4;
11962
12157
  *
11963
- * _.assignIn({ 'a': 1 }, new Foo, new Bar);
11964
- * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
12158
+ * _.assignIn({ 'a': 0 }, new Foo, new Bar);
12159
+ * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
11965
12160
  */
11966
12161
  var assignIn = createAssigner(function(object, source) {
11967
12162
  if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
@@ -12055,7 +12250,7 @@
12055
12250
  * _.at(object, ['a[0].b.c', 'a[1]']);
12056
12251
  * // => [3, 4]
12057
12252
  */
12058
- var at = rest(function(object, paths) {
12253
+ var at = baseRest(function(object, paths) {
12059
12254
  return baseAt(object, baseFlatten(paths, 1));
12060
12255
  });
12061
12256
 
@@ -12116,10 +12311,10 @@
12116
12311
  * @see _.defaultsDeep
12117
12312
  * @example
12118
12313
  *
12119
- * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
12120
- * // => { 'user': 'barney', 'age': 36 }
12314
+ * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
12315
+ * // => { 'a': 1, 'b': 2 }
12121
12316
  */
12122
- var defaults = rest(function(args) {
12317
+ var defaults = baseRest(function(args) {
12123
12318
  args.push(undefined, assignInDefaults);
12124
12319
  return apply(assignInWith, undefined, args);
12125
12320
  });
@@ -12140,11 +12335,10 @@
12140
12335
  * @see _.defaults
12141
12336
  * @example
12142
12337
  *
12143
- * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
12144
- * // => { 'user': { 'name': 'barney', 'age': 36 } }
12145
- *
12338
+ * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
12339
+ * // => { 'a': { 'b': 2, 'c': 3 } }
12146
12340
  */
12147
- var defaultsDeep = rest(function(args) {
12341
+ var defaultsDeep = baseRest(function(args) {
12148
12342
  args.push(undefined, mergeDefaults);
12149
12343
  return apply(mergeWith, undefined, args);
12150
12344
  });
@@ -12158,8 +12352,7 @@
12158
12352
  * @since 1.1.0
12159
12353
  * @category Object
12160
12354
  * @param {Object} object The object to search.
12161
- * @param {Array|Function|Object|string} [predicate=_.identity]
12162
- * The function invoked per iteration.
12355
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
12163
12356
  * @returns {string|undefined} Returns the key of the matched element,
12164
12357
  * else `undefined`.
12165
12358
  * @example
@@ -12198,8 +12391,7 @@
12198
12391
  * @since 2.0.0
12199
12392
  * @category Object
12200
12393
  * @param {Object} object The object to search.
12201
- * @param {Array|Function|Object|string} [predicate=_.identity]
12202
- * The function invoked per iteration.
12394
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
12203
12395
  * @returns {string|undefined} Returns the key of the matched element,
12204
12396
  * else `undefined`.
12205
12397
  * @example
@@ -12413,7 +12605,7 @@
12413
12605
 
12414
12606
  /**
12415
12607
  * Gets the value at `path` of `object`. If the resolved value is
12416
- * `undefined`, the `defaultValue` is used in its place.
12608
+ * `undefined`, the `defaultValue` is returned in its place.
12417
12609
  *
12418
12610
  * @static
12419
12611
  * @memberOf _
@@ -12536,8 +12728,7 @@
12536
12728
  * @since 4.1.0
12537
12729
  * @category Object
12538
12730
  * @param {Object} object The object to invert.
12539
- * @param {Array|Function|Object|string} [iteratee=_.identity]
12540
- * The iteratee invoked per element.
12731
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
12541
12732
  * @returns {Object} Returns the new inverted object.
12542
12733
  * @example
12543
12734
  *
@@ -12577,7 +12768,7 @@
12577
12768
  * _.invoke(object, 'a[0].b.c.slice', 1, 3);
12578
12769
  * // => [2, 3]
12579
12770
  */
12580
- var invoke = rest(baseInvoke);
12771
+ var invoke = baseRest(baseInvoke);
12581
12772
 
12582
12773
  /**
12583
12774
  * Creates an array of the own enumerable property names of `object`.
@@ -12681,8 +12872,7 @@
12681
12872
  * @since 3.8.0
12682
12873
  * @category Object
12683
12874
  * @param {Object} object The object to iterate over.
12684
- * @param {Array|Function|Object|string} [iteratee=_.identity]
12685
- * The function invoked per iteration.
12875
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
12686
12876
  * @returns {Object} Returns the new mapped object.
12687
12877
  * @see _.mapValues
12688
12878
  * @example
@@ -12713,8 +12903,7 @@
12713
12903
  * @since 2.4.0
12714
12904
  * @category Object
12715
12905
  * @param {Object} object The object to iterate over.
12716
- * @param {Array|Function|Object|string} [iteratee=_.identity]
12717
- * The function invoked per iteration.
12906
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
12718
12907
  * @returns {Object} Returns the new mapped object.
12719
12908
  * @see _.mapKeys
12720
12909
  * @example
@@ -12761,16 +12950,16 @@
12761
12950
  * @returns {Object} Returns `object`.
12762
12951
  * @example
12763
12952
  *
12764
- * var users = {
12765
- * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
12953
+ * var object = {
12954
+ * 'a': [{ 'b': 2 }, { 'd': 4 }]
12766
12955
  * };
12767
12956
  *
12768
- * var ages = {
12769
- * 'data': [{ 'age': 36 }, { 'age': 40 }]
12957
+ * var other = {
12958
+ * 'a': [{ 'c': 3 }, { 'e': 5 }]
12770
12959
  * };
12771
12960
  *
12772
- * _.merge(users, ages);
12773
- * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
12961
+ * _.merge(object, other);
12962
+ * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
12774
12963
  */
12775
12964
  var merge = createAssigner(function(object, source, srcIndex) {
12776
12965
  baseMerge(object, source, srcIndex);
@@ -12801,18 +12990,11 @@
12801
12990
  * }
12802
12991
  * }
12803
12992
  *
12804
- * var object = {
12805
- * 'fruits': ['apple'],
12806
- * 'vegetables': ['beet']
12807
- * };
12808
- *
12809
- * var other = {
12810
- * 'fruits': ['banana'],
12811
- * 'vegetables': ['carrot']
12812
- * };
12993
+ * var object = { 'a': [1], 'b': [2] };
12994
+ * var other = { 'a': [3], 'b': [4] };
12813
12995
  *
12814
12996
  * _.mergeWith(object, other, customizer);
12815
- * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
12997
+ * // => { 'a': [1, 3], 'b': [2, 4] }
12816
12998
  */
12817
12999
  var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
12818
13000
  baseMerge(object, source, srcIndex, customizer);
@@ -12837,7 +13019,7 @@
12837
13019
  * _.omit(object, ['a', 'c']);
12838
13020
  * // => { 'b': '2' }
12839
13021
  */
12840
- var omit = rest(function(object, props) {
13022
+ var omit = baseRest(function(object, props) {
12841
13023
  if (object == null) {
12842
13024
  return {};
12843
13025
  }
@@ -12856,8 +13038,7 @@
12856
13038
  * @since 4.0.0
12857
13039
  * @category Object
12858
13040
  * @param {Object} object The source object.
12859
- * @param {Array|Function|Object|string} [predicate=_.identity]
12860
- * The function invoked per property.
13041
+ * @param {Function} [predicate=_.identity] The function invoked per property.
12861
13042
  * @returns {Object} Returns the new object.
12862
13043
  * @example
12863
13044
  *
@@ -12867,10 +13048,7 @@
12867
13048
  * // => { 'b': '2' }
12868
13049
  */
12869
13050
  function omitBy(object, predicate) {
12870
- predicate = getIteratee(predicate);
12871
- return basePickBy(object, function(value, key) {
12872
- return !predicate(value, key);
12873
- });
13051
+ return pickBy(object, negate(getIteratee(predicate)));
12874
13052
  }
12875
13053
 
12876
13054
  /**
@@ -12890,7 +13068,7 @@
12890
13068
  * _.pick(object, ['a', 'c']);
12891
13069
  * // => { 'a': 1, 'c': 3 }
12892
13070
  */
12893
- var pick = rest(function(object, props) {
13071
+ var pick = baseRest(function(object, props) {
12894
13072
  return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey));
12895
13073
  });
12896
13074
 
@@ -12903,8 +13081,7 @@
12903
13081
  * @since 4.0.0
12904
13082
  * @category Object
12905
13083
  * @param {Object} object The source object.
12906
- * @param {Array|Function|Object|string} [predicate=_.identity]
12907
- * The function invoked per property.
13084
+ * @param {Function} [predicate=_.identity] The function invoked per property.
12908
13085
  * @returns {Object} Returns the new object.
12909
13086
  * @example
12910
13087
  *
@@ -12914,7 +13091,7 @@
12914
13091
  * // => { 'a': 1, 'c': 3 }
12915
13092
  */
12916
13093
  function pickBy(object, predicate) {
12917
- return object == null ? {} : basePickBy(object, getIteratee(predicate));
13094
+ return object == null ? {} : basePickBy(object, getAllKeysIn(object), getIteratee(predicate));
12918
13095
  }
12919
13096
 
12920
13097
  /**
@@ -13358,12 +13535,12 @@
13358
13535
  * // => true
13359
13536
  */
13360
13537
  function inRange(number, start, end) {
13361
- start = toNumber(start) || 0;
13538
+ start = toFinite(start);
13362
13539
  if (end === undefined) {
13363
13540
  end = start;
13364
13541
  start = 0;
13365
13542
  } else {
13366
- end = toNumber(end) || 0;
13543
+ end = toFinite(end);
13367
13544
  }
13368
13545
  number = toNumber(number);
13369
13546
  return baseInRange(number, start, end);
@@ -13419,12 +13596,12 @@
13419
13596
  upper = 1;
13420
13597
  }
13421
13598
  else {
13422
- lower = toNumber(lower) || 0;
13599
+ lower = toFinite(lower);
13423
13600
  if (upper === undefined) {
13424
13601
  upper = lower;
13425
13602
  lower = 0;
13426
13603
  } else {
13427
- upper = toNumber(upper) || 0;
13604
+ upper = toFinite(upper);
13428
13605
  }
13429
13606
  }
13430
13607
  if (lower > upper) {
@@ -13539,8 +13716,9 @@
13539
13716
  ? length
13540
13717
  : baseClamp(toInteger(position), 0, length);
13541
13718
 
13719
+ var end = position;
13542
13720
  position -= target.length;
13543
- return position >= 0 && string.indexOf(target, position) == position;
13721
+ return position >= 0 && string.slice(position, end) == target;
13544
13722
  }
13545
13723
 
13546
13724
  /**
@@ -13988,7 +14166,8 @@
13988
14166
  function startsWith(string, target, position) {
13989
14167
  string = toString(string);
13990
14168
  position = baseClamp(toInteger(position), 0, string.length);
13991
- return string.lastIndexOf(baseToString(target), position) == position;
14169
+ target = baseToString(target);
14170
+ return string.slice(position, position + target.length) == target;
13992
14171
  }
13993
14172
 
13994
14173
  /**
@@ -14571,7 +14750,7 @@
14571
14750
  * elements = [];
14572
14751
  * }
14573
14752
  */
14574
- var attempt = rest(function(func, args) {
14753
+ var attempt = baseRest(function(func, args) {
14575
14754
  try {
14576
14755
  return apply(func, undefined, args);
14577
14756
  } catch (e) {
@@ -14596,16 +14775,16 @@
14596
14775
  *
14597
14776
  * var view = {
14598
14777
  * 'label': 'docs',
14599
- * 'onClick': function() {
14778
+ * 'click': function() {
14600
14779
  * console.log('clicked ' + this.label);
14601
14780
  * }
14602
14781
  * };
14603
14782
  *
14604
- * _.bindAll(view, ['onClick']);
14605
- * jQuery(element).on('click', view.onClick);
14783
+ * _.bindAll(view, ['click']);
14784
+ * jQuery(element).on('click', view.click);
14606
14785
  * // => Logs 'clicked docs' when clicked.
14607
14786
  */
14608
- var bindAll = rest(function(object, methodNames) {
14787
+ var bindAll = baseRest(function(object, methodNames) {
14609
14788
  arrayEach(baseFlatten(methodNames, 1), function(key) {
14610
14789
  key = toKey(key);
14611
14790
  object[key] = bind(object[key], object);
@@ -14630,7 +14809,7 @@
14630
14809
  * var func = _.cond([
14631
14810
  * [_.matches({ 'a': 1 }), _.constant('matches A')],
14632
14811
  * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
14633
- * [_.constant(true), _.constant('no match')]
14812
+ * [_.stubTrue, _.constant('no match')]
14634
14813
  * ]);
14635
14814
  *
14636
14815
  * func({ 'a': 1, 'b': 2 });
@@ -14653,7 +14832,7 @@
14653
14832
  return [toIteratee(pair[0]), pair[1]];
14654
14833
  });
14655
14834
 
14656
- return rest(function(args) {
14835
+ return baseRest(function(args) {
14657
14836
  var index = -1;
14658
14837
  while (++index < length) {
14659
14838
  var pair = pairs[index];
@@ -14669,6 +14848,9 @@
14669
14848
  * the corresponding property values of a given object, returning `true` if
14670
14849
  * all predicates return truthy, else `false`.
14671
14850
  *
14851
+ * **Note:** The created function is equivalent to `_.conformsTo` with
14852
+ * `source` partially applied.
14853
+ *
14672
14854
  * @static
14673
14855
  * @memberOf _
14674
14856
  * @since 4.0.0
@@ -14677,13 +14859,13 @@
14677
14859
  * @returns {Function} Returns the new spec function.
14678
14860
  * @example
14679
14861
  *
14680
- * var users = [
14681
- * { 'user': 'barney', 'age': 36 },
14682
- * { 'user': 'fred', 'age': 40 }
14862
+ * var objects = [
14863
+ * { 'a': 2, 'b': 1 },
14864
+ * { 'a': 1, 'b': 2 }
14683
14865
  * ];
14684
14866
  *
14685
- * _.filter(users, _.conforms({ 'age': function(n) { return n > 38; } }));
14686
- * // => [{ 'user': 'fred', 'age': 40 }]
14867
+ * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
14868
+ * // => [{ 'a': 1, 'b': 2 }]
14687
14869
  */
14688
14870
  function conforms(source) {
14689
14871
  return baseConforms(baseClone(source, true));
@@ -14714,6 +14896,30 @@
14714
14896
  };
14715
14897
  }
14716
14898
 
14899
+ /**
14900
+ * Checks `value` to determine whether a default value should be returned in
14901
+ * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
14902
+ * or `undefined`.
14903
+ *
14904
+ * @static
14905
+ * @memberOf _
14906
+ * @since 4.14.0
14907
+ * @category Util
14908
+ * @param {*} value The value to check.
14909
+ * @param {*} defaultValue The default value.
14910
+ * @returns {*} Returns the resolved value.
14911
+ * @example
14912
+ *
14913
+ * _.defaultTo(1, 10);
14914
+ * // => 1
14915
+ *
14916
+ * _.defaultTo(undefined, 10);
14917
+ * // => 10
14918
+ */
14919
+ function defaultTo(value, defaultValue) {
14920
+ return (value == null || value !== value) ? defaultValue : value;
14921
+ }
14922
+
14717
14923
  /**
14718
14924
  * Creates a function that returns the result of invoking the given functions
14719
14925
  * with the `this` binding of the created function, where each successive
@@ -14723,7 +14929,7 @@
14723
14929
  * @memberOf _
14724
14930
  * @since 3.0.0
14725
14931
  * @category Util
14726
- * @param {...(Function|Function[])} [funcs] Functions to invoke.
14932
+ * @param {...(Function|Function[])} [funcs] The functions to invoke.
14727
14933
  * @returns {Function} Returns the new composite function.
14728
14934
  * @see _.flowRight
14729
14935
  * @example
@@ -14746,7 +14952,7 @@
14746
14952
  * @since 3.0.0
14747
14953
  * @memberOf _
14748
14954
  * @category Util
14749
- * @param {...(Function|Function[])} [funcs] Functions to invoke.
14955
+ * @param {...(Function|Function[])} [funcs] The functions to invoke.
14750
14956
  * @returns {Function} Returns the new composite function.
14751
14957
  * @see _.flow
14752
14958
  * @example
@@ -14762,7 +14968,7 @@
14762
14968
  var flowRight = createFlow(true);
14763
14969
 
14764
14970
  /**
14765
- * This method returns the first argument given to it.
14971
+ * This method returns the first argument it receives.
14766
14972
  *
14767
14973
  * @static
14768
14974
  * @since 0.1.0
@@ -14772,7 +14978,7 @@
14772
14978
  * @returns {*} Returns `value`.
14773
14979
  * @example
14774
14980
  *
14775
- * var object = { 'user': 'fred' };
14981
+ * var object = { 'a': 1 };
14776
14982
  *
14777
14983
  * console.log(_.identity(object) === object);
14778
14984
  * // => true
@@ -14830,10 +15036,10 @@
14830
15036
  /**
14831
15037
  * Creates a function that performs a partial deep comparison between a given
14832
15038
  * object and `source`, returning `true` if the given object has equivalent
14833
- * property values, else `false`. The created function is equivalent to
14834
- * `_.isMatch` with a `source` partially applied.
15039
+ * property values, else `false`.
14835
15040
  *
14836
- * **Note:** This method supports comparing the same values as `_.isEqual`.
15041
+ * **Note:** The created function supports comparing the same values as
15042
+ * `_.isEqual` is equivalent to `_.isMatch` with `source` partially applied.
14837
15043
  *
14838
15044
  * @static
14839
15045
  * @memberOf _
@@ -14843,13 +15049,13 @@
14843
15049
  * @returns {Function} Returns the new spec function.
14844
15050
  * @example
14845
15051
  *
14846
- * var users = [
14847
- * { 'user': 'barney', 'age': 36, 'active': true },
14848
- * { 'user': 'fred', 'age': 40, 'active': false }
15052
+ * var objects = [
15053
+ * { 'a': 1, 'b': 2, 'c': 3 },
15054
+ * { 'a': 4, 'b': 5, 'c': 6 }
14849
15055
  * ];
14850
15056
  *
14851
- * _.filter(users, _.matches({ 'age': 40, 'active': false }));
14852
- * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
15057
+ * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
15058
+ * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
14853
15059
  */
14854
15060
  function matches(source) {
14855
15061
  return baseMatches(baseClone(source, true));
@@ -14871,13 +15077,13 @@
14871
15077
  * @returns {Function} Returns the new spec function.
14872
15078
  * @example
14873
15079
  *
14874
- * var users = [
14875
- * { 'user': 'barney' },
14876
- * { 'user': 'fred' }
15080
+ * var objects = [
15081
+ * { 'a': 1, 'b': 2, 'c': 3 },
15082
+ * { 'a': 4, 'b': 5, 'c': 6 }
14877
15083
  * ];
14878
15084
  *
14879
- * _.find(users, _.matchesProperty('user', 'fred'));
14880
- * // => { 'user': 'fred' }
15085
+ * _.find(objects, _.matchesProperty('a', 4));
15086
+ * // => { 'a': 4, 'b': 5, 'c': 6 }
14881
15087
  */
14882
15088
  function matchesProperty(path, srcValue) {
14883
15089
  return baseMatchesProperty(path, baseClone(srcValue, true));
@@ -14907,7 +15113,7 @@
14907
15113
  * _.map(objects, _.method(['a', 'b']));
14908
15114
  * // => [2, 1]
14909
15115
  */
14910
- var method = rest(function(path, args) {
15116
+ var method = baseRest(function(path, args) {
14911
15117
  return function(object) {
14912
15118
  return baseInvoke(object, path, args);
14913
15119
  };
@@ -14936,7 +15142,7 @@
14936
15142
  * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
14937
15143
  * // => [2, 0]
14938
15144
  */
14939
- var methodOf = rest(function(object, args) {
15145
+ var methodOf = baseRest(function(object, args) {
14940
15146
  return function(path) {
14941
15147
  return baseInvoke(object, path, args);
14942
15148
  };
@@ -15035,7 +15241,7 @@
15035
15241
  }
15036
15242
 
15037
15243
  /**
15038
- * A method that returns `undefined`.
15244
+ * This method returns `undefined`.
15039
15245
  *
15040
15246
  * @static
15041
15247
  * @memberOf _
@@ -15072,7 +15278,7 @@
15072
15278
  */
15073
15279
  function nthArg(n) {
15074
15280
  n = toInteger(n);
15075
- return rest(function(args) {
15281
+ return baseRest(function(args) {
15076
15282
  return baseNth(args, n);
15077
15283
  });
15078
15284
  }
@@ -15085,8 +15291,8 @@
15085
15291
  * @memberOf _
15086
15292
  * @since 4.0.0
15087
15293
  * @category Util
15088
- * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
15089
- * [iteratees=[_.identity]] The iteratees to invoke.
15294
+ * @param {...(Function|Function[])} [iteratees=[_.identity]]
15295
+ * The iteratees to invoke.
15090
15296
  * @returns {Function} Returns the new function.
15091
15297
  * @example
15092
15298
  *
@@ -15105,8 +15311,8 @@
15105
15311
  * @memberOf _
15106
15312
  * @since 4.0.0
15107
15313
  * @category Util
15108
- * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
15109
- * [predicates=[_.identity]] The predicates to check.
15314
+ * @param {...(Function|Function[])} [predicates=[_.identity]]
15315
+ * The predicates to check.
15110
15316
  * @returns {Function} Returns the new function.
15111
15317
  * @example
15112
15318
  *
@@ -15131,8 +15337,8 @@
15131
15337
  * @memberOf _
15132
15338
  * @since 4.0.0
15133
15339
  * @category Util
15134
- * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
15135
- * [predicates=[_.identity]] The predicates to check.
15340
+ * @param {...(Function|Function[])} [predicates=[_.identity]]
15341
+ * The predicates to check.
15136
15342
  * @returns {Function} Returns the new function.
15137
15343
  * @example
15138
15344
  *
@@ -15284,7 +15490,7 @@
15284
15490
  var rangeRight = createRange(true);
15285
15491
 
15286
15492
  /**
15287
- * A method that returns a new empty array.
15493
+ * This method returns a new empty array.
15288
15494
  *
15289
15495
  * @static
15290
15496
  * @memberOf _
@@ -15306,7 +15512,7 @@
15306
15512
  }
15307
15513
 
15308
15514
  /**
15309
- * A method that returns `false`.
15515
+ * This method returns `false`.
15310
15516
  *
15311
15517
  * @static
15312
15518
  * @memberOf _
@@ -15323,7 +15529,7 @@
15323
15529
  }
15324
15530
 
15325
15531
  /**
15326
- * A method that returns a new empty object.
15532
+ * This method returns a new empty object.
15327
15533
  *
15328
15534
  * @static
15329
15535
  * @memberOf _
@@ -15345,7 +15551,7 @@
15345
15551
  }
15346
15552
 
15347
15553
  /**
15348
- * A method that returns an empty string.
15554
+ * This method returns an empty string.
15349
15555
  *
15350
15556
  * @static
15351
15557
  * @memberOf _
@@ -15362,7 +15568,7 @@
15362
15568
  }
15363
15569
 
15364
15570
  /**
15365
- * A method that returns `true`.
15571
+ * This method returns `true`.
15366
15572
  *
15367
15573
  * @static
15368
15574
  * @memberOf _
@@ -15480,7 +15686,7 @@
15480
15686
  */
15481
15687
  var add = createMathOperation(function(augend, addend) {
15482
15688
  return augend + addend;
15483
- });
15689
+ }, 0);
15484
15690
 
15485
15691
  /**
15486
15692
  * Computes `number` rounded up to `precision`.
@@ -15522,7 +15728,7 @@
15522
15728
  */
15523
15729
  var divide = createMathOperation(function(dividend, divisor) {
15524
15730
  return dividend / divisor;
15525
- });
15731
+ }, 1);
15526
15732
 
15527
15733
  /**
15528
15734
  * Computes `number` rounded down to `precision`.
@@ -15581,8 +15787,7 @@
15581
15787
  * @since 4.0.0
15582
15788
  * @category Math
15583
15789
  * @param {Array} array The array to iterate over.
15584
- * @param {Array|Function|Object|string} [iteratee=_.identity]
15585
- * The iteratee invoked per element.
15790
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15586
15791
  * @returns {*} Returns the maximum value.
15587
15792
  * @example
15588
15793
  *
@@ -15597,7 +15802,7 @@
15597
15802
  */
15598
15803
  function maxBy(array, iteratee) {
15599
15804
  return (array && array.length)
15600
- ? baseExtremum(array, getIteratee(iteratee), baseGt)
15805
+ ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
15601
15806
  : undefined;
15602
15807
  }
15603
15808
 
@@ -15629,8 +15834,7 @@
15629
15834
  * @since 4.7.0
15630
15835
  * @category Math
15631
15836
  * @param {Array} array The array to iterate over.
15632
- * @param {Array|Function|Object|string} [iteratee=_.identity]
15633
- * The iteratee invoked per element.
15837
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15634
15838
  * @returns {number} Returns the mean.
15635
15839
  * @example
15636
15840
  *
@@ -15644,7 +15848,7 @@
15644
15848
  * // => 5
15645
15849
  */
15646
15850
  function meanBy(array, iteratee) {
15647
- return baseMean(array, getIteratee(iteratee));
15851
+ return baseMean(array, getIteratee(iteratee, 2));
15648
15852
  }
15649
15853
 
15650
15854
  /**
@@ -15681,8 +15885,7 @@
15681
15885
  * @since 4.0.0
15682
15886
  * @category Math
15683
15887
  * @param {Array} array The array to iterate over.
15684
- * @param {Array|Function|Object|string} [iteratee=_.identity]
15685
- * The iteratee invoked per element.
15888
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15686
15889
  * @returns {*} Returns the minimum value.
15687
15890
  * @example
15688
15891
  *
@@ -15697,7 +15900,7 @@
15697
15900
  */
15698
15901
  function minBy(array, iteratee) {
15699
15902
  return (array && array.length)
15700
- ? baseExtremum(array, getIteratee(iteratee), baseLt)
15903
+ ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
15701
15904
  : undefined;
15702
15905
  }
15703
15906
 
@@ -15718,7 +15921,7 @@
15718
15921
  */
15719
15922
  var multiply = createMathOperation(function(multiplier, multiplicand) {
15720
15923
  return multiplier * multiplicand;
15721
- });
15924
+ }, 1);
15722
15925
 
15723
15926
  /**
15724
15927
  * Computes `number` rounded to `precision`.
@@ -15760,7 +15963,7 @@
15760
15963
  */
15761
15964
  var subtract = createMathOperation(function(minuend, subtrahend) {
15762
15965
  return minuend - subtrahend;
15763
- });
15966
+ }, 0);
15764
15967
 
15765
15968
  /**
15766
15969
  * Computes the sum of the values in `array`.
@@ -15792,8 +15995,7 @@
15792
15995
  * @since 4.0.0
15793
15996
  * @category Math
15794
15997
  * @param {Array} array The array to iterate over.
15795
- * @param {Array|Function|Object|string} [iteratee=_.identity]
15796
- * The iteratee invoked per element.
15998
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15797
15999
  * @returns {number} Returns the sum.
15798
16000
  * @example
15799
16001
  *
@@ -15808,7 +16010,7 @@
15808
16010
  */
15809
16011
  function sumBy(array, iteratee) {
15810
16012
  return (array && array.length)
15811
- ? baseSum(array, getIteratee(iteratee))
16013
+ ? baseSum(array, getIteratee(iteratee, 2))
15812
16014
  : 0;
15813
16015
  }
15814
16016
 
@@ -15987,7 +16189,9 @@
15987
16189
  lodash.cloneDeep = cloneDeep;
15988
16190
  lodash.cloneDeepWith = cloneDeepWith;
15989
16191
  lodash.cloneWith = cloneWith;
16192
+ lodash.conformsTo = conformsTo;
15990
16193
  lodash.deburr = deburr;
16194
+ lodash.defaultTo = defaultTo;
15991
16195
  lodash.divide = divide;
15992
16196
  lodash.endsWith = endsWith;
15993
16197
  lodash.eq = eq;
@@ -16228,7 +16432,7 @@
16228
16432
  return this.reverse().find(predicate);
16229
16433
  };
16230
16434
 
16231
- LazyWrapper.prototype.invokeMap = rest(function(path, args) {
16435
+ LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
16232
16436
  if (typeof path == 'function') {
16233
16437
  return new LazyWrapper(this);
16234
16438
  }
@@ -16238,10 +16442,7 @@
16238
16442
  });
16239
16443
 
16240
16444
  LazyWrapper.prototype.reject = function(predicate) {
16241
- predicate = getIteratee(predicate, 3);
16242
- return this.filter(function(value) {
16243
- return !predicate(value);
16244
- });
16445
+ return this.filter(negate(getIteratee(predicate)));
16245
16446
  };
16246
16447
 
16247
16448
  LazyWrapper.prototype.slice = function(start, end) {
@@ -16345,7 +16546,7 @@
16345
16546
  }
16346
16547
  });
16347
16548
 
16348
- realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
16549
+ realNames[createHybrid(undefined, BIND_KEY_FLAG).name] = [{
16349
16550
  'name': 'wrapper',
16350
16551
  'func': undefined
16351
16552
  }];
@@ -16364,6 +16565,9 @@
16364
16565
  lodash.prototype.reverse = wrapperReverse;
16365
16566
  lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
16366
16567
 
16568
+ // Add lazy aliases.
16569
+ lodash.prototype.first = lodash.prototype.head;
16570
+
16367
16571
  if (iteratorSymbol) {
16368
16572
  lodash.prototype[iteratorSymbol] = wrapperToIterator;
16369
16573
  }
@@ -16375,22 +16579,21 @@
16375
16579
  // Export lodash.
16376
16580
  var _ = runInContext();
16377
16581
 
16378
- // Expose Lodash on the free variable `window` or `self` when available so it's
16379
- // globally accessible, even when bundled with Browserify, Webpack, etc. This
16380
- // also prevents errors in cases where Lodash is loaded by a script tag in the
16381
- // presence of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch
16382
- // for more details. Use `_.noConflict` to remove Lodash from the global object.
16383
- (freeSelf || {})._ = _;
16384
-
16385
- // Some AMD build optimizers like r.js check for condition patterns like the following:
16582
+ // Some AMD build optimizers, like r.js, check for condition patterns like:
16386
16583
  if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
16584
+ // Expose Lodash on the global object to prevent errors when Lodash is
16585
+ // loaded by a script tag in the presence of an AMD loader.
16586
+ // See http://requirejs.org/docs/errors.html#mismatch for more details.
16587
+ // Use `_.noConflict` to remove Lodash from the global object.
16588
+ root._ = _;
16589
+
16387
16590
  // Define as an anonymous module so, through path mapping, it can be
16388
16591
  // referenced as the "underscore" module.
16389
16592
  define(function() {
16390
16593
  return _;
16391
16594
  });
16392
16595
  }
16393
- // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
16596
+ // Check for `exports` after `define` in case a build optimizer adds it.
16394
16597
  else if (freeModule) {
16395
16598
  // Export for Node.js.
16396
16599
  (freeModule.exports = _)._ = _;