lodash-rails 4.3.0 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,30 +1,29 @@
1
1
  /**
2
2
  * @license
3
- * lodash 4.3.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
3
+ * lodash 4.5.1 (Custom Build) lodash.com/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,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function t(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===an?i===i:r(i,c)))var c=i,f=o}return f}function r(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}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 w(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return hn[n];
7
- }function c(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function f(n,t){return n=typeof n=="number"||sn.test(n)?+n:-1,n>-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){if(Y(n)&&!Mn(n)){if(n instanceof l)return n;if(xn.call(n,"__wrapped__")){var t=new l(n.__wrapped__,n.__chain__);return t.__actions__=k(n.__actions__),t}}return new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){return n===an||V(n,On[r])&&!xn.call(e,r)?t:n;
8
- }function s(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(an,r)},t)}function h(n,t){var r=true;return In(n,function(n,e,u){return r=!!t(n,e,u)}),r}function v(n,t){var r=[];return In(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u){u||(u=[]);for(var o=-1,i=t.length;++o<i;){var c=t[o];Y(c)&&L(c)&&(e||Mn(c)||K(c))?r?y(c,r,e,u):n(u,c):e||(u[u.length]=c)}return u}function _(n,t){return n&&$n(n,t,en)}function g(n,t){return v(t,function(t){
9
- return Q(n[t])})}function b(n,t,r,e,u){return n===t?true:null==n||null==t||!X(n)&&!Y(t)?n!==n&&t!==t:j(n,t,b,r,e,u)}function j(n,t,r,e,u,o){var i=Mn(n),f=Mn(t),a="[object Array]",l="[object Array]";i||(a=An.call(n),"[object Arguments]"==a&&(a="[object Object]")),f||(l=An.call(t),"[object Arguments]"==l&&(l="[object Object]"));var p="[object Object]"==a&&!c(n),f="[object Object]"==l&&!c(t);return!(l=a==l)||i||p?2&u||(a=p&&xn.call(n,"__wrapped__"),f=f&&xn.call(t,"__wrapped__"),!a&&!f)?l?(o||(o=[]),(a=G(o,function(t){
10
- return t[0]===n}))&&a[1]?a[1]==t:(o.push([n,t]),t=(i?D:$)(n,t,r,e,u,o),o.pop(),t)):false:r(a?n.value():n,f?t.value():t,e,u,o):I(n,t,a)}function m(n){var t=typeof n;return"function"==t?n:null==n?cn:("object"==t?O:E)(n)}function d(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function w(n,t){var r=-1,e=L(n)?Array(n.length):[];return In(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function O(n){var t=en(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];
11
- if(!(u in r&&b(n[u],r[u],an,3)))return false}return true}}function x(n,t){return n=Object(n),M(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function E(n){return function(t){return null==t?an:t[n]}}function A(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 k(n){return A(n,0,n.length)}function N(n,t){var r;return In(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function S(t,r){return M(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args));
12
- },t)}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];(!V(a,c)||V(a,On[i])&&!xn.call(f,i)||c===an&&!(i in f))&&(f[i]=c)}return r}function F(n){return U(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:an,o=typeof o=="function"?(u--,o):an;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function B(n){return function(){var t=arguments,r=Dn(n.prototype),t=n.apply(r,t);return X(t)?t:r}}function R(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==dn&&this instanceof e?u:n;++c<f;)a[c]=r[c];
13
- for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=B(n);return e}function D(n,t,r,e,u,o){var i=-1,c=1&u,f=n.length,a=t.length;if(f!=a&&!(2&u&&a>f))return false;for(a=true;++i<f;){var l=n[i],p=t[i];if(void 0!==an){a=false;break}if(c){if(!N(t,function(n){return l===n||r(l,n,e,u,o)})){a=false;break}}else if(l!==p&&!r(l,p,e,u,o)){a=false;break}}return a}function I(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]":
14
- 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+""}return false}function $(n,t,r,e,u,o){var i=2&u,c=en(n),f=c.length,a=en(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:xn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==an||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 q(n){var t=n?n.length:an;if(W(t)&&(Mn(n)||nn(n)||K(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function z(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||On)}function C(n){return n?n[0]:an}function G(n,t){return r(n,m(t),In)}function J(n,t){return In(n,typeof t=="function"?t:cn)}function M(n,t,r){return e(n,m(t),r,3>arguments.length,In)}function P(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Pn(n),
16
- function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=an),r}}function U(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=Rn(t===an?n.length-1:Pn(t),0),function(){for(var r=arguments,e=-1,u=Rn(r.length-t,0),o=Array(u);++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,t){return n===t||n!==n&&t!==t}function H(n,t){return n>t}function K(n){return Y(n)&&L(n)&&xn.call(n,"callee")&&(!Tn.call(n,"callee")||"[object Arguments]"==An.call(n));
17
- }function L(n){return null!=n&&!(typeof n=="function"&&Q(n))&&W(qn(n))}function Q(n){return n=X(n)?An.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function W(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function X(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function Y(n){return!!n&&typeof n=="object"}function Z(n){return typeof n=="number"||Y(n)&&"[object Number]"==An.call(n)}function nn(n){return typeof n=="string"||!Mn(n)&&Y(n)&&"[object String]"==An.call(n);
18
- }function tn(n,t){return t>n}function rn(n){return typeof n=="string"?n:null==n?"":n+""}function en(n){var t=z(n);if(!t&&!L(n))return Bn(Object(n));var r,e=q(n),u=!!e,e=e||[],o=e.length;for(r in n)!xn.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function un(n){for(var t=-1,r=z(n),e=d(n),u=e.length,o=q(n),i=!!o,o=o||[],c=o.length;++t<u;){var a=e[t];i&&("length"==a||f(a,c))||"constructor"==a&&(r||!xn.call(n,a))||o.push(a)}return o}function on(n){return n?u(n,en(n)):[];
19
- }function cn(n){return n}function fn(t,r,e){var u=en(r),o=g(r,u);null!=e||X(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=g(r,en(r)));var i=X(e)&&"chain"in e?e.chain:true,c=Q(t);return In(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=k(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var an,ln=/[&<>"'`]/g,pn=RegExp(ln.source),sn=/^(?:0|[1-9]\d*)$/,hn={
20
- "&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},vn={"function":true,object:true},yn=vn[typeof exports]&&exports&&!exports.nodeType?exports:null,_n=vn[typeof module]&&module&&!module.nodeType?module:null,gn=o(vn[typeof self]&&self),bn=o(vn[typeof window]&&window),jn=_n&&_n.exports===yn?yn:null,mn=o(vn[typeof this]&&this),dn=o(yn&&_n&&typeof global=="object"&&global)||bn!==(mn&&mn.window)&&bn||gn||mn||Function("return this")(),wn=Array.prototype,On=Object.prototype,xn=On.hasOwnProperty,En=0,An=On.toString,kn=dn._,Nn=dn.f,Sn=Nn?Nn.g:an,Tn=On.propertyIsEnumerable,Fn=dn.isFinite,Bn=Object.keys,Rn=Math.max,Dn=function(){
21
- function n(){}return function(t){if(X(t)){n.prototype=t;var r=new n;n.prototype=an}return r||{}}}(),In=function(n,t){return function(r,e){if(null==r)return r;if(!L(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(_),$n=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}}();Sn&&!Tn.call({valueOf:1},"valueOf")&&(d=function(n){n=Sn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);
22
- return r});var qn=E("length"),zn=U(function(t,r){return Mn(t)||(t=null==t?[]:[Object(t)]),y(r),n(k(t),on)}),Cn=U(function(n,t,r){return R(n,t,r)}),Gn=U(function(n,t){return s(n,1,t)}),Jn=U(function(n,t,r){return s(n,Un(t)||0,r)}),Mn=Array.isArray,Pn=Number,Un=Number,Vn=F(function(n,t){T(t,en(t),n)}),Hn=F(function(n,t){T(t,un(t),n)}),Kn=F(function(n,t,r,e){T(t,un(t),n,e)}),Ln=U(function(n){return n.push(an,p),Kn.apply(an,n)}),Qn=U(function(n,t){return null==n?{}:x(n,y(t))}),Wn=m;l.prototype=Dn(a.prototype),
23
- l.prototype.constructor=l,a.assignIn=Hn,a.before=P,a.bind=Cn,a.chain=function(n){return n=a(n),n.__chain__=true,n},a.compact=function(n){return v(n,Boolean)},a.concat=zn,a.create=function(n,t){var r=Dn(n);return t?Vn(r,t):r},a.defaults=Ln,a.defer=Gn,a.delay=Jn,a.filter=function(n,t){return v(n,m(t))},a.flatten=function(n){return n&&n.length?y(n):[]},a.flattenDeep=function(n){return n&&n.length?y(n,true):[]},a.iteratee=Wn,a.keys=en,a.map=function(n,t){return w(n,m(t))},a.matches=function(n){return O(Vn({},n));
24
- },a.mixin=fn,a.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},a.once=function(n){return P(2,n)},a.pick=Qn,a.slice=function(n,t,r){var e=n?n.length:0;return r=r===an?e:+r,e?A(n,null==t?0:+t,r):[]},a.sortBy=function(n,t){var r=0;return t=m(t),w(w(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===an,i=r===r,c=null===e,f=e===an,a=e===e;if(r>e&&!c||!i||u&&!f&&a||o&&a){
25
- r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return L(n)?n.length?k(n):[]:on(n)},a.values=on,a.extend=Hn,fn(a,a),a.clone=function(n){return X(n)?Mn(n)?k(n):T(n,en(n)):n},a.escape=function(n){return(n=rn(n))&&pn.test(n)?n.replace(ln,i):n},a.every=function(n,t,r){return t=r?an:t,h(n,m(t))},a.find=G,a.forEach=J,a.has=function(n,t){return null!=n&&xn.call(n,t)},a.head=C,
26
- a.identity=cn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1},a.isArguments=K,a.isArray=Mn,a.isBoolean=function(n){return true===n||false===n||Y(n)&&"[object Boolean]"==An.call(n)},a.isDate=function(n){return Y(n)&&"[object Date]"==An.call(n)},a.isEmpty=function(n){if(L(n)&&(Mn(n)||nn(n)||Q(n.splice)||K(n)))return!n.length;for(var t in n)if(xn.call(n,t))return false;return true},a.isEqual=function(n,t){
27
- return b(n,t)},a.isFinite=function(n){return typeof n=="number"&&Fn(n)},a.isFunction=Q,a.isNaN=function(n){return Z(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=Z,a.isObject=X,a.isRegExp=function(n){return X(n)&&"[object RegExp]"==An.call(n)},a.isString=nn,a.isUndefined=function(n){return n===an},a.last=function(n){var t=n?n.length:0;return t?n[t-1]:an},a.max=function(n){return n&&n.length?t(n,cn,H):an},a.min=function(n){return n&&n.length?t(n,cn,tn):an},a.noConflict=function(){return dn._===this&&(dn._=kn),
28
- this},a.noop=function(){},a.reduce=M,a.result=function(n,t,r){return t=null==n?an:n[t],t===an&&(t=r),Q(t)?t.call(n):t},a.size=function(n){return null==n?0:(n=L(n)?n:en(n),n.length)},a.some=function(n,t,r){return t=r?an:t,N(n,m(t))},a.uniqueId=function(n){var t=++En;return rn(n)+t},a.each=J,a.first=C,fn(a,function(){var n={};return _(a,function(t,r){xn.call(a.prototype,r)||(n[r]=t)}),n}(),{chain:false}),a.VERSION="4.3.0",In("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){
29
- var t=(/^(?:replace|split)$/.test(n)?String.prototype:wn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);a.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),a.prototype.toJSON=a.prototype.valueOf=a.prototype.value=function(){return S(this.__wrapped__,this.__actions__)},(bn||gn||{})._=a,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){
30
- return a}):yn&&_n?(jn&&((_n.exports=a)._=a),yn._=a):dn._=a}).call(this);
6
+ ;(function(){function n(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function t(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===an?i===i:r(i,c)))var c=i,f=o}return f}function r(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}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 O(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return vn[n];
7
+ }function c(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function f(n,t){return n=typeof n=="number"||hn.test(n)?+n:-1,n>-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){if(Y(n)&&!Pn(n)){if(n instanceof l)return n;if(En.call(n,"__wrapped__")){var t=new l(n.__wrapped__,n.__chain__);return t.__actions__=N(n.__actions__),t}}return new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){var u;return(u=n===an)||(u=xn[r],
8
+ u=(n===u||n!==n&&u!==u)&&!En.call(e,r)),u?t:n}function s(n){return X(n)?Fn(n):{}}function h(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(an,r)},t)}function v(n,t){var r=true;return $n(n,function(n,e,u){return r=!!t(n,e,u)}),r}function y(n,t){var r=[];return $n(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function _(t,r,e,u){u||(u=[]);for(var o=-1,i=t.length;++o<i;){var c=t[o];r>0&&Y(c)&&L(c)&&(e||Pn(c)||K(c))?r>1?_(c,r-1,e,u):n(u,c):e||(u[u.length]=c);
9
+ }return u}function g(n,t){return n&&qn(n,t,en)}function b(n,t){return y(t,function(t){return Q(n[t])})}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!X(n)&&!Y(t)?n!==n&&t!==t:m(n,t,j,r,e,u)}function m(n,t,r,e,u,o){var i=Pn(n),f=Pn(t),a="[object Array]",l="[object Array]";i||(a=kn.call(n),"[object Arguments]"==a&&(a="[object Object]")),f||(l=kn.call(t),"[object Arguments]"==l&&(l="[object Object]"));var p="[object Object]"==a&&!c(n),f="[object Object]"==l&&!c(t);return!(l=a==l)||i||p?2&u||(a=p&&En.call(n,"__wrapped__"),
10
+ f=f&&En.call(t,"__wrapped__"),!a&&!f)?l?(o||(o=[]),(a=J(o,function(t){return t[0]===n}))&&a[1]?a[1]==t:(o.push([n,t]),t=(i?I:q)(n,t,r,e,u,o),o.pop(),t)):false:r(a?n.value():n,f?t.value():t,e,u,o):$(n,t,a)}function d(n){var t=typeof n;return"function"==t?n:null==n?cn:("object"==t?x:A)(n)}function w(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function O(n,t){var r=-1,e=L(n)?Array(n.length):[];return $n(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function x(n){var t=en(n);return function(r){
11
+ var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&j(n[u],r[u],an,3)))return false}return true}}function E(n,t){return n=Object(n),P(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function A(n){return function(t){return null==t?an: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,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 $n(n,function(n,e,u){return r=t(n,e,u),
12
+ !r}),!!r}function T(t,r){return P(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function F(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];En.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==an||i in f)||(f[i]=c)}return r}function R(n){return V(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:an,o=typeof o=="function"?(u--,o):an;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function B(n){return function(){var t=arguments,r=s(n.prototype),t=n.apply(r,t);
13
+ return X(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!==wn&&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=B(n);return e}function I(n,t,r,e,u,o){var i=-1,c=1&u,f=n.length,a=t.length;if(f!=a&&!(2&u&&a>f))return false;for(a=true;++i<f;){var l=n[i],p=t[i];if(void 0!==an){a=false;break}if(c){if(!S(t,function(n){return l===n||r(l,n,e,u,o);
14
+ })){a=false;break}}else if(l!==p&&!r(l,p,e,u,o)){a=false;break}}return a}function $(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+""}return false}function q(n,t,r,e,u,o){var i=2&u,c=en(n),f=c.length,a=en(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:En.call(t,p)))return false}for(a=true;++l<f;){
15
+ var p=c[l],s=n[p],h=t[p];if(void 0!==an||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)),a}function z(n){var t=n?n.length:an;if(W(t)&&(Pn(n)||nn(n)||K(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function C(n){var t=n&&n.constructor,t=Q(t)&&t.prototype||xn;return n===t}function G(n){
16
+ return n?n[0]:an}function J(n,t){return r(n,d(t),$n)}function M(n,t){return $n(n,typeof t=="function"?t:cn)}function P(n,t,r){return e(n,d(t),r,3>arguments.length,$n)}function U(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Un(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=an),r}}function V(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=In(t===an?n.length-1:Un(t),0),function(){for(var r=arguments,e=-1,u=In(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];
17
+ for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function H(n,t){return n>t}function K(n){return Y(n)&&L(n)&&En.call(n,"callee")&&(!Rn.call(n,"callee")||"[object Arguments]"==kn.call(n))}function L(n){return null!=n&&!(typeof n=="function"&&Q(n))&&W(zn(n))}function Q(n){return n=X(n)?kn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function W(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function X(n){var t=typeof n;return!!n&&("object"==t||"function"==t);
18
+ }function Y(n){return!!n&&typeof n=="object"}function Z(n){return typeof n=="number"||Y(n)&&"[object Number]"==kn.call(n)}function nn(n){return typeof n=="string"||!Pn(n)&&Y(n)&&"[object String]"==kn.call(n)}function tn(n,t){return t>n}function rn(n){return typeof n=="string"?n:null==n?"":n+""}function en(n){var t=C(n);if(!t&&!L(n))return Dn(Object(n));var r,e=z(n),u=!!e,e=e||[],o=e.length;for(r in n)!En.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function un(n){for(var t=-1,r=C(n),e=w(n),u=e.length,o=z(n),i=!!o,o=o||[],c=o.length;++t<u;){
19
+ var a=e[t];i&&("length"==a||f(a,c))||"constructor"==a&&(r||!En.call(n,a))||o.push(a)}return o}function on(n){return n?u(n,en(n)):[]}function cn(n){return n}function fn(t,r,e){var u=en(r),o=b(r,u);null!=e||X(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=b(r,en(r)));var i=X(e)&&"chain"in e?e.chain:true,c=Q(t);return $n(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=N(this.__actions__)).push({func:u,args:arguments,
20
+ thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var an,ln=1/0,pn=/[&<>"'`]/g,sn=RegExp(pn.source),hn=/^(?:0|[1-9]\d*)$/,vn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},yn={"function":true,object:true},_n=yn[typeof exports]&&exports&&!exports.nodeType?exports:an,gn=yn[typeof module]&&module&&!module.nodeType?module:an,bn=gn&&gn.exports===_n?_n:an,jn=o(yn[typeof self]&&self),mn=o(yn[typeof window]&&window),dn=o(yn[typeof this]&&this),wn=o(_n&&gn&&typeof global=="object"&&global)||mn!==(dn&&dn.window)&&mn||jn||dn||Function("return this")(),On=Array.prototype,xn=Object.prototype,En=xn.hasOwnProperty,An=0,kn=xn.toString,Nn=wn._,Sn=wn.Reflect,Tn=Sn?Sn.f:an,Fn=Object.create,Rn=xn.propertyIsEnumerable,Bn=wn.isFinite,Dn=Object.keys,In=Math.max,$n=function(n,t){
21
+ return function(r,e){if(null==r)return r;if(!L(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(g),qn=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}}();Tn&&!Rn.call({valueOf:1},"valueOf")&&(w=function(n){n=Tn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r});var zn=A("length"),Cn=V(function(t,r){return Pn(t)||(t=null==t?[]:[Object(t)]),_(r,1),
22
+ n(N(t),on)}),Gn=V(function(n,t,r){return D(n,t,r)}),Jn=V(function(n,t){return h(n,1,t)}),Mn=V(function(n,t,r){return h(n,Vn(t)||0,r)}),Pn=Array.isArray,Un=Number,Vn=Number,Hn=R(function(n,t){F(t,en(t),n)}),Kn=R(function(n,t){F(t,un(t),n)}),Ln=R(function(n,t,r,e){F(t,un(t),n,e)}),Qn=V(function(n){return n.push(an,p),Ln.apply(an,n)}),Wn=V(function(n,t){return null==n?{}:E(n,_(t,1))}),Xn=d;l.prototype=s(a.prototype),l.prototype.constructor=l,a.assignIn=Kn,a.before=U,a.bind=Gn,a.chain=function(n){return n=a(n),
23
+ n.__chain__=true,n},a.compact=function(n){return y(n,Boolean)},a.concat=Cn,a.create=function(n,t){var r=s(n);return t?Hn(r,t):r},a.defaults=Qn,a.defer=Jn,a.delay=Mn,a.filter=function(n,t){return y(n,d(t))},a.flatten=function(n){return n&&n.length?_(n,1):[]},a.flattenDeep=function(n){return n&&n.length?_(n,ln):[]},a.iteratee=Xn,a.keys=en,a.map=function(n,t){return O(n,d(t))},a.matches=function(n){return x(Hn({},n))},a.mixin=fn,a.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");
24
+ return function(){return!n.apply(this,arguments)}},a.once=function(n){return U(2,n)},a.pick=Wn,a.slice=function(n,t,r){var e=n?n.length:0;return r=r===an?e:+r,e?k(n,null==t?0:+t,r):[]},a.sortBy=function(n,t){var r=0;return t=d(t),O(O(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===an,i=r===r,c=null===e,f=e===an,a=e===e;if(r>e&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b;
25
+ }),A("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return L(n)?n.length?N(n):[]:on(n)},a.values=on,a.extend=Kn,fn(a,a),a.clone=function(n){return X(n)?Pn(n)?N(n):F(n,en(n)):n},a.escape=function(n){return(n=rn(n))&&sn.test(n)?n.replace(pn,i):n},a.every=function(n,t,r){return t=r?an:t,v(n,d(t))},a.find=J,a.forEach=M,a.has=function(n,t){return null!=n&&En.call(n,t)},a.head=G,a.identity=cn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?In(e+r,0):r:0,
26
+ 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},a.isArguments=K,a.isArray=Pn,a.isBoolean=function(n){return true===n||false===n||Y(n)&&"[object Boolean]"==kn.call(n)},a.isDate=function(n){return Y(n)&&"[object Date]"==kn.call(n)},a.isEmpty=function(n){if(L(n)&&(Pn(n)||nn(n)||Q(n.splice)||K(n)))return!n.length;for(var t in n)if(En.call(n,t))return false;return true},a.isEqual=function(n,t){return j(n,t)},a.isFinite=function(n){return typeof n=="number"&&Bn(n)},a.isFunction=Q,a.isNaN=function(n){
27
+ return Z(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=Z,a.isObject=X,a.isRegExp=function(n){return X(n)&&"[object RegExp]"==kn.call(n)},a.isString=nn,a.isUndefined=function(n){return n===an},a.last=function(n){var t=n?n.length:0;return t?n[t-1]:an},a.max=function(n){return n&&n.length?t(n,cn,H):an},a.min=function(n){return n&&n.length?t(n,cn,tn):an},a.noConflict=function(){return wn._===this&&(wn._=Nn),this},a.noop=function(){},a.reduce=P,a.result=function(n,t,r){return t=null==n?an:n[t],
28
+ t===an&&(t=r),Q(t)?t.call(n):t},a.size=function(n){return null==n?0:(n=L(n)?n:en(n),n.length)},a.some=function(n,t,r){return t=r?an:t,S(n,d(t))},a.uniqueId=function(n){var t=++An;return rn(n)+t},a.each=M,a.first=G,fn(a,function(){var n={};return g(a,function(t,r){En.call(a.prototype,r)||(n[r]=t)}),n}(),{chain:false}),a.VERSION="4.5.1",$n("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:On)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);
29
+ a.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),a.prototype.toJSON=a.prototype.valueOf=a.prototype.value=function(){return T(this.__wrapped__,this.__actions__)},(mn||jn||{})._=a,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return a}):_n&&gn?(bn&&((gn.exports=a)._=a),_n._=a):wn._=a}).call(this);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * lodash 4.3.0 (Custom Build) <https://lodash.com/>
3
+ * lodash 4.5.1 (Custom Build) <https://lodash.com/>
4
4
  * Build: `lodash -o ./dist/lodash.js`
5
5
  * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
6
6
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -13,7 +13,7 @@
13
13
  var undefined;
14
14
 
15
15
  /** Used as the semantic version number. */
