Comparing version 4.15.0 to 4.16.0
@@ -1,2 +0,3 @@ | ||
var eq = require('./eq'); | ||
var baseAssignValue = require('./_baseAssignValue'), | ||
eq = require('./eq'); | ||
@@ -15,3 +16,3 @@ /** | ||
(typeof key == 'number' && value === undefined && !(key in object))) { | ||
object[key] = value; | ||
baseAssignValue(object, key, value); | ||
} | ||
@@ -18,0 +19,0 @@ } |
@@ -1,2 +0,3 @@ | ||
var eq = require('./eq'); | ||
var baseAssignValue = require('./_baseAssignValue'), | ||
eq = require('./eq'); | ||
@@ -23,3 +24,3 @@ /** Used for built-in method references. */ | ||
(value === undefined && !(key in object))) { | ||
object[key] = value; | ||
baseAssignValue(object, key, value); | ||
} | ||
@@ -26,0 +27,0 @@ } |
@@ -15,3 +15,2 @@ var Stack = require('./_Stack'), | ||
isBuffer = require('./isBuffer'), | ||
isHostObject = require('./_isHostObject'), | ||
isObject = require('./isObject'), | ||
@@ -104,5 +103,2 @@ keys = require('./keys'); | ||
if (tag == objectTag || tag == argsTag || (isFunc && !object)) { | ||
if (isHostObject(value)) { | ||
return object ? value : {}; | ||
} | ||
result = initCloneObject(isFunc ? {} : value); | ||
@@ -109,0 +105,0 @@ if (!isDeep) { |
var baseFindIndex = require('./_baseFindIndex'), | ||
baseIsNaN = require('./_baseIsNaN'); | ||
baseIsNaN = require('./_baseIsNaN'), | ||
strictIndexOf = require('./_strictIndexOf'); | ||
@@ -14,16 +15,7 @@ /** | ||
function baseIndexOf(array, value, fromIndex) { | ||
if (value !== value) { | ||
return baseFindIndex(array, baseIsNaN, fromIndex); | ||
} | ||
var index = fromIndex - 1, | ||
length = array.length; | ||
while (++index < length) { | ||
if (array[index] === value) { | ||
return index; | ||
} | ||
} | ||
return -1; | ||
return value === value | ||
? strictIndexOf(array, value, fromIndex) | ||
: baseFindIndex(array, baseIsNaN, fromIndex); | ||
} | ||
module.exports = baseIndexOf; |
@@ -7,3 +7,2 @@ var Stack = require('./_Stack'), | ||
isArray = require('./isArray'), | ||
isHostObject = require('./_isHostObject'), | ||
isTypedArray = require('./isTypedArray'); | ||
@@ -54,4 +53,4 @@ | ||
} | ||
var objIsObj = objTag == objectTag && !isHostObject(object), | ||
othIsObj = othTag == objectTag && !isHostObject(other), | ||
var objIsObj = objTag == objectTag, | ||
othIsObj = othTag == objectTag, | ||
isSameTag = objTag == othTag; | ||
@@ -58,0 +57,0 @@ |
var isFunction = require('./isFunction'), | ||
isHostObject = require('./_isHostObject'), | ||
isMasked = require('./_isMasked'), | ||
@@ -44,3 +43,3 @@ isObject = require('./isObject'), | ||
} | ||
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; | ||
var pattern = isFunction(value) ? reIsNative : reIsHostCtor; | ||
return pattern.test(toSource(value)); | ||
@@ -47,0 +46,0 @@ } |
@@ -0,1 +1,3 @@ | ||
var baseAssignValue = require('./_baseAssignValue'); | ||
/** | ||
@@ -20,3 +22,3 @@ * The base implementation of `_.pickBy` without support for iteratee shorthands. | ||
if (predicate(value, key)) { | ||
result[key] = value; | ||
baseAssignValue(result, key, value); | ||
} | ||
@@ -23,0 +25,0 @@ } |
@@ -1,6 +0,5 @@ | ||
var apply = require('./_apply'); | ||
var identity = require('./identity'), | ||
overRest = require('./_overRest'), | ||
setToString = require('./_setToString'); | ||
/* Built-in method references for those with the same name as other `lodash` methods. */ | ||
var nativeMax = Math.max; | ||
/** | ||
@@ -15,22 +14,5 @@ * The base implementation of `_.rest` which doesn't validate or coerce arguments. | ||
function baseRest(func, start) { | ||
start = nativeMax(start === undefined ? (func.length - 1) : start, 0); | ||
return function() { | ||
var args = arguments, | ||
index = -1, | ||
length = nativeMax(args.length - start, 0), | ||
array = Array(length); | ||
while (++index < length) { | ||
array[index] = args[start + index]; | ||
} | ||
index = -1; | ||
var otherArgs = Array(start + 1); | ||
while (++index < start) { | ||
otherArgs[index] = args[index]; | ||
} | ||
otherArgs[start] = array; | ||
return apply(func, this, otherArgs); | ||
}; | ||
return setToString(overRest(func, start, identity), func + ''); | ||
} | ||
module.exports = baseRest; |
@@ -5,3 +5,3 @@ var identity = require('./identity'), | ||
/** | ||
* The base implementation of `setData` without support for hot loop detection. | ||
* The base implementation of `setData` without support for hot loop shorting. | ||
* | ||
@@ -8,0 +8,0 @@ * @private |
/** | ||
* Checks if a cache value for `key` exists. | ||
* Checks if a `cache` value for `key` exists. | ||
* | ||
@@ -4,0 +4,0 @@ * @private |
@@ -1,2 +0,3 @@ | ||
var assignValue = require('./_assignValue'); | ||
var assignValue = require('./_assignValue'), | ||
baseAssignValue = require('./_baseAssignValue'); | ||
@@ -14,2 +15,3 @@ /** | ||
function copyObject(source, props, object, customizer) { | ||
var isNew = !object; | ||
object || (object = {}); | ||
@@ -27,3 +29,10 @@ | ||
assignValue(object, key, newValue === undefined ? source[key] : newValue); | ||
if (newValue === undefined) { | ||
newValue = source[key]; | ||
} | ||
if (isNew) { | ||
baseAssignValue(object, key, newValue); | ||
} else { | ||
assignValue(object, key, newValue); | ||
} | ||
} | ||
@@ -30,0 +39,0 @@ return object; |
@@ -15,3 +15,3 @@ /** | ||
if (array[length] === placeholder) { | ||
result++; | ||
++result; | ||
} | ||
@@ -18,0 +18,0 @@ } |
var LodashWrapper = require('./_LodashWrapper'), | ||
baseFlatten = require('./_baseFlatten'), | ||
baseRest = require('./_baseRest'), | ||
flatRest = require('./_flatRest'), | ||
getData = require('./_getData'), | ||
@@ -29,5 +28,3 @@ getFuncName = require('./_getFuncName'), | ||
function createFlow(fromRight) { | ||
return baseRest(function(funcs) { | ||
funcs = baseFlatten(funcs, 1); | ||
return flatRest(function(funcs) { | ||
var length = funcs.length, | ||
@@ -34,0 +31,0 @@ index = length, |
var apply = require('./_apply'), | ||
arrayMap = require('./_arrayMap'), | ||
baseFlatten = require('./_baseFlatten'), | ||
baseIteratee = require('./_baseIteratee'), | ||
baseRest = require('./_baseRest'), | ||
baseUnary = require('./_baseUnary'), | ||
isArray = require('./isArray'); | ||
flatRest = require('./_flatRest'); | ||
@@ -17,7 +16,4 @@ /** | ||
function createOver(arrayFunc) { | ||
return baseRest(function(iteratees) { | ||
iteratees = (iteratees.length == 1 && isArray(iteratees[0])) | ||
? arrayMap(iteratees[0], baseUnary(baseIteratee)) | ||
: arrayMap(baseFlatten(iteratees, 1), baseUnary(baseIteratee)); | ||
return flatRest(function(iteratees) { | ||
iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); | ||
return baseRest(function(args) { | ||
@@ -24,0 +20,0 @@ var thisArg = this; |
@@ -58,3 +58,3 @@ var basePropertyOf = require('./_basePropertyOf'); | ||
'\u0152': 'Oe', '\u0153': 'oe', | ||
'\u0149': "'n", '\u017f': 'ss' | ||
'\u0149': "'n", '\u017f': 's' | ||
}; | ||
@@ -61,0 +61,0 @@ |
var SetCache = require('./_SetCache'), | ||
arraySome = require('./_arraySome'); | ||
arraySome = require('./_arraySome'), | ||
cacheHas = require('./_cacheHas'); | ||
@@ -62,5 +63,5 @@ /** Used to compose bitmasks for comparison styles. */ | ||
if (!arraySome(other, function(othValue, othIndex) { | ||
if (!seen.has(othIndex) && | ||
if (!cacheHas(seen, othIndex) && | ||
(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { | ||
return seen.add(othIndex); | ||
return seen.push(othIndex); | ||
} | ||
@@ -67,0 +68,0 @@ })) { |
@@ -9,4 +9,3 @@ var basePropertyOf = require('./_basePropertyOf'); | ||
'"': '"', | ||
"'": ''', | ||
'`': '`' | ||
"'": ''' | ||
}; | ||
@@ -13,0 +12,0 @@ |
@@ -44,4 +44,3 @@ var DataView = require('./_DataView'), | ||
// Fallback for data views, maps, sets, and weak maps in IE 11, | ||
// for data views in Edge < 14, and promises in Node.js. | ||
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. | ||
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || | ||
@@ -48,0 +47,0 @@ (Map && getTag(new Map) != mapTag) || |
@@ -12,4 +12,5 @@ var nativeCreate = require('./_nativeCreate'); | ||
this.__data__ = nativeCreate ? nativeCreate(null) : {}; | ||
this.size = 0; | ||
} | ||
module.exports = hashClear; |
@@ -12,5 +12,7 @@ /** | ||
function hashDelete(key) { | ||
return this.has(key) && delete this.__data__[key]; | ||
var result = this.has(key) && delete this.__data__[key]; | ||
this.size -= result ? 1 : 0; | ||
return result; | ||
} | ||
module.exports = hashDelete; |
@@ -18,2 +18,3 @@ var nativeCreate = require('./_nativeCreate'); | ||
var data = this.__data__; | ||
this.size += this.has(key) ? 0 : 1; | ||
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; | ||
@@ -20,0 +21,0 @@ return this; |
@@ -21,5 +21,5 @@ var castPath = require('./_castPath'), | ||
var result, | ||
index = -1, | ||
length = path.length; | ||
var index = -1, | ||
length = path.length, | ||
result = false; | ||
@@ -33,6 +33,6 @@ while (++index < length) { | ||
} | ||
if (result) { | ||
if (result || ++index != length) { | ||
return result; | ||
} | ||
var length = object ? object.length : 0; | ||
length = object ? object.length : 0; | ||
return !!length && isLength(length) && isIndex(key, length) && | ||
@@ -39,0 +39,0 @@ (isArray(object) || isArguments(object)); |
@@ -13,5 +13,7 @@ /** Used to match wrap detail comments. */ | ||
function insertWrapDetails(source, details) { | ||
var length = details.length, | ||
lastIndex = length - 1; | ||
var length = details.length; | ||
if (!length) { | ||
return source; | ||
} | ||
var lastIndex = length - 1; | ||
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; | ||
@@ -18,0 +20,0 @@ details = details.join(length > 2 ? ', ' : ' '); |
@@ -10,4 +10,5 @@ /** | ||
this.__data__ = []; | ||
this.size = 0; | ||
} | ||
module.exports = listCacheClear; |
@@ -31,2 +31,3 @@ var assocIndexOf = require('./_assocIndexOf'); | ||
} | ||
--this.size; | ||
return true; | ||
@@ -33,0 +34,0 @@ } |
@@ -18,2 +18,3 @@ var assocIndexOf = require('./_assocIndexOf'); | ||
if (index < 0) { | ||
++this.size; | ||
data.push([key, value]); | ||
@@ -20,0 +21,0 @@ } else { |
@@ -13,2 +13,3 @@ var Hash = require('./_Hash'), | ||
function mapCacheClear() { | ||
this.size = 0; | ||
this.__data__ = { | ||
@@ -15,0 +16,0 @@ 'hash': new Hash, |
@@ -13,5 +13,7 @@ var getMapData = require('./_getMapData'); | ||
function mapCacheDelete(key) { | ||
return getMapData(this, key)['delete'](key); | ||
var result = getMapData(this, key)['delete'](key); | ||
this.size -= result ? 1 : 0; | ||
return result; | ||
} | ||
module.exports = mapCacheDelete; |
@@ -14,3 +14,7 @@ var getMapData = require('./_getMapData'); | ||
function mapCacheSet(key, value) { | ||
getMapData(this, key).set(key, value); | ||
var data = getMapData(this, key), | ||
size = data.size; | ||
data.set(key, value); | ||
this.size += data.size == size ? 0 : 1; | ||
return this; | ||
@@ -17,0 +21,0 @@ } |
var baseSetData = require('./_baseSetData'), | ||
now = require('./now'); | ||
shortOut = require('./_shortOut'); | ||
/** Used to detect hot functions by number of calls within a span of milliseconds. */ | ||
var HOT_COUNT = 150, | ||
HOT_SPAN = 16; | ||
/** | ||
@@ -22,22 +18,4 @@ * Sets metadata for `func`. | ||
*/ | ||
var setData = (function() { | ||
var count = 0, | ||
lastCalled = 0; | ||
var setData = shortOut(baseSetData); | ||
return function(key, value) { | ||
var stamp = now(), | ||
remaining = HOT_SPAN - (stamp - lastCalled); | ||
lastCalled = stamp; | ||
if (remaining > 0) { | ||
if (++count >= HOT_COUNT) { | ||
return key; | ||
} | ||
} else { | ||
count = 0; | ||
} | ||
return baseSetData(key, value); | ||
}; | ||
}()); | ||
module.exports = setData; |
@@ -1,6 +0,4 @@ | ||
var constant = require('./constant'), | ||
defineProperty = require('./_defineProperty'), | ||
getWrapDetails = require('./_getWrapDetails'), | ||
identity = require('./identity'), | ||
var getWrapDetails = require('./_getWrapDetails'), | ||
insertWrapDetails = require('./_insertWrapDetails'), | ||
setToString = require('./_setToString'), | ||
updateWrapDetails = require('./_updateWrapDetails'); | ||
@@ -18,11 +16,7 @@ | ||
*/ | ||
var setWrapToString = !defineProperty ? identity : function(wrapper, reference, bitmask) { | ||
function setWrapToString(wrapper, reference, bitmask) { | ||
var source = (reference + ''); | ||
return defineProperty(wrapper, 'toString', { | ||
'configurable': true, | ||
'enumerable': false, | ||
'value': constant(insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))) | ||
}); | ||
}; | ||
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); | ||
} | ||
module.exports = setWrapToString; |
@@ -16,3 +16,4 @@ var ListCache = require('./_ListCache'), | ||
function Stack(entries) { | ||
this.__data__ = new ListCache(entries); | ||
var data = this.__data__ = new ListCache(entries); | ||
this.size = data.size; | ||
} | ||
@@ -19,0 +20,0 @@ |
@@ -12,4 +12,5 @@ var ListCache = require('./_ListCache'); | ||
this.__data__ = new ListCache; | ||
this.size = 0; | ||
} | ||
module.exports = stackClear; |
@@ -11,5 +11,9 @@ /** | ||
function stackDelete(key) { | ||
return this.__data__['delete'](key); | ||
var data = this.__data__, | ||
result = data['delete'](key); | ||
this.size = data.size; | ||
return result; | ||
} | ||
module.exports = stackDelete; |
@@ -19,12 +19,14 @@ var ListCache = require('./_ListCache'), | ||
function stackSet(key, value) { | ||
var cache = this.__data__; | ||
if (cache instanceof ListCache) { | ||
var pairs = cache.__data__; | ||
var data = this.__data__; | ||
if (data instanceof ListCache) { | ||
var pairs = data.__data__; | ||
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { | ||
pairs.push([key, value]); | ||
this.size = ++data.size; | ||
return this; | ||
} | ||
cache = this.__data__ = new MapCache(pairs); | ||
data = this.__data__ = new MapCache(pairs); | ||
} | ||
cache.set(key, value); | ||
data.set(key, value); | ||
this.size = data.size; | ||
return this; | ||
@@ -31,0 +33,0 @@ } |
@@ -1,2 +0,2 @@ | ||
var memoize = require('./memoize'), | ||
var memoizeCapped = require('./_memoizeCapped'), | ||
toString = require('./toString'); | ||
@@ -18,3 +18,3 @@ | ||
*/ | ||
var stringToPath = memoize(function(string) { | ||
var stringToPath = memoizeCapped(function(string) { | ||
string = toString(string); | ||
@@ -21,0 +21,0 @@ |
@@ -9,4 +9,3 @@ var basePropertyOf = require('./_basePropertyOf'); | ||
'"': '"', | ||
''': "'", | ||
'`': '`' | ||
''': "'" | ||
}; | ||
@@ -13,0 +12,0 @@ |
@@ -37,3 +37,3 @@ /** Used to compose unicode character classes. */ | ||
while (reUnicode.test(string)) { | ||
result++; | ||
++result; | ||
} | ||
@@ -40,0 +40,0 @@ return result; |
@@ -14,8 +14,2 @@ var assignValue = require('./_assignValue'), | ||
/** Built-in value references. */ | ||
var propertyIsEnumerable = objectProto.propertyIsEnumerable; | ||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ | ||
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); | ||
/** | ||
@@ -54,3 +48,3 @@ * Assigns own enumerable string keyed properties of source objects to the | ||
var assign = createAssigner(function(object, source) { | ||
if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { | ||
if (isPrototype(source) || isArrayLike(source)) { | ||
copyObject(source, keys(source), object); | ||
@@ -57,0 +51,0 @@ return; |
var baseAt = require('./_baseAt'), | ||
baseFlatten = require('./_baseFlatten'), | ||
baseRest = require('./_baseRest'); | ||
flatRest = require('./_flatRest'); | ||
@@ -22,6 +21,4 @@ /** | ||
*/ | ||
var at = baseRest(function(object, paths) { | ||
return baseAt(object, baseFlatten(paths, 1)); | ||
}); | ||
var at = flatRest(baseAt); | ||
module.exports = at; |
var arrayEach = require('./_arrayEach'), | ||
baseFlatten = require('./_baseFlatten'), | ||
baseRest = require('./_baseRest'), | ||
baseAssignValue = require('./_baseAssignValue'), | ||
bind = require('./bind'), | ||
flatRest = require('./_flatRest'), | ||
toKey = require('./_toKey'); | ||
@@ -33,6 +33,6 @@ | ||
*/ | ||
var bindAll = baseRest(function(object, methodNames) { | ||
arrayEach(baseFlatten(methodNames, 1), function(key) { | ||
var bindAll = flatRest(function(object, methodNames) { | ||
arrayEach(methodNames, function(key) { | ||
key = toKey(key); | ||
object[key] = bind(object[key], object); | ||
baseAssignValue(object, key, bind(object[key], object)); | ||
}); | ||
@@ -39,0 +39,0 @@ return object; |
@@ -29,4 +29,7 @@ var arrayPush = require('./_arrayPush'), | ||
function concat() { | ||
var length = arguments.length, | ||
args = Array(length ? length - 1 : 0), | ||
var length = arguments.length; | ||
if (!length) { | ||
return []; | ||
} | ||
var args = Array(length - 1), | ||
array = arguments[0], | ||
@@ -38,7 +41,5 @@ index = length; | ||
} | ||
return length | ||
? arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)) | ||
: []; | ||
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); | ||
} | ||
module.exports = concat; |
@@ -6,24 +6,24 @@ /** | ||
*/ | ||
;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n){return function(t){return null==t?Z:t[n]}}function r(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function e(n,t){return d(t,function(t){return n[t]})}function u(n){return n instanceof o?n:new o(n)}function o(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function i(n,t,r,e){return n===Z||J(n,an[r])&&!ln.call(e,r)?t:n}function c(n){return V(n)?vn(n):{}}function f(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function"); | ||
return setTimeout(function(){n.apply(Z,r)},t)}function a(n,t){var r=true;return jn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function l(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===Z?i===i:r(i,c)))var c=i,f=o}return f}function p(n,t){var r=[];return jn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function s(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=D),o||(o=[]);++i<c;){var f=t[i];0<r&&e(f)?1<r?s(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function h(n,t){return n&&dn(n,t,Rn); | ||
}function v(n,t){return p(t,function(t){return U(n[t])})}function b(n,t){return n>t}function y(n,t,r,e,u){return n===t||(null==n||null==t||!V(n)&&!H(t)?n!==n&&t!==t:g(n,t,y,r,e,u))}function g(n,t,r,e,u,o){var i=wn(n),c=wn(t),f="[object Array]",a="[object Array]";i||(f=sn.call(n),f="[object Arguments]"==f?"[object Object]":f),c||(a=sn.call(t),a="[object Arguments]"==a?"[object Object]":a);var l="[object Object]"==f&&true,c="[object Object]"==a&&true,a=f==a;o||(o=[]);var p=On(o,function(t){return t[0]==n; | ||
}),s=On(o,function(n){return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=B(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 2&u||(i=l&&ln.call(n,"__wrapped__"),f=c&&ln.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=R(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n, | ||
f=f?t.value():t,r=r(i,f,e,u,o),o.pop(),r)}function _(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?m:t)(n)}function j(n,t){return n<t}function d(n,t){var r=-1,e=P(n)?Array(n.length):[];return jn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function m(n){var t=gn(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&y(n[u],r[u],Z,3)))return false}return true}}function O(n,t){return n=Object(n),C(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function x(n){ | ||
var t;return t=_n(t===Z?n.length-1:t,0),function(){for(var r=arguments,e=-1,u=_n(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(e=-1,u=Array(t+1);++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function 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 E(n){return A(n,0,n.length)}function w(n,t){var r;return jn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function k(t,r){return C(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args)); | ||
},t)}function N(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){var i=t[u],c=e?e(r[i],n[i],i,r,n):Z,f=r,a=i,i=c===Z?n[i]:c,c=f[a];ln.call(f,a)&&J(c,i)&&(i!==Z||a in f)||(f[a]=i)}return r}function S(n){return x(function(t,r){var e=-1,u=r.length,o=1<u?r[u-1]:Z,o=3<n.length&&typeof o=="function"?(u--,o):Z;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function T(n){return function(){var t=arguments,r=c(n.prototype),t=n.apply(r,t);return V(t)?t:r}}function F(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==un&&this instanceof e?u:n;++c<f;)a[c]=r[c]; | ||
for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=T(n);return e}function B(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(2&u&&c>i))return false;for(var c=-1,f=true,a=1&u?[]:Z;++c<i;){var l=n[c],p=t[c];if(void 0!==Z){f=false;break}if(a){if(!w(t,function(n,t){if(!$(a,t)&&(l===n||r(l,n,e,u,o)))return a.push(t)})){f=false;break}}else if(l!==p&&!r(l,p,e,u,o)){f=false;break}}return f}function R(n,t,r,e,u,o){var i=2&u,c=Rn(n),f=c.length,a=Rn(t).length; | ||
if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:ln.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==Z||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),a}function D(n){return wn(n)||M(n)}function I(n){var t=[];if(null!=n)for(var r in Object(n))t.push(r);return t}function q(n){ | ||
return n&&n.length?n[0]:Z}function $(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?_n(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1}function z(n,t){return jn(n,_(t))}function C(n,t,e){return r(n,_(t),e,3>arguments.length,jn)}function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=kn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!==n&&t!==t}function M(n){ | ||
return H(n)&&P(n)&&ln.call(n,"callee")&&(!bn.call(n,"callee")||"[object Arguments]"==sn.call(n))}function P(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t),t&&!U(n)}function U(n){return n=V(n)?sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function V(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function H(n){return!!n&&typeof n=="object"}function K(n){return typeof n=="number"||H(n)&&"[object Number]"==sn.call(n)} | ||
function L(n){return typeof n=="string"||!wn(n)&&H(n)&&"[object String]"==sn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return n?e(n,Rn(n)):[]}function X(n){return n}function Y(t,r,e){var u=Rn(r),o=v(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=v(r,Rn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(t);return jn(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__=E(this.__actions__)).push({ | ||
func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var Z,nn=1/0,tn=/[&<>"'`]/g,rn=RegExp(tn.source),en=typeof self=="object"&&self&&self.Object===Object&&self,un=typeof global=="object"&&global&&global.Object===Object&&global||en||Function("return this")(),on=(en=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,cn=function(n){return function(t){return null==n?Z:n[t]}}({"&":"&", | ||
"<":"<",">":">",'"':""","'":"'","`":"`"}),fn=Array.prototype,an=Object.prototype,ln=an.hasOwnProperty,pn=0,sn=an.toString,hn=un._,vn=Object.create,bn=an.propertyIsEnumerable,yn=un.isFinite,gn=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),_n=Math.max;o.prototype=c(u.prototype),o.prototype.constructor=o;var jn=function(n,t){return function(r,e){if(null==r)return r;if(!P(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i);); | ||
return r}}(h),dn=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}}(),mn=String,On=function(n){return function(t,r,e){var u=Object(t);if(!P(t)){var o=_(r);t=Rn(t),r=function(n){return o(u[n],n,u)}}return r=n(t,r,e),-1<r?u[o?t[r]:r]:Z}}(function(n,t,r){var e=n?n.length:0;if(!e)return-1;r=null==r?0:kn(r),0>r&&(r=_n(e+r,0));n:{for(t=_(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),xn=x(function(n,t,r){ | ||
return F(n,t,r)}),An=x(function(n,t){return f(n,1,t)}),En=x(function(n,t,r){return f(n,Nn(t)||0,r)}),wn=Array.isArray,kn=Number,Nn=Number,Sn=S(function(n,t){N(t,gn(t),n)}),Tn=S(function(n,t){N(t,I(t),n)}),Fn=S(function(n,t,r,e){N(t,Dn(t),n,e)}),Bn=x(function(n){return n.push(Z,i),Fn.apply(Z,n)}),Rn=gn,Dn=I,In=x(function(n,t){return null==n?{}:O(n,d(s(t,1),mn))});u.assignIn=Tn,u.before=G,u.bind=xn,u.chain=function(n){return n=u(n),n.__chain__=true,n},u.compact=function(n){return p(n,Boolean)},u.concat=function(){ | ||
for(var t=arguments.length,r=Array(t?t-1:0),e=arguments[0],u=t;u--;)r[u-1]=arguments[u];return t?n(wn(e)?E(e):[e],s(r,1)):[]},u.create=function(n,t){var r=c(n);return t?Sn(r,t):r},u.defaults=Bn,u.defer=An,u.delay=En,u.filter=function(n,t){return p(n,_(t))},u.flatten=function(n){return n&&n.length?s(n,1):[]},u.flattenDeep=function(n){return n&&n.length?s(n,nn):[]},u.iteratee=_,u.keys=Rn,u.map=function(n,t){return d(n,_(t))},u.matches=function(n){return m(Sn({},n))},u.mixin=Y,u.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function"); | ||
return function(){return!n.apply(this,arguments)}},u.once=function(n){return G(2,n)},u.pick=In,u.slice=function(n,t,r){var e=n?n.length:0;return r=r===Z?e:+r,e?A(n,null==t?0:+t,r):[]},u.sortBy=function(n,r){var e=0;return r=_(r),d(d(n,function(n,t,u){return{value:n,index:e++,criteria:r(n,t,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==Z,o=null===r,i=r===r,c=e!==Z,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r<e||f&&u&&i||!c&&i||!a){r=-1; | ||
break n}}r=0}return r||n.index-t.index}),t("value"))},u.tap=function(n,t){return t(n),n},u.thru=function(n,t){return t(n)},u.toArray=function(n){return P(n)?n.length?E(n):[]:W(n)},u.values=W,u.extend=Tn,Y(u,u),u.clone=function(n){return V(n)?wn(n)?E(n):N(n,gn(n)):n},u.escape=function(n){return(n=Q(n))&&rn.test(n)?n.replace(tn,cn):n},u.every=function(n,t,r){return t=r?Z:t,a(n,_(t))},u.find=On,u.forEach=z,u.has=function(n,t){return null!=n&&ln.call(n,t)},u.head=q,u.identity=X,u.indexOf=$,u.isArguments=M, | ||
u.isArray=wn,u.isBoolean=function(n){return true===n||false===n||H(n)&&"[object Boolean]"==sn.call(n)},u.isDate=function(n){return H(n)&&"[object Date]"==sn.call(n)},u.isEmpty=function(n){return P(n)&&(wn(n)||L(n)||U(n.splice)||M(n))?!n.length:!gn(n).length},u.isEqual=function(n,t){return y(n,t)},u.isFinite=function(n){return typeof n=="number"&&yn(n)},u.isFunction=U,u.isNaN=function(n){return K(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=K,u.isObject=V,u.isRegExp=function(n){return V(n)&&"[object RegExp]"==sn.call(n); | ||
},u.isString=L,u.isUndefined=function(n){return n===Z},u.last=function(n){var t=n?n.length:0;return t?n[t-1]:Z},u.max=function(n){return n&&n.length?l(n,X,b):Z},u.min=function(n){return n&&n.length?l(n,X,j):Z},u.noConflict=function(){return un._===this&&(un._=hn),this},u.noop=function(){},u.reduce=C,u.result=function(n,t,r){return t=null==n?Z:n[t],t===Z&&(t=r),U(t)?t.call(n):t},u.size=function(n){return null==n?0:(n=P(n)?n:gn(n),n.length)},u.some=function(n,t,r){return t=r?Z:t,w(n,_(t))},u.uniqueId=function(n){ | ||
var t=++pn;return Q(n)+t},u.each=z,u.first=q,Y(u,function(){var n={};return h(u,function(t,r){ln.call(u.prototype,r)||(n[r]=t)}),n}(),{chain:false}),u.VERSION="4.15.0",jn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:fn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);u.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(wn(u)?u:[],n); | ||
}return this[r](function(r){return t.apply(wn(r)?r:[],n)})}}),u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=function(){return k(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(un._=u, define(function(){return u})):on?((on.exports=u)._=u,en._=u):un._=u}).call(this); | ||
;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n){return function(t){return null==t?tn:t[n]}}function r(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function e(n,t){return d(t,function(t){return n[t]})}function u(n){return n instanceof o?n:new o(n)}function o(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function i(n,t,r,e){return n===tn||P(n,pn[r])&&!sn.call(e,r)?t:n}function c(n){return K(n)?yn(n):{}}function f(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function"); | ||
return setTimeout(function(){n.apply(tn,r)},t)}function a(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function l(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===tn?i===i:r(i,c)))var c=i,f=o}return f}function p(n,t){var r=[];return mn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function s(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=D),o||(o=[]);++i<c;){var f=t[i];0<r&&e(f)?1<r?s(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function h(n,t){return n&&On(n,t,qn); | ||
}function v(n,t){return p(t,function(t){return H(n[t])})}function b(n,t){return n>t}function y(n,t,r,e,u){return n===t||(null==n||null==t||!K(n)&&!L(t)?n!==n&&t!==t:g(n,t,y,r,e,u))}function g(n,t,r,e,u,o){var i=Sn(n),c=Sn(t),f="[object Array]",a="[object Array]";i||(f=vn.call(n),f="[object Arguments]"==f?"[object Object]":f),c||(a=vn.call(t),a="[object Arguments]"==a?"[object Object]":a);var l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=En(o,function(t){return t[0]==n}),s=En(o,function(n){ | ||
return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=B(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=P(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 2&u||(i=l&&sn.call(n,"__wrapped__"),f=c&&sn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=R(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t, | ||
r=r(i,f,e,u,o),o.pop(),r)}function _(n){return typeof n=="function"?n:null==n?Z:(typeof n=="object"?m:t)(n)}function j(n,t){return n<t}function d(n,t){var r=-1,e=V(n)?Array(n.length):[];return mn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function m(n){var t=jn(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&y(n[u],r[u],tn,3)))return false}return true}}function O(n,t){return n=Object(n),J(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function x(n){return xn(q(n,void 0,Z),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 E(n){return A(n,0,n.length)}function w(n,t){var r;return mn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function k(t,r){return J(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function N(n,t,r,e){var u=!r;r||(r={});for(var o=-1,i=t.length;++o<i;){var c=t[o],f=e?e(r[c],n[c],c,r,n):tn;if(f===tn&&(f=n[c]),u)r[c]=f;else{var a=r,l=a[c]; | ||
sn.call(a,c)&&P(l,f)&&(f!==tn||c in a)||(a[c]=f)}}return r}function S(n){return x(function(t,r){var e=-1,u=r.length,o=1<u?r[u-1]:tn,o=3<n.length&&typeof o=="function"?(u--,o):tn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function T(n){return function(){var t=arguments,r=c(n.prototype),t=n.apply(r,t);return K(t)?t:r}}function F(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==cn&&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=T(n);return e}function B(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(2&u&&c>i))return false;for(var c=-1,f=true,a=1&u?[]:tn;++c<i;){var l=n[c],p=t[c];if(void 0!==tn){f=false;break}if(a){if(!w(t,function(n,t){if(!C(a,t)&&(l===n||r(l,n,e,u,o)))return a.push(t)})){f=false;break}}else if(l!==p&&!r(l,p,e,u,o)){f=false;break}}return f}function R(n,t,r,e,u,o){var i=2&u,c=qn(n),f=c.length,a=qn(t).length;if(f!=a&&!i)return false; | ||
for(var l=f;l--;){var p=c[l];if(!(i?p in t:sn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==tn||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 D(n){return Sn(n)||U(n)}function I(n){var t=[];if(null!=n)for(var r in Object(n))t.push(r);return t}function q(n,t,r){return t=dn(t===tn?n.length-1:t,0), | ||
function(){for(var e=arguments,u=-1,o=dn(e.length-t,0),i=Array(o);++u<o;)i[u]=e[t+u];for(u=-1,o=Array(t+1);++u<t;)o[u]=e[u];return o[t]=r(i),n.apply(this,o)}}function $(n){return n&&n.length?s(n,1):[]}function z(n){return n&&n.length?n[0]:tn}function C(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?dn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1}function G(n,t){return mn(n,_(t))}function J(n,t,e){return r(n,_(t),e,3>arguments.length,mn)}function M(n,t){ | ||
var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Tn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=tn),r}}function P(n,t){return n===t||n!==n&&t!==t}function U(n){return L(n)&&V(n)&&sn.call(n,"callee")&&(!gn.call(n,"callee")||"[object Arguments]"==vn.call(n))}function V(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t),t&&!H(n)}function H(n){return n=K(n)?vn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n; | ||
}function K(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function L(n){return null!=n&&typeof n=="object"}function Q(n){return typeof n=="number"||L(n)&&"[object Number]"==vn.call(n)}function W(n){return typeof n=="string"||!Sn(n)&&L(n)&&"[object String]"==vn.call(n)}function X(n){return typeof n=="string"?n:null==n?"":n+""}function Y(n){return n?e(n,qn(n)):[]}function Z(n){return n}function nn(t,r,e){var u=qn(r),o=v(r,u);null!=e||K(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=v(r,qn(r))); | ||
var i=!(K(e)&&"chain"in e&&!e.chain),c=H(t);return mn(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__=E(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var tn,rn=1/0,en=/[&<>"'`]/g,un=RegExp(en.source),on=typeof self=="object"&&self&&self.Object===Object&&self,cn=typeof global=="object"&&global&&global.Object===Object&&global||on||Function("return this")(),fn=(on=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,an=function(n){ | ||
return function(t){return null==n?tn:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),ln=Array.prototype,pn=Object.prototype,sn=pn.hasOwnProperty,hn=0,vn=pn.toString,bn=cn._,yn=Object.create,gn=pn.propertyIsEnumerable,_n=cn.isFinite,jn=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),dn=Math.max;o.prototype=c(u.prototype),o.prototype.constructor=o;var mn=function(n,t){return function(r,e){if(null==r)return r;if(!V(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}}(h),On=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}}(),xn=Z,An=String,En=function(n){return function(t,r,e){var u=Object(t);if(!V(t)){var o=_(r);t=qn(t),r=function(n){return o(u[n],n,u)}}return r=n(t,r,e),-1<r?u[o?t[r]:r]:tn}}(function(n,t,r){var e=n?n.length:0;if(!e)return-1;r=null==r?0:Tn(r),0>r&&(r=dn(e+r,0));n:{for(t=_(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),wn=x(function(n,t,r){ | ||
return F(n,t,r)}),kn=x(function(n,t){return f(n,1,t)}),Nn=x(function(n,t,r){return f(n,Fn(t)||0,r)}),Sn=Array.isArray,Tn=Number,Fn=Number,Bn=S(function(n,t){N(t,jn(t),n)}),Rn=S(function(n,t){N(t,I(t),n)}),Dn=S(function(n,t,r,e){N(t,$n(t),n,e)}),In=x(function(n){return n.push(tn,i),Dn.apply(tn,n)}),qn=jn,$n=I,zn=function(n){return xn(q(n,tn,$),n+"")}(function(n,t){return null==n?{}:O(n,d(t,An))});u.assignIn=Rn,u.before=M,u.bind=wn,u.chain=function(n){return n=u(n),n.__chain__=true,n},u.compact=function(n){ | ||
return p(n,Boolean)},u.concat=function(){var t=arguments.length;if(!t)return[];for(var r=Array(t-1),e=arguments[0];t--;)r[t-1]=arguments[t];return n(Sn(e)?E(e):[e],s(r,1))},u.create=function(n,t){var r=c(n);return t?Bn(r,t):r},u.defaults=In,u.defer=kn,u.delay=Nn,u.filter=function(n,t){return p(n,_(t))},u.flatten=$,u.flattenDeep=function(n){return n&&n.length?s(n,rn):[]},u.iteratee=_,u.keys=qn,u.map=function(n,t){return d(n,_(t))},u.matches=function(n){return m(Bn({},n))},u.mixin=nn,u.negate=function(n){ | ||
if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},u.once=function(n){return M(2,n)},u.pick=zn,u.slice=function(n,t,r){var e=n?n.length:0;return r=r===tn?e:+r,e?A(n,null==t?0:+t,r):[]},u.sortBy=function(n,r){var e=0;return r=_(r),d(d(n,function(n,t,u){return{value:n,index:e++,criteria:r(n,t,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==tn,o=null===r,i=r===r,c=e!==tn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){ | ||
r=1;break n}if(!o&&r<e||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),t("value"))},u.tap=function(n,t){return t(n),n},u.thru=function(n,t){return t(n)},u.toArray=function(n){return V(n)?n.length?E(n):[]:Y(n)},u.values=Y,u.extend=Rn,nn(u,u),u.clone=function(n){return K(n)?Sn(n)?E(n):N(n,jn(n)):n},u.escape=function(n){return(n=X(n))&&un.test(n)?n.replace(en,an):n},u.every=function(n,t,r){return t=r?tn:t,a(n,_(t))},u.find=En,u.forEach=G,u.has=function(n,t){return null!=n&&sn.call(n,t); | ||
},u.head=z,u.identity=Z,u.indexOf=C,u.isArguments=U,u.isArray=Sn,u.isBoolean=function(n){return true===n||false===n||L(n)&&"[object Boolean]"==vn.call(n)},u.isDate=function(n){return L(n)&&"[object Date]"==vn.call(n)},u.isEmpty=function(n){return V(n)&&(Sn(n)||W(n)||H(n.splice)||U(n))?!n.length:!jn(n).length},u.isEqual=function(n,t){return y(n,t)},u.isFinite=function(n){return typeof n=="number"&&_n(n)},u.isFunction=H,u.isNaN=function(n){return Q(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=Q, | ||
u.isObject=K,u.isRegExp=function(n){return K(n)&&"[object RegExp]"==vn.call(n)},u.isString=W,u.isUndefined=function(n){return n===tn},u.last=function(n){var t=n?n.length:0;return t?n[t-1]:tn},u.max=function(n){return n&&n.length?l(n,Z,b):tn},u.min=function(n){return n&&n.length?l(n,Z,j):tn},u.noConflict=function(){return cn._===this&&(cn._=bn),this},u.noop=function(){},u.reduce=J,u.result=function(n,t,r){return t=null==n?tn:n[t],t===tn&&(t=r),H(t)?t.call(n):t},u.size=function(n){return null==n?0:(n=V(n)?n:jn(n), | ||
n.length)},u.some=function(n,t,r){return t=r?tn:t,w(n,_(t))},u.uniqueId=function(n){var t=++hn;return X(n)+t},u.each=G,u.first=z,nn(u,function(){var n={};return h(u,function(t,r){sn.call(u.prototype,r)||(n[r]=t)}),n}(),{chain:false}),u.VERSION="4.16.0",mn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:ln)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);u.prototype[n]=function(){ | ||
var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Sn(u)?u:[],n)}return this[r](function(r){return t.apply(Sn(r)?r:[],n)})}}),u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=function(){return k(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(cn._=u, define(function(){return u})):fn?((fn.exports=u)._=u,on._=u):cn._=u}).call(this); |
@@ -1,2 +0,3 @@ | ||
var createAggregator = require('./_createAggregator'); | ||
var baseAssignValue = require('./_baseAssignValue'), | ||
createAggregator = require('./_createAggregator'); | ||
@@ -33,5 +34,9 @@ /** Used for built-in method references. */ | ||
var countBy = createAggregator(function(result, value, key) { | ||
hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); | ||
if (hasOwnProperty.call(result, key)) { | ||
++result[key]; | ||
} else { | ||
baseAssignValue(result, key, 1); | ||
} | ||
}); | ||
module.exports = countBy; |
@@ -20,3 +20,3 @@ var baseDelay = require('./_baseDelay'), | ||
* }, 'deferred'); | ||
* // => Logs 'deferred' after one or more milliseconds. | ||
* // => Logs 'deferred' after one millisecond. | ||
*/ | ||
@@ -23,0 +23,0 @@ var defer = baseRest(function(func, args) { |
@@ -9,4 +9,4 @@ var baseDifference = require('./_baseDifference'), | ||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) | ||
* for equality comparisons. The order of result values is determined by the | ||
* order they occur in the first array. | ||
* for equality comparisons. The order and references of result values are | ||
* determined by the first array. | ||
* | ||
@@ -13,0 +13,0 @@ * **Note:** Unlike `_.pullAll`, this method returns a new array. |
@@ -11,4 +11,5 @@ var baseDifference = require('./_baseDifference'), | ||
* is invoked for each element of `array` and `values` to generate the criterion | ||
* by which they're compared. Result values are chosen from the first array. | ||
* The iteratee is invoked with one argument: (value). | ||
* by which they're compared. The order and references of result values are | ||
* determined by the first array. The iteratee is invoked with one argument: | ||
* (value). | ||
* | ||
@@ -15,0 +16,0 @@ * **Note:** Unlike `_.pullAllBy`, this method returns a new array. |
@@ -9,5 +9,5 @@ var baseDifference = require('./_baseDifference'), | ||
* This method is like `_.difference` except that it accepts `comparator` | ||
* which is invoked to compare elements of `array` to `values`. Result values | ||
* are chosen from the first array. The comparator is invoked with two arguments: | ||
* (arrVal, othVal). | ||
* which is invoked to compare elements of `array` to `values`. The order and | ||
* references of result values are determined by the first array. The comparator | ||
* is invoked with two arguments: (arrVal, othVal). | ||
* | ||
@@ -14,0 +14,0 @@ * **Note:** Unlike `_.pullAllWith`, this method returns a new array. |
@@ -9,4 +9,4 @@ var escapeHtmlChar = require('./_escapeHtmlChar'), | ||
/** | ||
* Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to | ||
* their corresponding HTML entities. | ||
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their | ||
* corresponding HTML entities. | ||
* | ||
@@ -22,8 +22,2 @@ * **Note:** No other characters are escaped. To escape additional | ||
* | ||
* Backticks are escaped because in IE < 9, they can break out of | ||
* attribute values or HTML comments. See [#59](https://html5sec.org/#59), | ||
* [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and | ||
* [#133](https://html5sec.org/#133) of the | ||
* [HTML5 Security Cheatsheet](https://html5sec.org/) for more details. | ||
* | ||
* When working with HTML you should always | ||
@@ -30,0 +24,0 @@ * [quote attribute values](http://wonko.com/post/html-escaping) to reduce |
@@ -26,3 +26,3 @@ var arrayEach = require('./_arrayEach'), | ||
* | ||
* _([1, 2]).forEach(function(value) { | ||
* _.forEach([1, 2], function(value) { | ||
* console.log(value); | ||
@@ -29,0 +29,0 @@ * }); |
@@ -111,5 +111,6 @@ /** Used to map aliases to their real names. */ | ||
'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', | ||
'padCharsStart', 'pullAllBy', 'pullAllWith', 'reduce', 'reduceRight', 'replace', | ||
'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', | ||
'unionWith', 'update', 'xorBy', 'xorWith', 'zipWith' | ||
'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', | ||
'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', | ||
'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', | ||
'xorWith', 'zipWith' | ||
], | ||
@@ -193,2 +194,4 @@ '4': [ | ||
'pullAllWith': [2, 1, 0], | ||
'rangeStep': [1, 2, 0], | ||
'rangeStepRight': [1, 2, 0], | ||
'setWith': [3, 1, 2, 0], | ||
@@ -315,2 +318,4 @@ 'sortedIndexBy': [2, 1, 0], | ||
'propertyOf': 'get', | ||
'rangeStep': 'range', | ||
'rangeStepRight': 'rangeRight', | ||
'restFrom': 'rest', | ||
@@ -317,0 +322,0 @@ 'spreadFrom': 'spread', |
@@ -1,2 +0,3 @@ | ||
var createAggregator = require('./_createAggregator'); | ||
var baseAssignValue = require('./_baseAssignValue'), | ||
createAggregator = require('./_createAggregator'); | ||
@@ -37,3 +38,3 @@ /** Used for built-in method references. */ | ||
} else { | ||
result[key] = [value]; | ||
baseAssignValue(result, key, [value]); | ||
} | ||
@@ -40,0 +41,0 @@ }); |
@@ -9,4 +9,4 @@ var arrayMap = require('./_arrayMap'), | ||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) | ||
* for equality comparisons. The order of result values is determined by the | ||
* order they occur in the first array. | ||
* for equality comparisons. The order and references of result values are | ||
* determined by the first array. | ||
* | ||
@@ -13,0 +13,0 @@ * @static |
@@ -11,4 +11,5 @@ var arrayMap = require('./_arrayMap'), | ||
* which is invoked for each element of each `arrays` to generate the criterion | ||
* by which they're compared. Result values are chosen from the first array. | ||
* The iteratee is invoked with one argument: (value). | ||
* by which they're compared. The order and references of result values are | ||
* determined by the first array. The iteratee is invoked with one argument: | ||
* (value). | ||
* | ||
@@ -15,0 +16,0 @@ * @static |
@@ -9,5 +9,5 @@ var arrayMap = require('./_arrayMap'), | ||
* This method is like `_.intersection` except that it accepts `comparator` | ||
* which is invoked to compare elements of `arrays`. Result values are chosen | ||
* from the first array. The comparator is invoked with two arguments: | ||
* (arrVal, othVal). | ||
* which is invoked to compare elements of `arrays`. The order and references | ||
* of result values are determined by the first array. The comparator is | ||
* invoked with two arguments: (arrVal, othVal). | ||
* | ||
@@ -14,0 +14,0 @@ * @static |
@@ -22,5 +22,5 @@ var isObjectLike = require('./isObjectLike'), | ||
function isElement(value) { | ||
return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); | ||
return value != null && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); | ||
} | ||
module.exports = isElement; |
@@ -19,8 +19,2 @@ var getTag = require('./_getTag'), | ||
/** Built-in value references. */ | ||
var propertyIsEnumerable = objectProto.propertyIsEnumerable; | ||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ | ||
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); | ||
/** | ||
@@ -69,3 +63,3 @@ * Checks if `value` is an empty object, collection, map, or set. | ||
} | ||
if (nonEnumShadows || isPrototype(value)) { | ||
if (isPrototype(value)) { | ||
return !nativeKeys(value).length; | ||
@@ -72,0 +66,0 @@ } |
@@ -28,5 +28,5 @@ /** | ||
var type = typeof value; | ||
return !!value && (type == 'object' || type == 'function'); | ||
return value != null && (type == 'object' || type == 'function'); | ||
} | ||
module.exports = isObject; |
@@ -26,5 +26,5 @@ /** | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
return value != null && typeof value == 'object'; | ||
} | ||
module.exports = isObjectLike; |
var getPrototype = require('./_getPrototype'), | ||
isHostObject = require('./_isHostObject'), | ||
isObjectLike = require('./isObjectLike'); | ||
@@ -57,4 +56,3 @@ | ||
function isPlainObject(value) { | ||
if (!isObjectLike(value) || | ||
objectToString.call(value) != objectTag || isHostObject(value)) { | ||
if (!isObjectLike(value) || objectToString.call(value) != objectTag) { | ||
return false; | ||
@@ -61,0 +59,0 @@ } |
@@ -1,2 +0,3 @@ | ||
var createAggregator = require('./_createAggregator'); | ||
var baseAssignValue = require('./_baseAssignValue'), | ||
createAggregator = require('./_createAggregator'); | ||
@@ -33,5 +34,5 @@ /** | ||
var keyBy = createAggregator(function(result, value, key) { | ||
result[key] = value; | ||
baseAssignValue(result, key, value); | ||
}); | ||
module.exports = keyBy; |
var baseFindIndex = require('./_baseFindIndex'), | ||
baseIsNaN = require('./_baseIsNaN'), | ||
strictLastIndexOf = require('./_strictLastIndexOf'), | ||
toInteger = require('./toInteger'); | ||
@@ -38,19 +39,9 @@ | ||
index = toInteger(fromIndex); | ||
index = ( | ||
index < 0 | ||
? nativeMax(length + index, 0) | ||
: nativeMin(index, length - 1) | ||
) + 1; | ||
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); | ||
} | ||
if (value !== value) { | ||
return baseFindIndex(array, baseIsNaN, index - 1, true); | ||
} | ||
while (index--) { | ||
if (array[index] === value) { | ||
return index; | ||
} | ||
} | ||
return -1; | ||
return value === value | ||
? strictLastIndexOf(array, value, index) | ||
: baseFindIndex(array, baseIsNaN, index, true); | ||
} | ||
module.exports = lastIndexOf; |
@@ -1,2 +0,3 @@ | ||
var baseForOwn = require('./_baseForOwn'), | ||
var baseAssignValue = require('./_baseAssignValue'), | ||
baseForOwn = require('./_baseForOwn'), | ||
baseIteratee = require('./_baseIteratee'); | ||
@@ -30,3 +31,3 @@ | ||
baseForOwn(object, function(value, key, object) { | ||
result[iteratee(value, key, object)] = value; | ||
baseAssignValue(result, iteratee(value, key, object), value); | ||
}); | ||
@@ -33,0 +34,0 @@ return result; |
@@ -1,2 +0,3 @@ | ||
var baseForOwn = require('./_baseForOwn'), | ||
var baseAssignValue = require('./_baseAssignValue'), | ||
baseForOwn = require('./_baseForOwn'), | ||
baseIteratee = require('./_baseIteratee'); | ||
@@ -37,3 +38,3 @@ | ||
baseForOwn(object, function(value, key, object) { | ||
result[key] = iteratee(value, key, object); | ||
baseAssignValue(result, key, iteratee(value, key, object)); | ||
}); | ||
@@ -40,0 +41,0 @@ return result; |
@@ -63,3 +63,3 @@ var MapCache = require('./_MapCache'); | ||
var result = func.apply(this, args); | ||
memoized.cache = cache.set(key, result); | ||
memoized.cache = cache.set(key, result) || cache; | ||
return result; | ||
@@ -71,5 +71,5 @@ }; | ||
// Assign cache to `_.memoize`. | ||
// Expose `MapCache`. | ||
memoize.Cache = MapCache; | ||
module.exports = memoize; |
@@ -8,3 +8,3 @@ var baseMerge = require('./_baseMerge'), | ||
* properties. If `customizer` returns `undefined`, merging is handled by the | ||
* method instead. The `customizer` is invoked with seven arguments: | ||
* method instead. The `customizer` is invoked with six arguments: | ||
* (objValue, srcValue, key, object, source, stack). | ||
@@ -11,0 +11,0 @@ * |
var arrayMap = require('./_arrayMap'), | ||
baseDifference = require('./_baseDifference'), | ||
baseFlatten = require('./_baseFlatten'), | ||
basePick = require('./_basePick'), | ||
baseRest = require('./_baseRest'), | ||
flatRest = require('./_flatRest'), | ||
getAllKeysIn = require('./_getAllKeysIn'), | ||
@@ -28,7 +27,7 @@ toKey = require('./_toKey'); | ||
*/ | ||
var omit = baseRest(function(object, props) { | ||
var omit = flatRest(function(object, props) { | ||
if (object == null) { | ||
return {}; | ||
} | ||
props = arrayMap(baseFlatten(props, 1), toKey); | ||
props = arrayMap(props, toKey); | ||
return basePick(object, baseDifference(getAllKeysIn(object), props)); | ||
@@ -35,0 +34,0 @@ }); |
@@ -7,2 +7,3 @@ var apply = require('./_apply'), | ||
baseUnary = require('./_baseUnary'), | ||
castRest = require('./_castRest'), | ||
isArray = require('./isArray'); | ||
@@ -44,3 +45,3 @@ | ||
*/ | ||
var overArgs = baseRest(function(func, transforms) { | ||
var overArgs = castRest(function(func, transforms) { | ||
transforms = (transforms.length == 1 && isArray(transforms[0])) | ||
@@ -47,0 +48,0 @@ ? arrayMap(transforms[0], baseUnary(baseIteratee)) |
{ | ||
"name": "lodash", | ||
"version": "4.15.0", | ||
"version": "4.16.0", | ||
"description": "Lodash modular utilities.", | ||
@@ -5,0 +5,0 @@ "keywords": "modules, stdlib, util", |
var root = require('./_root'), | ||
toString = require('./toString'); | ||
/** Used to match leading and trailing whitespace. */ | ||
var reTrim = /^\s+|\s+$/g; | ||
/** Used to detect hexadecimal string values. */ | ||
var reHasHexPrefix = /^0x/i; | ||
/* Built-in method references for those with the same name as other `lodash` methods. */ | ||
@@ -38,4 +32,2 @@ var nativeParseInt = root.parseInt; | ||
function parseInt(string, radix, guard) { | ||
// Chrome fails to trim leading <BOM> whitespace characters. | ||
// See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details. | ||
if (guard || radix == null) { | ||
@@ -46,6 +38,5 @@ radix = 0; | ||
} | ||
string = toString(string).replace(reTrim, ''); | ||
return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); | ||
return nativeParseInt(toString(string), radix || 0); | ||
} | ||
module.exports = parseInt; |
var arrayMap = require('./_arrayMap'), | ||
baseFlatten = require('./_baseFlatten'), | ||
basePick = require('./_basePick'), | ||
baseRest = require('./_baseRest'), | ||
flatRest = require('./_flatRest'), | ||
toKey = require('./_toKey'); | ||
@@ -24,6 +23,6 @@ | ||
*/ | ||
var pick = baseRest(function(object, props) { | ||
return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey)); | ||
var pick = flatRest(function(object, props) { | ||
return object == null ? {} : basePick(object, arrayMap(props, toKey)); | ||
}); | ||
module.exports = pick; |
var arrayMap = require('./_arrayMap'), | ||
baseAt = require('./_baseAt'), | ||
baseFlatten = require('./_baseFlatten'), | ||
basePullAt = require('./_basePullAt'), | ||
baseRest = require('./_baseRest'), | ||
compareAscending = require('./_compareAscending'), | ||
flatRest = require('./_flatRest'), | ||
isIndex = require('./_isIndex'); | ||
@@ -33,5 +32,3 @@ | ||
*/ | ||
var pullAt = baseRest(function(array, indexes) { | ||
indexes = baseFlatten(indexes, 1); | ||
var pullAt = flatRest(function(array, indexes) { | ||
var length = array ? array.length : 0, | ||
@@ -38,0 +35,0 @@ result = baseAt(array, indexes); |
@@ -1,2 +0,2 @@ | ||
# lodash v4.15.0 | ||
# lodash v4.16.0 | ||
@@ -8,4 +8,4 @@ The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. | ||
Using npm: | ||
```bash | ||
$ {sudo -H} npm i -g npm | ||
```shell | ||
$ npm i -g npm | ||
$ npm i --save lodash | ||
@@ -20,10 +20,10 @@ ``` | ||
var _ = require('lodash/core'); | ||
// Load the fp build for immutable auto-curried iteratee-first data-last methods. | ||
// Load the FP build for immutable auto-curried iteratee-first data-last methods. | ||
var fp = require('lodash/fp'); | ||
// Load a method category. | ||
// Load method categories. | ||
var array = require('lodash/array'); | ||
var object = require('lodash/fp/object'); | ||
// Load a single method for smaller builds with browserify/rollup/webpack. | ||
// Cherry-pick methods for smaller browserify/rollup/webpack bundles. | ||
var chunk = require('lodash/chunk'); | ||
@@ -33,11 +33,10 @@ var extend = require('lodash/fp/extend'); | ||
See the [package source](https://github.com/lodash/lodash/tree/4.15.0-npm) for more details. | ||
See the [package source](https://github.com/lodash/lodash/tree/4.16.0-npm) for more details. | ||
**Note:**<br> | ||
Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` in the Node.js < 6 REPL.<br> | ||
Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes `lodash` by default. | ||
Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. | ||
## Support | ||
Tested in Chrome 51-52, Firefox 47-48, IE 9-11, Edge 14, Safari 8-9, Node.js 0.10-6, & PhantomJS 2.1.1.<br> | ||
Tested in Chrome 52-53, Firefox 47-48, IE 11, Edge 14, Safari 8-9, Node.js 4-6, & PhantomJS 2.1.1.<br> | ||
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. |
@@ -1,4 +0,3 @@ | ||
var baseFlatten = require('./_baseFlatten'), | ||
baseRest = require('./_baseRest'), | ||
createWrap = require('./_createWrap'); | ||
var createWrap = require('./_createWrap'), | ||
flatRest = require('./_flatRest'); | ||
@@ -30,6 +29,6 @@ /** Used to compose bitmasks for function metadata. */ | ||
*/ | ||
var rearg = baseRest(function(func, indexes) { | ||
return createWrap(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); | ||
var rearg = flatRest(function(func, indexes) { | ||
return createWrap(func, REARG_FLAG, undefined, undefined, undefined, indexes); | ||
}); | ||
module.exports = rearg; |
@@ -1,2 +0,2 @@ | ||
var baseRandom = require('./_baseRandom'), | ||
var arraySample = require('./_arraySample'), | ||
isArrayLike = require('./isArrayLike'), | ||
@@ -20,8 +20,5 @@ values = require('./values'); | ||
function sample(collection) { | ||
var array = isArrayLike(collection) ? collection : values(collection), | ||
length = array.length; | ||
return length > 0 ? array[baseRandom(0, length - 1)] : undefined; | ||
return arraySample(isArrayLike(collection) ? collection : values(collection)); | ||
} | ||
module.exports = sample; |
@@ -1,6 +0,6 @@ | ||
var baseClamp = require('./_baseClamp'), | ||
baseRandom = require('./_baseRandom'), | ||
var arraySampleSize = require('./_arraySampleSize'), | ||
isArrayLike = require('./isArrayLike'), | ||
isIterateeCall = require('./_isIterateeCall'), | ||
toArray = require('./toArray'), | ||
toInteger = require('./toInteger'); | ||
toInteger = require('./toInteger'), | ||
values = require('./values'); | ||
@@ -28,23 +28,10 @@ /** | ||
function sampleSize(collection, n, guard) { | ||
var index = -1, | ||
result = toArray(collection), | ||
length = result.length, | ||
lastIndex = length - 1; | ||
if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { | ||
n = 1; | ||
} else { | ||
n = baseClamp(toInteger(n), 0, length); | ||
n = toInteger(n); | ||
} | ||
while (++index < n) { | ||
var rand = baseRandom(index, lastIndex), | ||
value = result[rand]; | ||
result[rand] = result[index]; | ||
result[index] = value; | ||
} | ||
result.length = n; | ||
return result; | ||
return arraySampleSize(isArrayLike(collection) ? collection : values(collection), n); | ||
} | ||
module.exports = sampleSize; |
@@ -1,6 +0,6 @@ | ||
var sampleSize = require('./sampleSize'); | ||
var copyArray = require('./_copyArray'), | ||
isArrayLike = require('./isArrayLike'), | ||
shuffleSelf = require('./_shuffleSelf'), | ||
values = require('./values'); | ||
/** Used as references for the maximum length and index of an array. */ | ||
var MAX_ARRAY_LENGTH = 4294967295; | ||
/** | ||
@@ -22,5 +22,8 @@ * Creates an array of shuffled values, using a version of the | ||
function shuffle(collection) { | ||
return sampleSize(collection, MAX_ARRAY_LENGTH); | ||
return shuffleSelf(isArrayLike(collection) | ||
? copyArray(collection) | ||
: values(collection) | ||
); | ||
} | ||
module.exports = shuffle; |
@@ -29,3 +29,3 @@ var baseFlatten = require('./_baseFlatten'), | ||
* | ||
* _.sortBy(users, function(o) { return o.user; }); | ||
* _.sortBy(users, [function(o) { return o.user; }]); | ||
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] | ||
@@ -35,7 +35,2 @@ * | ||
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] | ||
* | ||
* _.sortBy(users, 'user', function(o) { | ||
* return Math.floor(o.age / 10); | ||
* }); | ||
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] | ||
*/ | ||
@@ -42,0 +37,0 @@ var sortBy = baseRest(function(collection, iteratees) { |
@@ -89,3 +89,4 @@ var assignInDefaults = require('./_assignInDefaults'), | ||
* | ||
* // Use the ES delimiter as an alternative to the default "interpolate" delimiter. | ||
* // Use the ES template literal delimiter as an "interpolate" delimiter. | ||
* // Disable support by replacing the "interpolate" delimiter. | ||
* var compiled = _.template('hello ${ user }!'); | ||
@@ -92,0 +93,0 @@ * compiled({ 'user': 'pebbles' }); |
@@ -10,3 +10,3 @@ var toString = require('./toString'), | ||
* The inverse of `_.escape`; this method converts the HTML entities | ||
* `&`, `<`, `>`, `"`, `'`, and ``` in `string` to | ||
* `&`, `<`, `>`, `"`, and `'` in `string` to | ||
* their corresponding characters. | ||
@@ -13,0 +13,0 @@ * |
@@ -6,4 +6,5 @@ var baseUniq = require('./_baseUniq'); | ||
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) | ||
* for equality comparisons, in which only the first occurrence of each | ||
* element is kept. | ||
* for equality comparisons, in which only the first occurrence of each element | ||
* is kept. The order of result values is determined by the order they occur | ||
* in the array. | ||
* | ||
@@ -10,0 +11,0 @@ * @static |
@@ -7,3 +7,5 @@ var baseIteratee = require('./_baseIteratee'), | ||
* invoked for each element in `array` to generate the criterion by which | ||
* uniqueness is computed. The iteratee is invoked with one argument: (value). | ||
* uniqueness is computed. The order of result values is determined by the | ||
* order they occur in the array. The iteratee is invoked with one argument: | ||
* (value). | ||
* | ||
@@ -10,0 +12,0 @@ * @static |
@@ -5,4 +5,5 @@ var baseUniq = require('./_baseUniq'); | ||
* This method is like `_.uniq` except that it accepts `comparator` which | ||
* is invoked to compare elements of `array`. The comparator is invoked with | ||
* two arguments: (arrVal, othVal). | ||
* is invoked to compare elements of `array`. The order of result values is | ||
* determined by the order they occur in the array.The comparator is invoked | ||
* with two arguments: (arrVal, othVal). | ||
* | ||
@@ -9,0 +10,0 @@ * @static |
var LazyWrapper = require('./_LazyWrapper'), | ||
LodashWrapper = require('./_LodashWrapper'), | ||
baseAt = require('./_baseAt'), | ||
baseFlatten = require('./_baseFlatten'), | ||
baseRest = require('./_baseRest'), | ||
flatRest = require('./_flatRest'), | ||
isIndex = require('./_isIndex'), | ||
@@ -25,4 +24,3 @@ thru = require('./thru'); | ||
*/ | ||
var wrapperAt = baseRest(function(paths) { | ||
paths = baseFlatten(paths, 1); | ||
var wrapperAt = flatRest(function(paths) { | ||
var length = paths.length, | ||
@@ -29,0 +27,0 @@ start = length ? paths[0] : 0, |
@@ -11,4 +11,5 @@ var arrayFilter = require('./_arrayFilter'), | ||
* invoked for each element of each `arrays` to generate the criterion by | ||
* which by which they're compared. The iteratee is invoked with one argument: | ||
* (value). | ||
* which by which they're compared. The order of result values is determined | ||
* by the order they occur in the arrays. The iteratee is invoked with one | ||
* argument: (value). | ||
* | ||
@@ -15,0 +16,0 @@ * @static |
@@ -9,4 +9,5 @@ var arrayFilter = require('./_arrayFilter'), | ||
* This method is like `_.xor` except that it accepts `comparator` which is | ||
* invoked to compare elements of `arrays`. The comparator is invoked with | ||
* two arguments: (arrVal, othVal). | ||
* invoked to compare elements of `arrays`. The order of result values is | ||
* determined by the order they occur in the arrays. The comparator is invoked | ||
* with two arguments: (arrVal, othVal). | ||
* | ||
@@ -13,0 +14,0 @@ * @static |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1380064
1043
40204
40