Comparing version 4.16.3 to 4.16.4
import baseTimes from './_baseTimes.js'; | ||
import isArguments from './isArguments.js'; | ||
import isArray from './isArray.js'; | ||
import isBuffer from './isBuffer.js'; | ||
import isIndex from './_isIndex.js'; | ||
import isTypedArray from './isTypedArray.js'; | ||
@@ -21,14 +23,22 @@ /** Used for built-in method references. */ | ||
function arrayLikeKeys(value, inherited) { | ||
// Safari 8.1 makes `arguments.callee` enumerable in strict mode. | ||
// Safari 9 makes `arguments.length` enumerable in strict mode. | ||
var result = (isArray(value) || isArguments(value)) | ||
? baseTimes(value.length, String) | ||
: []; | ||
var isArr = isArray(value), | ||
isArg = !isArr && isArguments(value), | ||
isBuff = !isArr && !isArg && isBuffer(value), | ||
isType = !isArr && !isArg && !isBuff && isTypedArray(value), | ||
skipIndexes = isArr || isArg || isBuff || isType, | ||
result = skipIndexes ? baseTimes(value.length, String) : [], | ||
length = result.length; | ||
var length = result.length, | ||
skipIndexes = !!length; | ||
for (var key in value) { | ||
if ((inherited || hasOwnProperty.call(value, key)) && | ||
!(skipIndexes && (key == 'length' || isIndex(key, length)))) { | ||
!(skipIndexes && ( | ||
// Safari 9 has enumerable `arguments.length` in strict mode. | ||
key == 'length' || | ||
// Node.js 0.10 has enumerable non-index properties on buffers. | ||
(isBuff && (key == 'offset' || key == 'parent')) || | ||
// PhantomJS 2 has enumerable non-index properties on typed arrays. | ||
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || | ||
// Skip index properties. | ||
isIndex(key, length) | ||
))) { | ||
result.push(key); | ||
@@ -35,0 +45,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import baseClamp from './_baseClamp.js'; | ||
import copyArray from './_copyArray.js'; | ||
@@ -13,5 +14,5 @@ import shuffleSelf from './_shuffleSelf.js'; | ||
function arraySampleSize(array, n) { | ||
return shuffleSelf(copyArray(array), n); | ||
return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); | ||
} | ||
export default arraySampleSize; |
@@ -121,5 +121,3 @@ import Stack from './_Stack.js'; | ||
if (!isArr) { | ||
var props = isFull ? getAllKeys(value) : keys(value); | ||
} | ||
var props = isArr ? undefined : (isFull ? getAllKeys : keys)(value); | ||
arrayEach(props || value, function(subValue, key) { | ||
@@ -126,0 +124,0 @@ if (props) { |
import Stack from './_Stack.js'; | ||
import arrayEach from './_arrayEach.js'; | ||
import assignMergeValue from './_assignMergeValue.js'; | ||
import baseKeysIn from './_baseKeysIn.js'; | ||
import baseFor from './_baseFor.js'; | ||
import baseMergeDeep from './_baseMergeDeep.js'; | ||
import isArray from './isArray.js'; | ||
import isObject from './isObject.js'; | ||
import isTypedArray from './isTypedArray.js'; | ||
import keysIn from './keysIn.js'; | ||
@@ -25,10 +23,3 @@ /** | ||
} | ||
if (!(isArray(source) || isTypedArray(source))) { | ||
var props = baseKeysIn(source); | ||
} | ||
arrayEach(props || source, function(srcValue, key) { | ||
if (props) { | ||
key = srcValue; | ||
srcValue = source[key]; | ||
} | ||
baseFor(source, function(srcValue, key) { | ||
if (isObject(srcValue)) { | ||
@@ -48,5 +39,5 @@ stack || (stack = new Stack); | ||
} | ||
}); | ||
}, keysIn); | ||
} | ||
export default baseMerge; |
import assignMergeValue from './_assignMergeValue.js'; | ||
import cloneBuffer from './_cloneBuffer.js'; | ||
import cloneTypedArray from './_cloneTypedArray.js'; | ||
@@ -8,2 +9,3 @@ import copyArray from './_copyArray.js'; | ||
import isArrayLikeObject from './isArrayLikeObject.js'; | ||
import isBuffer from './isBuffer.js'; | ||
import isFunction from './isFunction.js'; | ||
@@ -47,6 +49,7 @@ import isObject from './isObject.js'; | ||
var isArr = isArray(srcValue), | ||
isTyped = !isArr && isTypedArray(srcValue); | ||
isBuff = !isArr && isBuffer(srcValue), | ||
isTyped = !isArr && !isBuff && isTypedArray(srcValue); | ||
newValue = srcValue; | ||
if (isArr || isTyped) { | ||
if (isArr || isBuff || isTyped) { | ||
if (isArray(objValue)) { | ||
@@ -58,2 +61,6 @@ newValue = objValue; | ||
} | ||
else if (isBuff) { | ||
isCommon = false; | ||
newValue = cloneBuffer(srcValue, true); | ||
} | ||
else if (isTyped) { | ||
@@ -60,0 +67,0 @@ isCommon = false; |
@@ -0,1 +1,2 @@ | ||
import baseClamp from './_baseClamp.js'; | ||
import shuffleSelf from './_shuffleSelf.js'; | ||
@@ -13,5 +14,6 @@ import values from './values.js'; | ||
function baseSampleSize(collection, n) { | ||
return shuffleSelf(values(collection), n); | ||
var array = values(collection); | ||
return shuffleSelf(array, baseClamp(n, 0, array.length)); | ||
} | ||
export default baseSampleSize; |
import Symbol from './_Symbol.js'; | ||
import arrayMap from './_arrayMap.js'; | ||
import isArray from './isArray.js'; | ||
import isSymbol from './isSymbol.js'; | ||
@@ -24,2 +26,6 @@ | ||
} | ||
if (isArray(value)) { | ||
// Recursively convert values (susceptible to call stack limits). | ||
return arrayMap(value, baseToString) + ''; | ||
} | ||
if (isSymbol(value)) { | ||
@@ -26,0 +32,0 @@ return symbolToString ? symbolToString.call(value) : ''; |
@@ -1,2 +0,1 @@ | ||
import baseClamp from './_baseClamp.js'; | ||
import baseRandom from './_baseRandom.js'; | ||
@@ -17,3 +16,3 @@ | ||
size = size === undefined ? length : baseClamp(size, 0, length); | ||
size = size === undefined ? length : size; | ||
while (++index < size) { | ||
@@ -20,0 +19,0 @@ var rand = baseRandom(index, lastIndex), |
@@ -1,6 +0,4 @@ | ||
import isArrayLikeObject from './isArrayLikeObject.js'; | ||
import baseIsArguments from './_baseIsArguments.js'; | ||
import isObjectLike from './isObjectLike.js'; | ||
/** `Object#toString` result references. */ | ||
var argsTag = '[object Arguments]'; | ||
/** Used for built-in method references. */ | ||
@@ -12,9 +10,2 @@ var objectProto = Object.prototype; | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var objectToString = objectProto.toString; | ||
/** Built-in value references. */ | ||
@@ -41,8 +32,7 @@ var propertyIsEnumerable = objectProto.propertyIsEnumerable; | ||
*/ | ||
function isArguments(value) { | ||
// Safari 8.1 makes `arguments.callee` enumerable in strict mode. | ||
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && | ||
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); | ||
} | ||
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { | ||
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && | ||
!propertyIsEnumerable.call(value, 'callee'); | ||
}; | ||
export default isArguments; |
@@ -0,1 +1,2 @@ | ||
import baseKeys from './_baseKeys.js'; | ||
import getTag from './_getTag.js'; | ||
@@ -7,3 +8,3 @@ import isArguments from './isArguments.js'; | ||
import isPrototype from './_isPrototype.js'; | ||
import nativeKeys from './_nativeKeys.js'; | ||
import isTypedArray from './isTypedArray.js'; | ||
@@ -55,4 +56,4 @@ /** `Object#toString` result references. */ | ||
if (isArrayLike(value) && | ||
(isArray(value) || typeof value == 'string' || | ||
typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) { | ||
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || | ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) { | ||
return !value.length; | ||
@@ -65,3 +66,3 @@ } | ||
if (isPrototype(value)) { | ||
return !nativeKeys(value).length; | ||
return !baseKeys(value).length; | ||
} | ||
@@ -68,0 +69,0 @@ for (var key in value) { |
@@ -37,3 +37,3 @@ import isObject from './isObject.js'; | ||
// The use of `Object#toString` avoids issues with the `typeof` operator | ||
// in Safari 8-9 which returns 'object' for typed array and other constructors. | ||
// in Safari 9 which returns 'object' for typed array and other constructors. | ||
var tag = isObject(value) ? objectToString.call(value) : ''; | ||
@@ -40,0 +40,0 @@ return tag == funcTag || tag == genTag || tag == proxyTag; |
@@ -48,3 +48,3 @@ /** | ||
/** Used as the semantic version number. */ | ||
var VERSION = '4.16.3'; | ||
var VERSION = '4.16.4'; | ||
@@ -51,0 +51,0 @@ /** Used to compose bitmasks for function metadata. */ |
{ | ||
"name": "lodash-es", | ||
"version": "4.16.3", | ||
"version": "4.16.4", | ||
"description": "Lodash exported as ES modules.", | ||
@@ -5,0 +5,0 @@ "keywords": "es6, modules, stdlib, util", |
@@ -1,2 +0,2 @@ | ||
# lodash-es v4.16.3 | ||
# lodash-es v4.16.4 | ||
@@ -10,2 +10,2 @@ The [Lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules. | ||
See the [package source](https://github.com/lodash/lodash/tree/4.16.3-es) for more details. | ||
See the [package source](https://github.com/lodash/lodash/tree/4.16.4-es) for more details. |
@@ -11,4 +11,4 @@ import baseToString from './_baseToString.js'; | ||
* @category Lang | ||
* @param {*} value The value to process. | ||
* @returns {string} Returns the string. | ||
* @param {*} value The value to convert. | ||
* @returns {string} Returns the converted string. | ||
* @example | ||
@@ -15,0 +15,0 @@ * |
@@ -7,2 +7,3 @@ import arrayEach from './_arrayEach.js'; | ||
import isArray from './isArray.js'; | ||
import isBuffer from './isBuffer.js'; | ||
import isFunction from './isFunction.js'; | ||
@@ -43,18 +44,19 @@ import isObject from './isObject.js'; | ||
function transform(object, iteratee, accumulator) { | ||
var isArr = isArray(object) || isTypedArray(object); | ||
var isArr = isArray(object), | ||
isArrLike = isArr || isBuffer(object) || isTypedArray(object); | ||
iteratee = baseIteratee(iteratee, 4); | ||
if (accumulator == null) { | ||
if (isArr || isObject(object)) { | ||
var Ctor = object.constructor; | ||
if (isArr) { | ||
accumulator = isArray(object) ? new Ctor : []; | ||
} else { | ||
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; | ||
} | ||
} else { | ||
var Ctor = object && object.constructor; | ||
if (isArrLike) { | ||
accumulator = isArr ? new Ctor : []; | ||
} | ||
else if (isObject(object)) { | ||
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; | ||
} | ||
else { | ||
accumulator = {}; | ||
} | ||
} | ||
(isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { | ||
(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { | ||
return iteratee(accumulator, value, index, object); | ||
@@ -61,0 +63,0 @@ }); |
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
622067
639
19452