16
- var VERSION = '4.3.0';
16
+ var VERSION = '4.5.1';
17
17
 
18
18
  /** Used to compose bitmasks for wrapper metadata. */
19
19
  var BIND_FLAG = 1,
@@ -335,10 +335,19 @@
335
335
  freeParseInt = parseInt;
336
336
 
337
337
  /** Detect free variable `exports`. */
338
- var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
338
+ var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
339
+ ? exports
340
+ : undefined;
339
341
 
340
342
  /** Detect free variable `module`. */
341
- var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
343
+ var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
344
+ ? module
345
+ : undefined;
346
+
347
+ /** Detect the popular CommonJS extension `module.exports`. */
348
+ var moduleExports = (freeModule && freeModule.exports === freeExports)
349
+ ? freeExports
350
+ : undefined;
342
351
 
343
352
  /** Detect free variable `global` from Node.js. */
344
353
  var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
@@ -349,9 +358,6 @@
349
358
  /** Detect free variable `window`. */
350
359
  var freeWindow = checkGlobal(objectTypes[typeof window] && window);
351
360
 
352
- /** Detect the popular CommonJS extension `module.exports`. */
353
- var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
354
-
355
361
  /** Detect `this` as the global object. */
356
362
  var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
357
363
 
@@ -361,7 +367,9 @@
361
367
  * The `this` value is used if it's the global object to avoid Greasemonkey's
362
368
  * restricted `window` object, otherwise the `window` object is used.
363
369
  */
364
- var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
370
+ var root = freeGlobal ||
371
+ ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
372
+ freeSelf || thisGlobal || Function('return this')();
365
373
 
366
374
  /*--------------------------------------------------------------------------*/
367
375
 
@@ -1025,6 +1033,26 @@
1025
1033
  return object.index - other.index;
1026
1034
  }
1027
1035
 
1036
+ /**
1037
+ * Gets the number of `placeholder` occurrences in `array`.
1038
+ *
1039
+ * @private
1040
+ * @param {Array} array The array to inspect.
1041
+ * @param {*} placeholder The placeholder to search for.
1042
+ * @returns {number} Returns the placeholder count.
1043
+ */
1044
+ function countHolders(array, placeholder) {
1045
+ var length = array.length,
1046
+ result = 0;
1047
+
1048
+ while (length--) {
1049
+ if (array[length] === placeholder) {
1050
+ result++;
1051
+ }
1052
+ }
1053
+ return result;
1054
+ }
1055
+
1028
1056
  /**
1029
1057
  * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
1030
1058
  *
@@ -1163,7 +1191,8 @@
1163
1191
  result = [];
1164
1192
 
1165
1193
  while (++index < length) {
1166
- if (array[index] === placeholder) {
1194
+ var value = array[index];
1195
+ if (value === placeholder || value === PLACEHOLDER) {
1167
1196
  array[index] = PLACEHOLDER;
1168
1197
  result[++resIndex] = index;
1169
1198
  }
@@ -1316,6 +1345,7 @@
1316
1345
  getPrototypeOf = Object.getPrototypeOf,
1317
1346
  getOwnPropertySymbols = Object.getOwnPropertySymbols,
1318
1347
  iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined,
1348
+ objectCreate = Object.create,
1319
1349
  propertyIsEnumerable = objectProto.propertyIsEnumerable,
1320
1350
  setTimeout = context.setTimeout,
1321
1351
  splice = arrayProto.splice;
@@ -1395,51 +1425,52 @@
1395
1425
  * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
1396
1426
  *
1397
1427
  * The chainable wrapper methods are:
1398
- * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`,
1399
- * `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`,
1400
- * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`,
1401
- * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
1428
+ * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
1429
+ * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
1430
+ * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
1431
+ * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
1402
1432
  * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`,
1403
- * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`,
1404
- * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`,
1405
- * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`,
1406
- * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`,
1407
- * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`,
1408
- * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`,
1409
- * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`,
1410
- * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`,
1411
- * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`,
1412
- * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,
1413
- * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,
1414
- * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,
1415
- * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,
1416
- * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,
1417
- * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`,
1418
- * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,
1419
- * `zipObjectDeep`, and `zipWith`
1433
+ * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flattenDepth`,
1434
+ * `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, `functionsIn`,
1435
+ * `groupBy`, `initial`, `intersection`, `intersectionBy`, `intersectionWith`,
1436
+ * `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`,
1437
+ * `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`,
1438
+ * `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, `nthArg`,
1439
+ * `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, `overEvery`,
1440
+ * `overSome`, `partial`, `partialRight`, `partition`, `pick`, `pickBy`, `plant`,
1441
+ * `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`,
1442
+ * `range`, `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`,
1443
+ * `sampleSize`, `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`,
1444
+ * `splice`, `spread`, `tail`, `take`, `takeRight`, `takeRightWhile`,
1445
+ * `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, `toPairs`, `toPairsIn`,
1446
+ * `toPath`, `toPlainObject`, `transform`, `unary`, `union`, `unionBy`,
1447
+ * `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, `unshift`, `unzip`,
1448
+ * `unzipWith`, `values`, `valuesIn`, `without`, `wrap`, `xor`, `xorBy`,
1449
+ * `xorWith`, `zip`, `zipObject`, `zipObjectDeep`, and `zipWith`
1420
1450
  *
1421
1451
  * The wrapper methods that are **not** chainable by default are:
1422
1452
  * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
1423
1453
  * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`,
1424
- * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
1425
- * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`,
1426
- * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
1427
- * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
1428
- * `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
1429
- * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`,
1430
- * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`,
1431
- * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,
1432
- * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`,
1433
- * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`,
1434
- * `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`,
1435
- * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`,
1436
- * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
1437
- * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
1438
- * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
1439
- * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`,
1440
- * `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`,
1441
- * `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`,
1442
- * `upperCase`, `upperFirst`, `value`, and `words`
1454
+ * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
1455
+ * `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, `forIn`,
1456
+ * `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`,
1457
+ * `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`,
1458
+ * `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
1459
+ * `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`,
1460
+ * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`,
1461
+ * `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
1462
+ * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
1463
+ * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
1464
+ * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
1465
+ * `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`,
1466
+ * `now`, `pad`, `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`,
1467
+ * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `sample`,
1468
+ * `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`,
1469
+ * `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`,
1470
+ * `sum`, `sumBy`, `template`, `times`, `toLower`, `toInteger`, `toLength`,
1471
+ * `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,
1472
+ * `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,
1473
+ * `value`, and `words`
1443
1474
  *
1444
1475
  * @name _
1445
1476
  * @constructor
@@ -1510,7 +1541,7 @@
1510
1541
  *
1511
1542
  * @static
1512
1543
  * @memberOf _
1513
- * @type Object
1544
+ * @type {Object}
1514
1545
  */
1515
1546
  lodash.templateSettings = {
1516
1547
 
@@ -1518,7 +1549,7 @@
1518
1549
  * Used to detect `data` property values to be HTML-escaped.
1519
1550
  *
1520
1551
  * @memberOf _.templateSettings
1521
- * @type RegExp
1552
+ * @type {RegExp}
1522
1553
  */
1523
1554
  'escape': reEscape,
1524
1555
 
@@ -1526,7 +1557,7 @@
1526
1557
  * Used to detect code to be evaluated.
1527
1558
  *
1528
1559
  * @memberOf _.templateSettings
1529
- * @type RegExp
1560
+ * @type {RegExp}
1530
1561
  */
1531
1562
  'evaluate': reEvaluate,
1532
1563
 
@@ -1534,7 +1565,7 @@
1534
1565
  * Used to detect `data` property values to inject.
1535
1566
  *
1536
1567
  * @memberOf _.templateSettings
1537
- * @type RegExp
1568
+ * @type {RegExp}
1538
1569
  */
1539
1570
  'interpolate': reInterpolate,
1540
1571
 
@@ -1542,7 +1573,7 @@
1542
1573
  * Used to reference the data object in the template text.
1543
1574
  *
1544
1575
  * @memberOf _.templateSettings
1545
- * @type string
1576
+ * @type {string}
1546
1577
  */
1547
1578
  'variable': '',
1548
1579
 
@@ -1550,7 +1581,7 @@
1550
1581
  * Used to import variables into the compiled template.
1551
1582
  *
1552
1583
  * @memberOf _.templateSettings
1553
- * @type Object
1584
+ * @type {Object}
1554
1585
  */
1555
1586
  'imports': {
1556
1587
 
@@ -1558,7 +1589,7 @@
1558
1589
  * A reference to the `lodash` function.
1559
1590
  *
1560
1591
  * @memberOf _.templateSettings.imports
1561
- * @type Function
1592
+ * @type {Function}
1562
1593
  */
1563
1594
  '_': lodash
1564
1595
  }
@@ -1570,6 +1601,7 @@
1570
1601
  * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
1571
1602
  *
1572
1603
  * @private
1604
+ * @constructor
1573
1605
  * @param {*} value The value to wrap.
1574
1606
  */
1575
1607
  function LazyWrapper(value) {
@@ -1645,7 +1677,8 @@
1645
1677
  resIndex = 0,
1646
1678
  takeCount = nativeMin(length, this.__takeCount__);
1647
1679
 
1648
- if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
1680
+ if (!isArr || arrLength < LARGE_ARRAY_SIZE ||
1681
+ (arrLength == length && takeCount == length)) {
1649
1682
  return baseWrapperValue(array, this.__actions__);
1650
1683
  }
1651
1684
  var result = [];
@@ -1684,6 +1717,7 @@
1684
1717
  * Creates an hash object.
1685
1718
  *
1686
1719
  * @private
1720
+ * @constructor
1687
1721
  * @returns {Object} Returns the new hash object.
1688
1722
  */
1689
1723
  function Hash() {}
@@ -1746,6 +1780,7 @@
1746
1780
  * Creates a map cache object to store key-value pairs.
1747
1781
  *
1748
1782
  * @private
1783
+ * @constructor
1749
1784
  * @param {Array} [values] The values to cache.
1750
1785
  */
1751
1786
  function MapCache(values) {
@@ -1767,7 +1802,11 @@
1767
1802
  * @memberOf MapCache
1768
1803
  */
1769
1804
  function mapClear() {
1770
- this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };
1805
+ this.__data__ = {
1806
+ 'hash': new Hash,
1807
+ 'map': Map ? new Map : [],
1808
+ 'string': new Hash
1809
+ };
1771
1810
  }
1772
1811
 
1773
1812
  /**
@@ -1850,6 +1889,7 @@
1850
1889
  * Creates a set cache object to store unique values.
1851
1890
  *
1852
1891
  * @private
1892
+ * @constructor
1853
1893
  * @param {Array} [values] The values to cache.
1854
1894
  */
1855
1895
  function SetCache(values) {
@@ -1908,6 +1948,7 @@
1908
1948
  * Creates a stack cache object to store key-value pairs.
1909
1949
  *
1910
1950
  * @private
1951
+ * @constructor
1911
1952
  * @param {Array} [values] The values to cache.
1912
1953
  */
1913
1954
  function Stack(values) {
@@ -2141,8 +2182,7 @@
2141
2182
  */
2142
2183
  function assignValue(object, key, value) {
2143
2184
  var objValue = object[key];
2144
- if ((!eq(objValue, value) ||
2145
- (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||
2185
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
2146
2186
  (value === undefined && !(key in object))) {
2147
2187
  object[key] = value;
2148
2188
  }
@@ -2199,6 +2239,39 @@
2199
2239
  return result;
2200
2240
  }
2201
2241
 
2242
+ /**
2243
+ * Casts `value` to an empty array if it's not an array like object.
2244
+ *
2245
+ * @private
2246
+ * @param {*} value The value to inspect.
2247
+ * @returns {Array} Returns the array-like object.
2248
+ */
2249
+ function baseCastArrayLikeObject(value) {
2250
+ return isArrayLikeObject(value) ? value : [];
2251
+ }
2252
+
2253
+ /**
2254
+ * Casts `value` to `identity` if it's not a function.
2255
+ *
2256
+ * @private
2257
+ * @param {*} value The value to inspect.
2258
+ * @returns {Array} Returns the array-like object.
2259
+ */
2260
+ function baseCastFunction(value) {
2261
+ return typeof value == 'function' ? value : identity;
2262
+ }
2263
+
2264
+ /**
2265
+ * Casts `value` to a path array if it's not one.
2266
+ *
2267
+ * @private
2268
+ * @param {*} value The value to inspect.
2269
+ * @returns {Array} Returns the cast property path array.
2270
+ */
2271
+ function baseCastPath(value) {
2272
+ return isArray(value) ? value : stringToPath(value);
2273
+ }
2274
+
2202
2275
  /**
2203
2276
  * The base implementation of `_.clamp` which doesn't coerce arguments to numbers.
2204
2277
  *
@@ -2266,9 +2339,10 @@
2266
2339
  return copySymbols(value, baseAssign(result, value));
2267
2340
  }
2268
2341
  } else {
2269
- return cloneableTags[tag]
2270
- ? initCloneByTag(value, tag, isDeep)
2271
- : (object ? value : {});
2342
+ if (!cloneableTags[tag]) {
2343
+ return object ? value : {};
2344
+ }
2345
+ result = initCloneByTag(value, tag, isDeep);
2272
2346
  }
2273
2347
  }
2274
2348
  // Check for circular references and return its corresponding clone.
@@ -2323,17 +2397,9 @@
2323
2397
  * @param {Object} prototype The object to inherit from.
2324
2398
  * @returns {Object} Returns the new object.
2325
2399
  */
2326
- var baseCreate = (function() {
2327
- function object() {}
2328
- return function(prototype) {
2329
- if (isObject(prototype)) {
2330
- object.prototype = prototype;
2331
- var result = new object;
2332
- object.prototype = undefined;
2333
- }
2334
- return result || {};
2335
- };
2336
- }());
2400
+ function baseCreate(proto) {
2401
+ return isObject(proto) ? objectCreate(proto) : {};
2402
+ }
2337
2403
 
2338
2404
  /**
2339
2405
  * The base implementation of `_.delay` and `_.defer` which accepts an array
@@ -2495,12 +2561,12 @@
2495
2561
  *
2496
2562
  * @private
2497
2563
  * @param {Array} array The array to flatten.
2498
- * @param {boolean} [isDeep] Specify a deep flatten.
2564
+ * @param {number} depth The maximum recursion depth.
2499
2565
  * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
2500
2566
  * @param {Array} [result=[]] The initial result value.
2501
2567
  * @returns {Array} Returns the new flattened array.
2502
2568
  */
2503
- function baseFlatten(array, isDeep, isStrict, result) {
2569
+ function baseFlatten(array, depth, isStrict, result) {
2504
2570
  result || (result = []);
2505
2571
 
2506
2572
  var index = -1,
@@ -2508,11 +2574,11 @@
2508
2574
 
2509
2575
  while (++index < length) {
2510
2576
  var value = array[index];
2511
- if (isArrayLikeObject(value) &&
2577
+ if (depth > 0 && isArrayLikeObject(value) &&
2512
2578
  (isStrict || isArray(value) || isArguments(value))) {
2513
- if (isDeep) {
2579
+ if (depth > 1) {
2514
2580
  // Recursively flatten arrays (susceptible to call stack limits).
2515
- baseFlatten(value, isDeep, isStrict, result);
2581
+ baseFlatten(value, depth - 1, isStrict, result);
2516
2582
  } else {
2517
2583
  arrayPush(result, value);
2518
2584
  }
@@ -2609,7 +2675,7 @@
2609
2675
  * @returns {*} Returns the resolved value.
2610
2676
  */
2611
2677
  function baseGet(object, path) {
2612
- path = isKey(path, object) ? [path + ''] : baseToPath(path);
2678
+ path = isKey(path, object) ? [path + ''] : baseCastPath(path);
2613
2679
 
2614
2680
  var index = 0,
2615
2681
  length = path.length;
@@ -2698,11 +2764,17 @@
2698
2764
  var value = array[index],
2699
2765
  computed = iteratee ? iteratee(value) : value;
2700
2766
 
2701
- if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) {
2767
+ if (!(seen
2768
+ ? cacheHas(seen, computed)
2769
+ : includes(result, computed, comparator)
2770
+ )) {
2702
2771
  var othIndex = othLength;
2703
2772
  while (--othIndex) {
2704
2773
  var cache = caches[othIndex];
2705
- if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) {
2774
+ if (!(cache
2775
+ ? cacheHas(cache, computed)
2776
+ : includes(arrays[othIndex], computed, comparator))
2777
+ ) {
2706
2778
  continue outer;
2707
2779
  }
2708
2780
  }
@@ -2745,7 +2817,7 @@
2745
2817
  */
2746
2818
  function baseInvoke(object, path, args) {
2747
2819
  if (!isKey(path, object)) {
2748
- path = baseToPath(path);
2820
+ path = baseCastPath(path);
2749
2821
  object = parent(object, path);
2750
2822
  path = last(path);
2751
2823
  }
@@ -2918,7 +2990,6 @@
2918
2990
  * property of prototypes or treat sparse arrays as dense.
2919
2991
  *
2920
2992
  * @private
2921
- * @type Function
2922
2993
  * @param {Object} object The object to query.
2923
2994
  * @returns {Array} Returns the array of property names.
2924
2995
  */
@@ -3026,7 +3097,10 @@
3026
3097
  if (object === source) {
3027
3098
  return;
3028
3099
  }
3029
- var props = (isArray(source) || isTypedArray(source)) ? undefined : keysIn(source);
3100
+ var props = (isArray(source) || isTypedArray(source))
3101
+ ? undefined
3102
+ : keysIn(source);
3103
+
3030
3104
  arrayEach(props || source, function(srcValue, key) {
3031
3105
  if (props) {
3032
3106
  key = srcValue;
@@ -3037,7 +3111,10 @@
3037
3111
  baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
3038
3112
  }
3039
3113
  else {
3040
- var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined;
3114
+ var newValue = customizer
3115
+ ? customizer(object[key], srcValue, (key + ''), object, source, stack)
3116
+ : undefined;
3117
+
3041
3118
  if (newValue === undefined) {
3042
3119
  newValue = srcValue;
3043
3120
  }
@@ -3069,21 +3146,24 @@
3069
3146
  assignMergeValue(object, key, stacked);
3070
3147
  return;
3071
3148
  }
3072
- var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined,
3073
- isCommon = newValue === undefined;
3149
+ var newValue = customizer
3150
+ ? customizer(objValue, srcValue, (key + ''), object, source, stack)
3151
+ : undefined;
3152
+
3153
+ var isCommon = newValue === undefined;
3074
3154
 
3075
3155
  if (isCommon) {
3076
3156
  newValue = srcValue;
3077
3157
  if (isArray(srcValue) || isTypedArray(srcValue)) {
3078
3158
  if (isArray(objValue)) {
3079
- newValue = srcIndex ? copyArray(objValue) : objValue;
3159
+ newValue = objValue;
3080
3160
  }
3081
3161
  else if (isArrayLikeObject(objValue)) {
3082
3162
  newValue = copyArray(objValue);
3083
3163
  }
3084
3164
  else {
3085
3165
  isCommon = false;
3086
- newValue = baseClone(srcValue);
3166
+ newValue = baseClone(srcValue, true);
3087
3167
  }
3088
3168
  }
3089
3169
  else if (isPlainObject(srcValue) || isArguments(srcValue)) {
@@ -3092,10 +3172,10 @@
3092
3172
  }
3093
3173
  else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
3094
3174
  isCommon = false;
3095
- newValue = baseClone(srcValue);
3175
+ newValue = baseClone(srcValue, true);
3096
3176
  }
3097
3177
  else {
3098
- newValue = srcIndex ? baseClone(objValue) : objValue;
3178
+ newValue = objValue;
3099
3179
  }
3100
3180
  }
3101
3181
  else {
@@ -3269,7 +3349,7 @@
3269
3349
  splice.call(array, index, 1);
3270
3350
  }
3271
3351
  else if (!isKey(index, array)) {
3272
- var path = baseToPath(index),
3352
+ var path = baseCastPath(index),
3273
3353
  object = parent(array, path);
3274
3354
 
3275
3355
  if (object != null) {
@@ -3331,7 +3411,7 @@
3331
3411
  * @returns {Object} Returns `object`.
3332
3412
  */
3333
3413
  function baseSet(object, path, value, customizer) {
3334
- path = isKey(path, object) ? [path + ''] : baseToPath(path);
3414
+ path = isKey(path, object) ? [path + ''] : baseCastPath(path);
3335
3415
 
3336
3416
  var index = -1,
3337
3417
  length = path.length,
@@ -3346,7 +3426,9 @@
3346
3426
  var objValue = nested[key];
3347
3427
  newValue = customizer ? customizer(objValue, key, nested) : undefined;
3348
3428
  if (newValue === undefined) {
3349
- newValue = objValue == null ? (isIndex(path[index + 1]) ? [] : {}) : objValue;
3429
+ newValue = objValue == null
3430
+ ? (isIndex(path[index + 1]) ? [] : {})
3431
+ : objValue;
3350
3432
  }
3351
3433
  }
3352
3434
  assignValue(nested, key, newValue);
@@ -3537,18 +3619,6 @@
3537
3619
  return result;
3538
3620
  }
3539
3621
 
3540
- /**
3541
- * The base implementation of `_.toPath` which only converts `value` to a
3542
- * path if it's not one.
3543
- *
3544
- * @private
3545
- * @param {*} value The value to process.
3546
- * @returns {Array} Returns the property path array.
3547
- */
3548
- function baseToPath(value) {
3549
- return isArray(value) ? value : stringToPath(value);
3550
- }
3551
-
3552
3622
  /**
3553
3623
  * The base implementation of `_.uniqBy` without support for iteratee shorthands.
3554
3624
  *
@@ -3618,7 +3688,7 @@
3618
3688
  * @returns {boolean} Returns `true` if the property is deleted, else `false`.
3619
3689
  */
3620
3690
  function baseUnset(object, path) {
3621
- path = isKey(path, object) ? [path + ''] : baseToPath(path);
3691
+ path = isKey(path, object) ? [path + ''] : baseCastPath(path);
3622
3692
  object = parent(object, path);
3623
3693
  var key = last(path);
3624
3694
  return (object != null && has(object, key)) ? delete object[key] : true;
@@ -3807,10 +3877,11 @@
3807
3877
  * @returns {Object} Returns the cloned typed array.
3808
3878
  */
3809
3879
  function cloneTypedArray(typedArray, isDeep) {
3810
- var buffer = typedArray.buffer,
3880
+ var arrayBuffer = typedArray.buffer,
3881
+ buffer = isDeep ? cloneArrayBuffer(arrayBuffer) : arrayBuffer,
3811
3882
  Ctor = typedArray.constructor;
3812
3883
 
3813
- return new Ctor(isDeep ? cloneArrayBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length);
3884
+ return new Ctor(buffer, typedArray.byteOffset, typedArray.length);
3814
3885
  }
3815
3886
 
3816
3887
  /**
@@ -3821,23 +3892,28 @@
3821
3892
  * @param {Array|Object} args The provided arguments.
3822
3893
  * @param {Array} partials The arguments to prepend to those provided.
3823
3894
  * @param {Array} holders The `partials` placeholder indexes.
3895
+ * @params {boolean} [isCurried] Specify composing for a curried function.
3824
3896
  * @returns {Array} Returns the new array of composed arguments.
3825
3897
  */
3826
- function composeArgs(args, partials, holders) {
3827
- var holdersLength = holders.length,
3828
- argsIndex = -1,
3829
- argsLength = nativeMax(args.length - holdersLength, 0),
3898
+ function composeArgs(args, partials, holders, isCurried) {
3899
+ var argsIndex = -1,
3900
+ argsLength = args.length,
3901
+ holdersLength = holders.length,
3830
3902
  leftIndex = -1,
3831
3903
  leftLength = partials.length,
3832
- result = Array(leftLength + argsLength);
3904
+ rangeLength = nativeMax(argsLength - holdersLength, 0),
3905
+ result = Array(leftLength + rangeLength),
3906
+ isUncurried = !isCurried;
3833
3907
 
3834
3908
  while (++leftIndex < leftLength) {
3835
3909
  result[leftIndex] = partials[leftIndex];
3836
3910
  }
3837
3911
  while (++argsIndex < holdersLength) {
3838
- result[holders[argsIndex]] = args[argsIndex];
3912
+ if (isUncurried || argsIndex < argsLength) {
3913
+ result[holders[argsIndex]] = args[argsIndex];
3914
+ }
3839
3915
  }
3840
- while (argsLength--) {
3916
+ while (rangeLength--) {
3841
3917
  result[leftIndex++] = args[argsIndex++];
3842
3918
  }
3843
3919
  return result;
@@ -3851,18 +3927,21 @@
3851
3927
  * @param {Array|Object} args The provided arguments.
3852
3928
  * @param {Array} partials The arguments to append to those provided.
3853
3929
  * @param {Array} holders The `partials` placeholder indexes.
3930
+ * @params {boolean} [isCurried] Specify composing for a curried function.
3854
3931
  * @returns {Array} Returns the new array of composed arguments.
3855
3932
  */
3856
- function composeArgsRight(args, partials, holders) {
3857
- var holdersIndex = -1,
3933
+ function composeArgsRight(args, partials, holders, isCurried) {
3934
+ var argsIndex = -1,
3935
+ argsLength = args.length,
3936
+ holdersIndex = -1,
3858
3937
  holdersLength = holders.length,
3859
- argsIndex = -1,
3860
- argsLength = nativeMax(args.length - holdersLength, 0),
3861
3938
  rightIndex = -1,
3862
3939
  rightLength = partials.length,
3863
- result = Array(argsLength + rightLength);
3940
+ rangeLength = nativeMax(argsLength - holdersLength, 0),
3941
+ result = Array(rangeLength + rightLength),
3942
+ isUncurried = !isCurried;
3864
3943
 
3865
- while (++argsIndex < argsLength) {
3944
+ while (++argsIndex < rangeLength) {
3866
3945
  result[argsIndex] = args[argsIndex];
3867
3946
  }
3868
3947
  var offset = argsIndex;
@@ -3870,7 +3949,9 @@
3870
3949
  result[offset + rightIndex] = partials[rightIndex];
3871
3950
  }
3872
3951
  while (++holdersIndex < holdersLength) {
3873
- result[offset + holders[holdersIndex]] = args[argsIndex++];
3952
+ if (isUncurried || argsIndex < argsLength) {
3953
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
3954
+ }
3874
3955
  }
3875
3956
  return result;
3876
3957
  }
@@ -3925,8 +4006,11 @@
3925
4006
  length = props.length;
3926
4007
 
3927
4008
  while (++index < length) {
3928
- var key = props[index],
3929
- newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key];
4009
+ var key = props[index];
4010
+
4011
+ var newValue = customizer
4012
+ ? customizer(object[key], source[key], key, object, source)
4013
+ : source[key];
3930
4014
 
3931
4015
  assignValue(object, key, newValue);
3932
4016
  }
@@ -3976,7 +4060,10 @@
3976
4060
  customizer = length > 1 ? sources[length - 1] : undefined,
3977
4061
  guard = length > 2 ? sources[2] : undefined;
3978
4062
 
3979
- customizer = typeof customizer == 'function' ? (length--, customizer) : undefined;
4063
+ customizer = typeof customizer == 'function'
4064
+ ? (length--, customizer)
4065
+ : undefined;
4066
+
3980
4067
  if (guard && isIterateeCall(sources[0], sources[1], guard)) {
3981
4068
  customizer = length < 3 ? undefined : customizer;
3982
4069
  length = 1;
@@ -4077,8 +4164,11 @@
4077
4164
  return function(string) {
4078
4165
  string = toString(string);
4079
4166
 
4080
- var strSymbols = reHasComplexSymbol.test(string) ? stringToArray(string) : undefined,
4081
- chr = strSymbols ? strSymbols[0] : string.charAt(0),
4167
+ var strSymbols = reHasComplexSymbol.test(string)
4168
+ ? stringToArray(string)
4169
+ : undefined;
4170
+
4171
+ var chr = strSymbols ? strSymbols[0] : string.charAt(0),
4082
4172
  trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1);
4083
4173
 
4084
4174
  return chr[methodName]() + trailing;
@@ -4145,10 +4235,9 @@
4145
4235
 
4146
4236
  function wrapper() {
4147
4237
  var length = arguments.length,
4148
- index = length,
4149
4238
  args = Array(length),
4150
- fn = (this && this !== root && this instanceof wrapper) ? Ctor : func,
4151
- placeholder = lodash.placeholder || wrapper.placeholder;
4239
+ index = length,
4240
+ placeholder = getPlaceholder(wrapper);
4152
4241
 
4153
4242
  while (index--) {
4154
4243
  args[index] = arguments[index];
@@ -4158,9 +4247,13 @@
4158
4247
  : replaceHolders(args, placeholder);
4159
4248
 
4160
4249
  length -= holders.length;
4161
- return length < arity
4162
- ? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length)
4163
- : apply(fn, this, args);
4250
+ if (length < arity) {
4251
+ return createRecurryWrapper(
4252
+ func, bitmask, createHybridWrapper, wrapper.placeholder, undefined,
4253
+ args, holders, undefined, undefined, arity - length);
4254
+ }
4255
+ var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
4256
+ return apply(fn, this, args);
4164
4257
  }
4165
4258
  return wrapper;
4166
4259
  }
@@ -4174,7 +4267,7 @@
4174
4267
  */
4175
4268
  function createFlow(fromRight) {
4176
4269
  return rest(function(funcs) {
4177
- funcs = baseFlatten(funcs);
4270
+ funcs = baseFlatten(funcs, 1);
4178
4271
 
4179
4272
  var length = funcs.length,
4180
4273
  index = length,
@@ -4199,7 +4292,10 @@
4199
4292
  var funcName = getFuncName(func),
4200
4293
  data = funcName == 'wrapper' ? getData(func) : undefined;
4201
4294
 
4202
- if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
4295
+ if (data && isLaziable(data[0]) &&
4296
+ data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) &&
4297
+ !data[4].length && data[9] == 1
4298
+ ) {
4203
4299
  wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
4204
4300
  } else {
4205
4301
  wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
@@ -4209,7 +4305,8 @@
4209
4305
  var args = arguments,
4210
4306
  value = args[0];
4211
4307
 
4212
- if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
4308
+ if (wrapper && args.length == 1 &&
4309
+ isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
4213
4310
  return wrapper.plant(value).value();
4214
4311
  }
4215
4312
  var index = 0,
@@ -4244,8 +4341,7 @@
4244
4341
  var isAry = bitmask & ARY_FLAG,
4245
4342
  isBind = bitmask & BIND_FLAG,
4246
4343
  isBindKey = bitmask & BIND_KEY_FLAG,
4247
- isCurry = bitmask & CURRY_FLAG,
4248
- isCurryRight = bitmask & CURRY_RIGHT_FLAG,
4344
+ isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG),
4249
4345
  isFlip = bitmask & FLIP_FLAG,
4250
4346
  Ctor = isBindKey ? undefined : createCtorWrapper(func);
4251
4347
 
@@ -4257,30 +4353,34 @@
4257
4353
  while (index--) {
4258
4354
  args[index] = arguments[index];
4259
4355
  }
4356
+ if (isCurried) {
4357
+ var placeholder = getPlaceholder(wrapper),
4358
+ holdersCount = countHolders(args, placeholder);
4359
+ }
4260
4360
  if (partials) {
4261
- args = composeArgs(args, partials, holders);
4361
+ args = composeArgs(args, partials, holders, isCurried);
4262
4362
  }
4263
4363
  if (partialsRight) {
4264
- args = composeArgsRight(args, partialsRight, holdersRight);
4364
+ args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
4265
4365
  }
4266
- if (isCurry || isCurryRight) {
4267
- var placeholder = lodash.placeholder || wrapper.placeholder,
4268
- argsHolders = replaceHolders(args, placeholder);
4269
-
4270
- length -= argsHolders.length;
4271
- if (length < arity) {
4272
- return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length);
4273
- }
4366
+ length -= holdersCount;
4367
+ if (isCurried && length < arity) {
4368
+ var newHolders = replaceHolders(args, placeholder);
4369
+ return createRecurryWrapper(
4370
+ func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg,
4371
+ args, newHolders, argPos, ary, arity - length
4372
+ );
4274
4373
  }
4275
4374
  var thisBinding = isBind ? thisArg : this,
4276
4375
  fn = isBindKey ? thisBinding[func] : func;
4277
4376
 
4377
+ length = args.length;
4278
4378
  if (argPos) {
4279
4379
  args = reorder(args, argPos);
4280
- } else if (isFlip && args.length > 1) {
4380
+ } else if (isFlip && length > 1) {
4281
4381
  args.reverse();
4282
4382
  }
4283
- if (isAry && ary < args.length) {
4383
+ if (isAry && ary < length) {
4284
4384
  args.length = ary;
4285
4385
  }
4286
4386
  if (this && this !== root && this instanceof wrapper) {
@@ -4314,7 +4414,7 @@
4314
4414
  */
4315
4415
  function createOver(arrayFunc) {
4316
4416
  return rest(function(iteratees) {
4317
- iteratees = arrayMap(baseFlatten(iteratees), getIteratee());
4417
+ iteratees = arrayMap(baseFlatten(iteratees, 1), getIteratee());
4318
4418
  return rest(function(args) {
4319
4419
  var thisArg = this;
4320
4420
  return arrayFunc(iteratees, function(iteratee) {
@@ -4418,7 +4518,7 @@
4418
4518
  * @param {Function} func The function to wrap.
4419
4519
  * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details.
4420
4520
  * @param {Function} wrapFunc The function to create the `func` wrapper.
4421
- * @param {*} placeholder The placeholder to replace.
4521
+ * @param {*} placeholder The placeholder value.
4422
4522
  * @param {*} [thisArg] The `this` binding of `func`.
4423
4523
  * @param {Array} [partials] The arguments to prepend to those provided to the new function.
4424
4524
  * @param {Array} [holders] The `partials` placeholder indexes.
@@ -4430,7 +4530,7 @@
4430
4530
  function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
4431
4531
  var isCurry = bitmask & CURRY_FLAG,
4432
4532
  newArgPos = argPos ? copyArray(argPos) : undefined,
4433
- newsHolders = isCurry ? holders : undefined,
4533
+ newHolders = isCurry ? holders : undefined,
4434
4534
  newHoldersRight = isCurry ? undefined : holders,
4435
4535
  newPartials = isCurry ? partials : undefined,
4436
4536
  newPartialsRight = isCurry ? undefined : partials;
@@ -4441,9 +4541,12 @@
4441
4541
  if (!(bitmask & CURRY_BOUND_FLAG)) {
4442
4542
  bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
4443
4543
  }
4444
- var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity],
4445
- result = wrapFunc.apply(undefined, newData);
4544
+ var newData = [
4545
+ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
4546
+ newHoldersRight, newArgPos, ary, arity
4547
+ ];
4446
4548
 
4549
+ var result = wrapFunc.apply(undefined, newData);
4447
4550
  if (isLaziable(func)) {
4448
4551
  setData(result, newData);
4449
4552
  }
@@ -4532,8 +4635,12 @@
4532
4635
 
4533
4636
  partials = holders = undefined;
4534
4637
  }
4535
- var data = isBindKey ? undefined : getData(func),
4536
- newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
4638
+ var data = isBindKey ? undefined : getData(func);
4639
+
4640
+ var newData = [
4641
+ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
4642
+ argPos, ary, arity
4643
+ ];
4537
4644
 
4538
4645
  if (data) {
4539
4646
  mergeData(newData, data);
@@ -4856,6 +4963,18 @@
4856
4963
  return isNative(value) ? value : undefined;
4857
4964
  }
4858
4965
 
4966
+ /**
4967
+ * Gets the argument placeholder value for `func`.
4968
+ *
4969
+ * @private
4970
+ * @param {Function} func The function to inspect.
4971
+ * @returns {*} Returns the placeholder value.
4972
+ */
4973
+ function getPlaceholder(func) {
4974
+ var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
4975
+ return object.placeholder;
4976
+ }
4977
+
4859
4978
  /**
4860
4979
  * Creates an array of the own symbol properties of `object`.
4861
4980
  *
@@ -4941,7 +5060,7 @@
4941
5060
  }
4942
5061
  var result = hasFunc(object, path);
4943
5062
  if (!result && !isKey(path)) {
4944
- path = baseToPath(path);
5063
+ path = baseCastPath(path);
4945
5064
  object = parent(object, path);
4946
5065
  if (object != null) {
4947
5066
  path = last(path);
@@ -4982,11 +5101,9 @@
4982
5101
  * @returns {Object} Returns the initialized clone.
4983
5102
  */
4984
5103
  function initCloneObject(object) {
4985
- if (isPrototype(object)) {
4986
- return {};
4987
- }
4988
- var Ctor = object.constructor;
4989
- return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
5104
+ return (isFunction(object.constructor) && !isPrototype(object))
5105
+ ? baseCreate(getPrototypeOf(object))
5106
+ : {};
4990
5107
  }
4991
5108
 
4992
5109
  /**
@@ -5100,7 +5217,7 @@
5100
5217
  function isKeyable(value) {
5101
5218
  var type = typeof value;
5102
5219
  return type == 'number' || type == 'boolean' ||
5103
- (type == 'string' && value !== '__proto__') || value == null;
5220
+ (type == 'string' && value != '__proto__') || value == null;
5104
5221
  }
5105
5222
 
5106
5223
  /**
@@ -5133,7 +5250,7 @@
5133
5250
  */
5134
5251
  function isPrototype(value) {
5135
5252
  var Ctor = value && value.constructor,
5136
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
5253
+ proto = (isFunction(Ctor) && Ctor.prototype) || objectProto;
5137
5254
 
5138
5255
  return value === proto;
5139
5256
  }
@@ -5172,9 +5289,9 @@
5172
5289
  isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG);
5173
5290
 
5174
5291
  var isCombo =
5175
- (srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) ||
5176
- (srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
5177
- (srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
5292
+ ((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) ||
5293
+ ((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
5294
+ ((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
5178
5295
 
5179
5296
  // Exit early if metadata can't be merged.
5180
5297
  if (!(isCommon || isCombo)) {
@@ -5184,7 +5301,7 @@
5184
5301
  if (srcBitmask & BIND_FLAG) {
5185
5302
  data[2] = source[2];
5186
5303
  // Set when currying a bound function.
5187
- newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
5304
+ newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG;
5188
5305
  }
5189
5306
  // Compose partial arguments.
5190
5307
  var value = source[3];
@@ -5322,28 +5439,6 @@
5322
5439
  return result;
5323
5440
  }
5324
5441
 
5325
- /**
5326
- * Converts `value` to an array-like object if it's not one.
5327
- *
5328
- * @private
5329
- * @param {*} value The value to process.
5330
- * @returns {Array} Returns the array-like object.
5331
- */
5332
- function toArrayLikeObject(value) {
5333
- return isArrayLikeObject(value) ? value : [];
5334
- }
5335
-
5336
- /**
5337
- * Converts `value` to a function if it's not one.
5338
- *
5339
- * @private
5340
- * @param {*} value The value to process.
5341
- * @returns {Function} Returns the function.
5342
- */
5343
- function toFunction(value) {
5344
- return typeof value == 'function' ? value : identity;
5345
- }
5346
-
5347
5442
  /**
5348
5443
  * Creates a clone of `wrapper`.
5349
5444
  *
@@ -5454,7 +5549,7 @@
5454
5549
  if (!isArray(array)) {
5455
5550
  array = array == null ? [] : [Object(array)];
5456
5551
  }
5457
- values = baseFlatten(values);
5552
+ values = baseFlatten(values, 1);
5458
5553
  return arrayConcat(array, values);
5459
5554
  });
5460
5555
 
@@ -5476,7 +5571,7 @@
5476
5571
  */
5477
5572
  var difference = rest(function(array, values) {
5478
5573
  return isArrayLikeObject(array)
5479
- ? baseDifference(array, baseFlatten(values, false, true))
5574
+ ? baseDifference(array, baseFlatten(values, 1, true))
5480
5575
  : [];
5481
5576
  });
5482
5577
 
@@ -5507,7 +5602,7 @@
5507
5602
  iteratee = undefined;
5508
5603
  }
5509
5604
  return isArrayLikeObject(array)
5510
- ? baseDifference(array, baseFlatten(values, false, true), getIteratee(iteratee))
5605
+ ? baseDifference(array, baseFlatten(values, 1, true), getIteratee(iteratee))
5511
5606
  : [];
5512
5607
  });
5513
5608
 
@@ -5536,7 +5631,7 @@
5536
5631
  comparator = undefined;
5537
5632
  }
5538
5633
  return isArrayLikeObject(array)
5539
- ? baseDifference(array, baseFlatten(values, false, true), undefined, comparator)
5634
+ ? baseDifference(array, baseFlatten(values, 1, true), undefined, comparator)
5540
5635
  : [];
5541
5636
  });
5542
5637
 
@@ -5806,7 +5901,7 @@
5806
5901
  }
5807
5902
 
5808
5903
  /**
5809
- * Flattens `array` a single level.
5904
+ * Flattens `array` a single level deep.
5810
5905
  *
5811
5906
  * @static
5812
5907
  * @memberOf _
@@ -5815,30 +5910,58 @@
5815
5910
  * @returns {Array} Returns the new flattened array.
5816
5911
  * @example
5817
5912
  *
5818
- * _.flatten([1, [2, 3, [4]]]);
5819
- * // => [1, 2, 3, [4]]
5913
+ * _.flatten([1, [2, [3, [4]], 5]]);
5914
+ * // => [1, 2, [3, [4]], 5]
5820
5915
  */
5821
5916
  function flatten(array) {
5822
5917
  var length = array ? array.length : 0;
5823
- return length ? baseFlatten(array) : [];
5918
+ return length ? baseFlatten(array, 1) : [];
5824
5919
  }
5825
5920
 
5826
5921
  /**
5827
- * This method is like `_.flatten` except that it recursively flattens `array`.
5922
+ * Recursively flattens `array`.
5828
5923
  *
5829
5924
  * @static
5830
5925
  * @memberOf _
5831
5926
  * @category Array
5832
- * @param {Array} array The array to recursively flatten.
5927
+ * @param {Array} array The array to flatten.
5833
5928
  * @returns {Array} Returns the new flattened array.
5834
5929
  * @example
5835
5930
  *
5836
- * _.flattenDeep([1, [2, 3, [4]]]);
5837
- * // => [1, 2, 3, 4]
5931
+ * _.flattenDeep([1, [2, [3, [4]], 5]]);
5932
+ * // => [1, 2, 3, 4, 5]
5838
5933
  */
5839
5934
  function flattenDeep(array) {
5840
5935
  var length = array ? array.length : 0;
5841
- return length ? baseFlatten(array, true) : [];
5936
+ return length ? baseFlatten(array, INFINITY) : [];
5937
+ }
5938
+
5939
+ /**
5940
+ * Recursively flatten `array` up to `depth` times.
5941
+ *
5942
+ * @static
5943
+ * @memberOf _
5944
+ * @category Array
5945
+ * @param {Array} array The array to flatten.
5946
+ * @param {number} [depth=1] The maximum recursion depth.
5947
+ * @returns {Array} Returns the new flattened array.
5948
+ * @example
5949
+ *
5950
+ * var array = [1, [2, [3, [4]], 5]];
5951
+ *
5952
+ * _.flattenDepth(array, 1);
5953
+ * // => [1, 2, [3, [4]], 5]
5954
+ *
5955
+ * _.flattenDepth(array, 2);
5956
+ * // => [1, 2, 3, [4], 5]
5957
+ */
5958
+ function flattenDepth(array, depth) {
5959
+ var length = array ? array.length : 0;
5960
+ if (!length) {
5961
+ return [];
5962
+ }
5963
+ depth = depth === undefined ? 1 : toInteger(depth);
5964
+ return baseFlatten(array, depth);
5842
5965
  }
5843
5966
 
5844
5967
  /**
@@ -5955,7 +6078,7 @@
5955
6078
  * // => [2]
5956
6079
  */
5957
6080
  var intersection = rest(function(arrays) {
5958
- var mapped = arrayMap(arrays, toArrayLikeObject);
6081
+ var mapped = arrayMap(arrays, baseCastArrayLikeObject);
5959
6082
  return (mapped.length && mapped[0] === arrays[0])
5960
6083
  ? baseIntersection(mapped)
5961
6084
  : [];
@@ -5983,7 +6106,7 @@
5983
6106
  */
5984
6107
  var intersectionBy = rest(function(arrays) {
5985
6108
  var iteratee = last(arrays),
5986
- mapped = arrayMap(arrays, toArrayLikeObject);
6109
+ mapped = arrayMap(arrays, baseCastArrayLikeObject);
5987
6110
 
5988
6111
  if (iteratee === last(mapped)) {
5989
6112
  iteratee = undefined;
@@ -6016,7 +6139,7 @@
6016
6139
  */
6017
6140
  var intersectionWith = rest(function(arrays) {
6018
6141
  var comparator = last(arrays),
6019
- mapped = arrayMap(arrays, toArrayLikeObject);
6142
+ mapped = arrayMap(arrays, baseCastArrayLikeObject);
6020
6143
 
6021
6144
  if (comparator === last(mapped)) {
6022
6145
  comparator = undefined;
@@ -6110,7 +6233,8 @@
6110
6233
  * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
6111
6234
  * for equality comparisons.
6112
6235
  *
6113
- * **Note:** Unlike `_.without`, this method mutates `array`.
6236
+ * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
6237
+ * to remove elements from an array by predicate.
6114
6238
  *
6115
6239
  * @static
6116
6240
  * @memberOf _
@@ -6206,7 +6330,7 @@
6206
6330
  * // => [10, 20]
6207
6331
  */
6208
6332
  var pullAt = rest(function(array, indexes) {
6209
- indexes = arrayMap(baseFlatten(indexes), String);
6333
+ indexes = arrayMap(baseFlatten(indexes, 1), String);
6210
6334
 
6211
6335
  var result = baseAt(array, indexes);
6212
6336
  basePullAt(array, indexes.sort(compareAscending));
@@ -6215,10 +6339,11 @@
6215
6339
 
6216
6340
  /**
6217
6341
  * Removes all elements from `array` that `predicate` returns truthy for
6218
- * and returns an array of the removed elements. The predicate is invoked with
6219
- * three arguments: (value, index, array).
6342
+ * and returns an array of the removed elements. The predicate is invoked
6343
+ * with three arguments: (value, index, array).
6220
6344
  *
6221
- * **Note:** Unlike `_.filter`, this method mutates `array`.
6345
+ * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
6346
+ * to pull elements from an array by value.
6222
6347
  *
6223
6348
  * @static
6224
6349
  * @memberOf _
@@ -6678,7 +6803,7 @@
6678
6803
  * // => [2, 1, 4]
6679
6804
  */
6680
6805
  var union = rest(function(arrays) {
6681
- return baseUniq(baseFlatten(arrays, false, true));
6806
+ return baseUniq(baseFlatten(arrays, 1, true));
6682
6807
  });
6683
6808
 
6684
6809
  /**
@@ -6706,7 +6831,7 @@
6706
6831
  if (isArrayLikeObject(iteratee)) {
6707
6832
  iteratee = undefined;
6708
6833
  }
6709
- return baseUniq(baseFlatten(arrays, false, true), getIteratee(iteratee));
6834
+ return baseUniq(baseFlatten(arrays, 1, true), getIteratee(iteratee));
6710
6835
  });
6711
6836
 
6712
6837
  /**
@@ -6733,7 +6858,7 @@
6733
6858
  if (isArrayLikeObject(comparator)) {
6734
6859
  comparator = undefined;
6735
6860
  }
6736
- return baseUniq(baseFlatten(arrays, false, true), undefined, comparator);
6861
+ return baseUniq(baseFlatten(arrays, 1, true), undefined, comparator);
6737
6862
  });
6738
6863
 
6739
6864
  /**
@@ -7157,17 +7282,22 @@
7157
7282
  * // => ['a', 'c']
7158
7283
  */
7159
7284
  var wrapperAt = rest(function(paths) {
7160
- paths = baseFlatten(paths);
7285
+ paths = baseFlatten(paths, 1);
7161
7286
  var length = paths.length,
7162
7287
  start = length ? paths[0] : 0,
7163
7288
  value = this.__wrapped__,
7164
7289
  interceptor = function(object) { return baseAt(object, paths); };
7165
7290
 
7166
- if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
7291
+ if (length > 1 || this.__actions__.length ||
7292
+ !(value instanceof LazyWrapper) || !isIndex(start)) {
7167
7293
  return this.thru(interceptor);
7168
7294
  }
7169
7295
  value = value.slice(start, +start + (length ? 1 : 0));
7170
- value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
7296
+ value.__actions__.push({
7297
+ 'func': thru,
7298
+ 'args': [interceptor],
7299
+ 'thisArg': undefined
7300
+ });
7171
7301
  return new LodashWrapper(value, this.__chain__).thru(function(array) {
7172
7302
  if (length && !array.length) {
7173
7303
  array.push(undefined);
@@ -7378,7 +7508,11 @@
7378
7508
  wrapped = new LazyWrapper(this);
7379
7509
  }
7380
7510
  wrapped = wrapped.reverse();
7381
- wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined });
7511
+ wrapped.__actions__.push({
7512
+ 'func': thru,
7513
+ 'args': [reverse],
7514
+ 'thisArg': undefined
7515
+ });
7382
7516
  return new LodashWrapper(wrapped, this.__chain__);
7383
7517
  }
7384
7518
  return this.thru(reverse);
@@ -7597,7 +7731,7 @@
7597
7731
  * // => [1, 1, 2, 2]
7598
7732
  */
7599
7733
  function flatMap(collection, iteratee) {
7600
- return baseFlatten(map(collection, iteratee));
7734
+ return baseFlatten(map(collection, iteratee), 1);
7601
7735
  }
7602
7736
 
7603
7737
  /**
@@ -7631,7 +7765,7 @@
7631
7765
  function forEach(collection, iteratee) {
7632
7766
  return (typeof iteratee == 'function' && isArray(collection))
7633
7767
  ? arrayEach(collection, iteratee)
7634
- : baseEach(collection, toFunction(iteratee));
7768
+ : baseEach(collection, baseCastFunction(iteratee));
7635
7769
  }
7636
7770
 
7637
7771
  /**
@@ -7655,7 +7789,7 @@
7655
7789
  function forEachRight(collection, iteratee) {
7656
7790
  return (typeof iteratee == 'function' && isArray(collection))
7657
7791
  ? arrayEachRight(collection, iteratee)
7658
- : baseEachRight(collection, toFunction(iteratee));
7792
+ : baseEachRight(collection, baseCastFunction(iteratee));
7659
7793
  }
7660
7794
 
7661
7795
  /**
@@ -8219,7 +8353,7 @@
8219
8353
  } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
8220
8354
  iteratees.length = 1;
8221
8355
  }
8222
- return baseOrderBy(collection, baseFlatten(iteratees), []);
8356
+ return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
8223
8357
  });
8224
8358
 
8225
8359
  /*------------------------------------------------------------------------*/
@@ -8230,7 +8364,7 @@
8230
8364
  *
8231
8365
  * @static
8232
8366
  * @memberOf _
8233
- * @type Function
8367
+ * @type {Function}
8234
8368
  * @category Date
8235
8369
  * @returns {number} Returns the timestamp.
8236
8370
  * @example
@@ -8372,9 +8506,7 @@
8372
8506
  var bind = rest(function(func, thisArg, partials) {
8373
8507
  var bitmask = BIND_FLAG;
8374
8508
  if (partials.length) {
8375
- var placeholder = lodash.placeholder || bind.placeholder,
8376
- holders = replaceHolders(partials, placeholder);
8377
-
8509
+ var holders = replaceHolders(partials, getPlaceholder(bind));
8378
8510
  bitmask |= PARTIAL_FLAG;
8379
8511
  }
8380
8512
  return createWrapper(func, bitmask, thisArg, partials, holders);
@@ -8427,9 +8559,7 @@
8427
8559
  var bindKey = rest(function(object, key, partials) {
8428
8560
  var bitmask = BIND_FLAG | BIND_KEY_FLAG;
8429
8561
  if (partials.length) {
8430
- var placeholder = lodash.placeholder || bindKey.placeholder,
8431
- holders = replaceHolders(partials, placeholder);
8432
-
8562
+ var holders = replaceHolders(partials, getPlaceholder(bindKey));
8433
8563
  bitmask |= PARTIAL_FLAG;
8434
8564
  }
8435
8565
  return createWrapper(key, bitmask, object, partials, holders);
@@ -8478,7 +8608,7 @@
8478
8608
  function curry(func, arity, guard) {
8479
8609
  arity = guard ? undefined : arity;
8480
8610
  var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
8481
- result.placeholder = lodash.placeholder || curry.placeholder;
8611
+ result.placeholder = curry.placeholder;
8482
8612
  return result;
8483
8613
  }
8484
8614
 
@@ -8522,7 +8652,7 @@
8522
8652
  function curryRight(func, arity, guard) {
8523
8653
  arity = guard ? undefined : arity;
8524
8654
  var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
8525
- result.placeholder = lodash.placeholder || curryRight.placeholder;
8655
+ result.placeholder = curryRight.placeholder;
8526
8656
  return result;
8527
8657
  }
8528
8658
 
@@ -8656,8 +8786,10 @@
8656
8786
  if (!lastCalled && !maxTimeoutId && !leading) {
8657
8787
  lastCalled = stamp;
8658
8788
  }
8659
- var remaining = maxWait - (stamp - lastCalled),
8660
- isCalled = remaining <= 0 || remaining > maxWait;
8789
+ var remaining = maxWait - (stamp - lastCalled);
8790
+
8791
+ var isCalled = (remaining <= 0 || remaining > maxWait) &&
8792
+ (leading || maxTimeoutId);
8661
8793
 
8662
8794
  if (isCalled) {
8663
8795
  if (maxTimeoutId) {
@@ -8897,7 +9029,7 @@
8897
9029
  * // => [100, 10]
8898
9030
  */
8899
9031
  var overArgs = rest(function(func, transforms) {
8900
- transforms = arrayMap(baseFlatten(transforms), getIteratee());
9032
+ transforms = arrayMap(baseFlatten(transforms, 1), getIteratee());
8901
9033
 
8902
9034
  var funcsLength = transforms.length;
8903
9035
  return rest(function(args) {
@@ -8944,9 +9076,7 @@
8944
9076
  * // => 'hi fred'
8945
9077
  */
8946
9078
  var partial = rest(function(func, partials) {
8947
- var placeholder = lodash.placeholder || partial.placeholder,
8948
- holders = replaceHolders(partials, placeholder);
8949
-
9079
+ var holders = replaceHolders(partials, getPlaceholder(partial));
8950
9080
  return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
8951
9081
  });
8952
9082
 
@@ -8982,9 +9112,7 @@
8982
9112
  * // => 'hello fred'
8983
9113
  */
8984
9114
  var partialRight = rest(function(func, partials) {
8985
- var placeholder = lodash.placeholder || partialRight.placeholder,
8986
- holders = replaceHolders(partials, placeholder);
8987
-
9115
+ var holders = replaceHolders(partials, getPlaceholder(partialRight));
8988
9116
  return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
8989
9117
  });
8990
9118
 
@@ -9011,7 +9139,7 @@
9011
9139
  * // => ['a', 'b', 'c']
9012
9140
  */
9013
9141
  var rearg = rest(function(func, indexes) {
9014
- return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
9142
+ return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1));
9015
9143
  });
9016
9144
 
9017
9145
  /**
@@ -9163,7 +9291,11 @@
9163
9291
  leading = 'leading' in options ? !!options.leading : leading;
9164
9292
  trailing = 'trailing' in options ? !!options.trailing : trailing;
9165
9293
  }
9166
- return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing });
9294
+ return debounce(func, wait, {
9295
+ 'leading': leading,
9296
+ 'maxWait': wait,
9297
+ 'trailing': trailing
9298
+ });
9167
9299
  }
9168
9300
 
9169
9301
  /**
@@ -9194,7 +9326,7 @@
9194
9326
  * @memberOf _
9195
9327
  * @category Function
9196
9328
  * @param {*} value The value to wrap.
9197
- * @param {Function} wrapper The wrapper function.
9329
+ * @param {Function} [wrapper=identity] The wrapper function.
9198
9330
  * @returns {Function} Returns the new function.
9199
9331
  * @example
9200
9332
  *
@@ -9212,6 +9344,46 @@
9212
9344
 
9213
9345
  /*------------------------------------------------------------------------*/
9214
9346
 
9347
+ /**
9348
+ * Casts `value` as an array if it's not one.
9349
+ *
9350
+ * @static
9351
+ * @memberOf _
9352
+ * @category Lang
9353
+ * @param {*} value The value to inspect.
9354
+ * @returns {Array} Returns the cast array.
9355
+ * @example
9356
+ *
9357
+ * _.castArray(1);
9358
+ * // => [1]
9359
+ *
9360
+ * _.castArray({ 'a': 1 });
9361
+ * // => [{ 'a': 1 }]
9362
+ *
9363
+ * _.castArray('abc');
9364
+ * // => ['abc']
9365
+ *
9366
+ * _.castArray(null);
9367
+ * // => [null]
9368
+ *
9369
+ * _.castArray(undefined);
9370
+ * // => [undefined]
9371
+ *
9372
+ * _.castArray();
9373
+ * // => []
9374
+ *
9375
+ * var array = [1, 2, 3];
9376
+ * console.log(_.castArray(array) === array);
9377
+ * // => true
9378
+ */
9379
+ function castArray() {
9380
+ if (!arguments.length) {
9381
+ return [];
9382
+ }
9383
+ var value = arguments[0];
9384
+ return isArray(value) ? value : [value];
9385
+ }
9386
+
9215
9387
  /**
9216
9388
  * Creates a shallow clone of `value`.
9217
9389
  *
@@ -9432,7 +9604,7 @@
9432
9604
  *
9433
9605
  * @static
9434
9606
  * @memberOf _
9435
- * @type Function
9607
+ * @type {Function}
9436
9608
  * @category Lang
9437
9609
  * @param {*} value The value to check.
9438
9610
  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
@@ -9457,7 +9629,6 @@
9457
9629
  *
9458
9630
  * @static
9459
9631
  * @memberOf _
9460
- * @type Function
9461
9632
  * @category Lang
9462
9633
  * @param {*} value The value to check.
9463
9634
  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
@@ -9480,7 +9651,6 @@
9480
9651
  *
9481
9652
  * @static
9482
9653
  * @memberOf _
9483
- * @type Function
9484
9654
  * @category Lang
9485
9655
  * @param {*} value The value to check.
9486
9656
  * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
@@ -9509,7 +9679,6 @@
9509
9679
  *
9510
9680
  * @static
9511
9681
  * @memberOf _
9512
- * @type Function
9513
9682
  * @category Lang
9514
9683
  * @param {*} value The value to check.
9515
9684
  * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.
@@ -9641,7 +9810,8 @@
9641
9810
  */
9642
9811
  function isEmpty(value) {
9643
9812
  if (isArrayLike(value) &&
9644
- (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) {
9813
+ (isArray(value) || isString(value) ||
9814
+ isFunction(value.splice) || isArguments(value))) {
9645
9815
  return !value.length;
9646
9816
  }
9647
9817
  for (var key in value) {
@@ -9684,10 +9854,10 @@
9684
9854
  }
9685
9855
 
9686
9856
  /**
9687
- * This method is like `_.isEqual` except that it accepts `customizer` which is
9688
- * invoked to compare values. If `customizer` returns `undefined` comparisons are
9689
- * handled by the method instead. The `customizer` is invoked with up to six arguments:
9690
- * (objValue, othValue [, index|key, object, other, stack]).
9857
+ * This method is like `_.isEqual` except that it accepts `customizer` which
9858
+ * is invoked to compare values. If `customizer` returns `undefined` comparisons
9859
+ * are handled by the method instead. The `customizer` is invoked with up to
9860
+ * six arguments: (objValue, othValue [, index|key, object, other, stack]).
9691
9861
  *
9692
9862
  * @static
9693
9863
  * @memberOf _
@@ -9738,8 +9908,11 @@
9738
9908
  * // => false
9739
9909
  */
9740
9910
  function isError(value) {
9741
- return isObjectLike(value) &&
9742
- typeof value.message == 'string' && objectToString.call(value) == errorTag;
9911
+ if (!isObjectLike(value)) {
9912
+ return false;
9913
+ }
9914
+ return (objectToString.call(value) == errorTag) ||
9915
+ (typeof value.message == 'string' && typeof value.name == 'string');
9743
9916
  }
9744
9917
 
9745
9918
  /**
@@ -9847,7 +10020,8 @@
9847
10020
  * // => false
9848
10021
  */
9849
10022
  function isLength(value) {
9850
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
10023
+ return typeof value == 'number' &&
10024
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
9851
10025
  }
9852
10026
 
9853
10027
  /**
@@ -9926,8 +10100,9 @@
9926
10100
  }
9927
10101
 
9928
10102
  /**
9929
- * Performs a deep comparison between `object` and `source` to determine if
9930
- * `object` contains equivalent property values.
10103
+ * Performs a partial deep comparison between `object` and `source` to
10104
+ * determine if `object` contains equivalent property values. This method is
10105
+ * equivalent to a `_.matches` function when `source` is partially applied.
9931
10106
  *
9932
10107
  * **Note:** This method supports comparing the same values as `_.isEqual`.
9933
10108
  *
@@ -10146,13 +10321,11 @@
10146
10321
  * // => true
10147
10322
  */
10148
10323
  function isPlainObject(value) {
10149
- if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) {
10324
+ if (!isObjectLike(value) ||
10325
+ objectToString.call(value) != objectTag || isHostObject(value)) {
10150
10326
  return false;
10151
10327
  }
10152
- var proto = objectProto;
10153
- if (typeof value.constructor == 'function') {
10154
- proto = getPrototypeOf(value);
10155
- }
10328
+ var proto = getPrototypeOf(value);
10156
10329
  if (proto === null) {
10157
10330
  return true;
10158
10331
  }
@@ -10289,7 +10462,8 @@
10289
10462
  * // => false
10290
10463
  */
10291
10464
  function isTypedArray(value) {
10292
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
10465
+ return isObjectLike(value) &&
10466
+ isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
10293
10467
  }
10294
10468
 
10295
10469
  /**
@@ -10781,7 +10955,7 @@
10781
10955
  * // => ['a', 'c']
10782
10956
  */
10783
10957
  var at = rest(function(object, paths) {
10784
- return baseAt(object, baseFlatten(paths));
10958
+ return baseAt(object, baseFlatten(paths, 1));
10785
10959
  });
10786
10960
 
10787
10961
  /**
@@ -10969,7 +11143,9 @@
10969
11143
  * // => logs 'a', 'b', then 'c' (iteration order is not guaranteed)
10970
11144
  */
10971
11145
  function forIn(object, iteratee) {
10972
- return object == null ? object : baseFor(object, toFunction(iteratee), keysIn);
11146
+ return object == null
11147
+ ? object
11148
+ : baseFor(object, baseCastFunction(iteratee), keysIn);
10973
11149
  }
10974
11150
 
10975
11151
  /**
@@ -10997,7 +11173,9 @@
10997
11173
  * // => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'
10998
11174
  */
10999
11175
  function forInRight(object, iteratee) {
11000
- return object == null ? object : baseForRight(object, toFunction(iteratee), keysIn);
11176
+ return object == null
11177
+ ? object
11178
+ : baseForRight(object, baseCastFunction(iteratee), keysIn);
11001
11179
  }
11002
11180
 
11003
11181
  /**
@@ -11027,7 +11205,7 @@
11027
11205
  * // => logs 'a' then 'b' (iteration order is not guaranteed)
11028
11206
  */
11029
11207
  function forOwn(object, iteratee) {
11030
- return object && baseForOwn(object, toFunction(iteratee));
11208
+ return object && baseForOwn(object, baseCastFunction(iteratee));
11031
11209
  }
11032
11210
 
11033
11211
  /**
@@ -11055,7 +11233,7 @@
11055
11233
  * // => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'
11056
11234
  */
11057
11235
  function forOwnRight(object, iteratee) {
11058
- return object && baseForOwnRight(object, toFunction(iteratee));
11236
+ return object && baseForOwnRight(object, baseCastFunction(iteratee));
11059
11237
  }
11060
11238
 
11061
11239
  /**
@@ -11361,7 +11539,8 @@
11361
11539
  /**
11362
11540
  * The opposite of `_.mapValues`; this method creates an object with the
11363
11541
  * same values as `object` and keys generated by running each own enumerable
11364
- * property of `object` through `iteratee`.
11542
+ * property of `object` through `iteratee`. The iteratee is invoked with
11543
+ * three arguments: (value, key, object).
11365
11544
  *
11366
11545
  * @static
11367
11546
  * @memberOf _
@@ -11389,7 +11568,7 @@
11389
11568
  /**
11390
11569
  * Creates an object with the same keys as `object` and values generated by
11391
11570
  * running each own enumerable property of `object` through `iteratee`. The
11392
- * iteratee function is invoked with three arguments: (value, key, object).
11571
+ * iteratee is invoked with three arguments: (value, key, object).
11393
11572
  *
11394
11573
  * @static
11395
11574
  * @memberOf _
@@ -11422,12 +11601,12 @@
11422
11601
  }
11423
11602
 
11424
11603
  /**
11425
- * Recursively merges own and inherited enumerable properties of source
11426
- * objects into the destination object, skipping source properties that resolve
11427
- * to `undefined`. Array and plain object properties are merged recursively.
11428
- * Other objects and value types are overridden by assignment. Source objects
11429
- * are applied from left to right. Subsequent sources overwrite property
11430
- * assignments of previous sources.
11604
+ * Recursively merges own and inherited enumerable properties of source objects
11605
+ * into the destination object. Source properties that resolve to `undefined`
11606
+ * are skipped if a destination value exists. Array and plain object properties
11607
+ * are merged recursively. Other objects and value types are overridden by
11608
+ * assignment. Source objects are applied from left to right. Subsequent
11609
+ * sources overwrite property assignments of previous sources.
11431
11610
  *
11432
11611
  * **Note:** This method mutates `object`.
11433
11612
  *
@@ -11504,7 +11683,7 @@
11504
11683
  * @category Object
11505
11684
  * @param {Object} object The source object.
11506
11685
  * @param {...(string|string[])} [props] The property names to omit, specified
11507
- * individually or in arrays..
11686
+ * individually or in arrays.
11508
11687
  * @returns {Object} Returns the new object.
11509
11688
  * @example
11510
11689
  *
@@ -11517,14 +11696,15 @@
11517
11696
  if (object == null) {
11518
11697
  return {};
11519
11698
  }
11520
- props = arrayMap(baseFlatten(props), String);
11699
+ props = arrayMap(baseFlatten(props, 1), String);
11521
11700
  return basePick(object, baseDifference(keysIn(object), props));
11522
11701
  });
11523
11702
 
11524
11703
  /**
11525
- * The opposite of `_.pickBy`; this method creates an object composed of the
11526
- * own and inherited enumerable properties of `object` that `predicate`
11527
- * doesn't return truthy for.
11704
+ * The opposite of `_.pickBy`; this method creates an object composed of
11705
+ * the own and inherited enumerable properties of `object` that `predicate`
11706
+ * doesn't return truthy for. The predicate is invoked with two arguments:
11707
+ * (value, key).
11528
11708
  *
11529
11709
  * @static
11530
11710
  * @memberOf _
@@ -11540,7 +11720,7 @@
11540
11720
  * // => { 'b': '2' }
11541
11721
  */
11542
11722
  function omitBy(object, predicate) {
11543
- predicate = getIteratee(predicate, 2);
11723
+ predicate = getIteratee(predicate);
11544
11724
  return basePickBy(object, function(value, key) {
11545
11725
  return !predicate(value, key);
11546
11726
  });
@@ -11564,7 +11744,7 @@
11564
11744
  * // => { 'a': 1, 'c': 3 }
11565
11745
  */
11566
11746
  var pick = rest(function(object, props) {
11567
- return object == null ? {} : basePick(object, baseFlatten(props));
11747
+ return object == null ? {} : basePick(object, baseFlatten(props, 1));
11568
11748
  });
11569
11749
 
11570
11750
  /**
@@ -11585,7 +11765,7 @@
11585
11765
  * // => { 'a': 1, 'c': 3 }
11586
11766
  */
11587
11767
  function pickBy(object, predicate) {
11588
- return object == null ? {} : basePickBy(object, getIteratee(predicate, 2));
11768
+ return object == null ? {} : basePickBy(object, getIteratee(predicate));
11589
11769
  }
11590
11770
 
11591
11771
  /**
@@ -11618,7 +11798,7 @@
11618
11798
  */
11619
11799
  function result(object, path, defaultValue) {
11620
11800
  if (!isKey(path, object)) {
11621
- path = baseToPath(path);
11801
+ path = baseCastPath(path);
11622
11802
  var result = get(object, path);
11623
11803
  object = parent(object, path);
11624
11804
  } else {
@@ -11688,7 +11868,8 @@
11688
11868
  }
11689
11869
 
11690
11870
  /**
11691
- * Creates an array of own enumerable key-value pairs for `object`.
11871
+ * Creates an array of own enumerable key-value pairs for `object` which
11872
+ * can be consumed by `_.fromPairs`.
11692
11873
  *
11693
11874
  * @static
11694
11875
  * @memberOf _
@@ -11712,7 +11893,8 @@
11712
11893
  }
11713
11894
 
11714
11895
  /**
11715
- * Creates an array of own and inherited enumerable key-value pairs for `object`.
11896
+ * Creates an array of own and inherited enumerable key-value pairs for
11897
+ * `object` which can be consumed by `_.fromPairs`.
11716
11898
  *
11717
11899
  * @static
11718
11900
  * @memberOf _
@@ -11773,7 +11955,7 @@
11773
11955
  if (isArr) {
11774
11956
  accumulator = isArray(object) ? new Ctor : [];
11775
11957
  } else {
11776
- accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
11958
+ accumulator = isFunction(Ctor) ? baseCreate(getPrototypeOf(object)) : {};
11777
11959
  }
11778
11960
  } else {
11779
11961
  accumulator = {};
@@ -11867,7 +12049,7 @@
11867
12049
  * // => [1, 2, 3] (iteration order is not guaranteed)
11868
12050
  */
11869
12051
  function valuesIn(object) {
11870
- return object == null ? baseValues(object, keysIn(object)) : [];
12052
+ return object == null ? [] : baseValues(object, keysIn(object));
11871
12053
  }
11872
12054
 
11873
12055
  /*------------------------------------------------------------------------*/
@@ -12365,7 +12547,7 @@
12365
12547
  * @memberOf _
12366
12548
  * @category String
12367
12549
  * @param {string} string The string to convert.
12368
- * @param {number} [radix] The radix to interpret `value` by.
12550
+ * @param {number} [radix=10] The radix to interpret `value` by.
12369
12551
  * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
12370
12552
  * @returns {number} Returns the converted integer.
12371
12553
  * @example
@@ -12737,7 +12919,8 @@
12737
12919
  'return __p\n}';
12738
12920
 
12739
12921
  var result = attempt(function() {
12740
- return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
12922
+ return Function(importsKeys, sourceURL + 'return ' + source)
12923
+ .apply(undefined, importsValues);
12741
12924
  });
12742
12925
 
12743
12926
  // Provide the compiled function's source by its `toString` method or
@@ -12831,7 +13014,9 @@
12831
13014
  var strSymbols = stringToArray(string),
12832
13015
  chrSymbols = stringToArray(chars);
12833
13016
 
12834
- return strSymbols.slice(charsStartIndex(strSymbols, chrSymbols), charsEndIndex(strSymbols, chrSymbols) + 1).join('');
13017
+ return strSymbols
13018
+ .slice(charsStartIndex(strSymbols, chrSymbols), charsEndIndex(strSymbols, chrSymbols) + 1)
13019
+ .join('');
12835
13020
  }
12836
13021
 
12837
13022
  /**
@@ -12865,7 +13050,9 @@
12865
13050
  return string;
12866
13051
  }
12867
13052
  var strSymbols = stringToArray(string);
12868
- return strSymbols.slice(0, charsEndIndex(strSymbols, stringToArray(chars)) + 1).join('');
13053
+ return strSymbols
13054
+ .slice(0, charsEndIndex(strSymbols, stringToArray(chars)) + 1)
13055
+ .join('');
12869
13056
  }
12870
13057
 
12871
13058
  /**
@@ -12899,7 +13086,9 @@
12899
13086
  return string;
12900
13087
  }
12901
13088
  var strSymbols = stringToArray(string);
12902
- return strSymbols.slice(charsStartIndex(strSymbols, stringToArray(chars))).join('');
13089
+ return strSymbols
13090
+ .slice(charsStartIndex(strSymbols, stringToArray(chars)))
13091
+ .join('');
12903
13092
  }
12904
13093
 
12905
13094
  /**
@@ -12911,7 +13100,7 @@
12911
13100
  * @memberOf _
12912
13101
  * @category String
12913
13102
  * @param {string} [string=''] The string to truncate.
12914
- * @param {Object} [options] The options object.
13103
+ * @param {Object} [options=({})] The options object.
12915
13104
  * @param {number} [options.length=30] The maximum string length.
12916
13105
  * @param {string} [options.omission='...'] The string to indicate text is omitted.
12917
13106
  * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
@@ -13096,7 +13285,7 @@
13096
13285
  try {
13097
13286
  return apply(func, undefined, args);
13098
13287
  } catch (e) {
13099
- return isObject(e) ? e : new Error(e);
13288
+ return isError(e) ? e : new Error(e);
13100
13289
  }
13101
13290
  });
13102
13291
 
@@ -13127,7 +13316,7 @@
13127
13316
  * // => logs 'clicked docs' when clicked
13128
13317
  */
13129
13318
  var bindAll = rest(function(object, methodNames) {
13130
- arrayEach(baseFlatten(methodNames), function(key) {
13319
+ arrayEach(baseFlatten(methodNames, 1), function(key) {
13131
13320
  object[key] = bind(object[key], object);
13132
13321
  });
13133
13322
  return object;
@@ -13295,7 +13484,8 @@
13295
13484
  * Creates a function that invokes `func` with the arguments of the created
13296
13485
  * function. If `func` is a property name the created callback returns the
13297
13486
  * property value for a given element. If `func` is an object the created
13298
- * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`.
13487
+ * callback returns `true` for elements that contain the equivalent object
13488
+ * properties, otherwise it returns `false`.
13299
13489
  *
13300
13490
  * @static
13301
13491
  * @memberOf _
@@ -13325,9 +13515,10 @@
13325
13515
  }
13326
13516
 
13327
13517
  /**
13328
- * Creates a function that performs a deep partial comparison between a given
13518
+ * Creates a function that performs a partial deep comparison between a given
13329
13519
  * object and `source`, returning `true` if the given object has equivalent
13330
- * property values, else `false`.
13520
+ * property values, else `false`. The created function is equivalent to
13521
+ * `_.isMatch` with a `source` partially applied.
13331
13522
  *
13332
13523
  * **Note:** This method supports comparing the same values as `_.isEqual`.
13333
13524
  *
@@ -13351,7 +13542,7 @@
13351
13542
  }
13352
13543
 
13353
13544
  /**
13354
- * Creates a function that performs a deep partial comparison between the
13545
+ * Creates a function that performs a partial deep comparison between the
13355
13546
  * value at `path` of a given object to `srcValue`, returning `true` if the
13356
13547
  * object value is equivalent, else `false`.
13357
13548
  *
@@ -13760,8 +13951,8 @@
13760
13951
  var rangeRight = createRange(true);
13761
13952
 
13762
13953
  /**
13763
- * Invokes the iteratee function `n` times, returning an array of the results
13764
- * of each invocation. The iteratee is invoked with one argument; (index).
13954
+ * Invokes the iteratee `n` times, returning an array of the results of
13955
+ * each invocation. The iteratee is invoked with one argument; (index).
13765
13956
  *
13766
13957
  * @static
13767
13958
  * @memberOf _
@@ -13785,7 +13976,7 @@
13785
13976
  var index = MAX_ARRAY_LENGTH,
13786
13977
  length = nativeMin(n, MAX_ARRAY_LENGTH);
13787
13978
 
13788
- iteratee = toFunction(iteratee);
13979
+ iteratee = baseCastFunction(iteratee);
13789
13980
  n -= MAX_ARRAY_LENGTH;
13790
13981
 
13791
13982
  var result = baseTimes(length, iteratee);
@@ -13830,7 +14021,7 @@
13830
14021
  * @static
13831
14022
  * @memberOf _
13832
14023
  * @category Util
13833
- * @param {string} [prefix] The value to prefix the ID with.
14024
+ * @param {string} [prefix=''] The value to prefix the ID with.
13834
14025
  * @returns {string} Returns the unique ID.
13835
14026
  * @example
13836
14027
  *
@@ -14181,6 +14372,7 @@
14181
14372
  lodash.bind = bind;
14182
14373
  lodash.bindAll = bindAll;
14183
14374
  lodash.bindKey = bindKey;
14375
+ lodash.castArray = castArray;
14184
14376
  lodash.chain = chain;
14185
14377
  lodash.chunk = chunk;
14186
14378
  lodash.compact = compact;
@@ -14209,6 +14401,7 @@
14209
14401
  lodash.flatMap = flatMap;
14210
14402
  lodash.flatten = flatten;
14211
14403
  lodash.flattenDeep = flattenDeep;
14404
+ lodash.flattenDepth = flattenDepth;
14212
14405
  lodash.flip = flip;
14213
14406
  lodash.flow = flow;
14214
14407
  lodash.flowRight = flowRight;
@@ -14483,7 +14676,7 @@
14483
14676
  *
14484
14677
  * @static
14485
14678
  * @memberOf _
14486
- * @type string
14679
+ * @type {string}
14487
14680
  */
14488
14681
  lodash.VERSION = VERSION;
14489
14682
 
@@ -14505,7 +14698,10 @@
14505
14698
  if (filtered) {
14506
14699
  result.__takeCount__ = nativeMin(n, result.__takeCount__);
14507
14700
  } else {
14508
- result.__views__.push({ 'size': nativeMin(n, MAX_ARRAY_LENGTH), 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') });
14701
+ result.__views__.push({
14702
+ 'size': nativeMin(n, MAX_ARRAY_LENGTH),
14703
+ 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
14704
+ });
14509
14705
  }
14510
14706
  return result;
14511
14707
  };
@@ -14522,7 +14718,10 @@
14522
14718
 
14523
14719
  LazyWrapper.prototype[methodName] = function(iteratee) {
14524
14720
  var result = this.clone();
14525
- result.__iteratees__.push({ 'iteratee': getIteratee(iteratee, 3), 'type': type });
14721
+ result.__iteratees__.push({
14722
+ 'iteratee': getIteratee(iteratee, 3),
14723
+ 'type': type
14724
+ });
14526
14725
  result.__filtered__ = result.__filtered__ || isFilter;
14527
14726
  return result;
14528
14727
  };
@@ -14674,7 +14873,10 @@
14674
14873
  }
14675
14874
  });
14676
14875
 
14677
- realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }];
14876
+ realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
14877
+ 'name': 'wrapper',
14878
+ 'func': undefined
14879
+ }];
14678
14880
 
14679
14881
  // Add functions to the lazy wrapper.
14680
14882
  LazyWrapper.prototype.clone = lazyClone;