lodash.iteratee
Advanced tools
Comparing version 4.1.0 to 4.1.1
131
index.js
/** | ||
* lodash 4.1.0 (Custom Build) <https://lodash.com/> | ||
* lodash 4.1.1 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -16,5 +16,7 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
hasIn = require('lodash.hasin'), | ||
isBuffer = require('lodash.isbuffer'), | ||
keys = require('lodash.keys'), | ||
root = require('lodash._root'), | ||
toPairs = require('lodash.topairs'); | ||
toPairs = require('lodash.topairs'), | ||
toString = require('lodash.tostring'); | ||
@@ -25,5 +27,2 @@ /** Used to compose bitmasks for comparison styles. */ | ||
/** Used as references for various `Number` constants. */ | ||
var INFINITY = 1 / 0; | ||
/** `Object#toString` result references. */ | ||
@@ -221,12 +220,13 @@ var argsTag = '[object Arguments]', | ||
var Map = getNative(root, 'Map'), | ||
Set = getNative(root, 'Set'); | ||
Set = getNative(root, 'Set'), | ||
WeakMap = getNative(root, 'WeakMap'); | ||
/** Used to detect maps and sets. */ | ||
/** Used to detect maps, sets, and weakmaps. */ | ||
var mapCtorString = Map ? funcToString.call(Map) : '', | ||
setCtorString = Set ? funcToString.call(Set) : ''; | ||
setCtorString = Set ? funcToString.call(Set) : '', | ||
weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; | ||
/** Used to convert symbols to primitives and strings. */ | ||
var symbolProto = Symbol ? Symbol.prototype : undefined, | ||
symbolValueOf = Symbol ? symbolProto.valueOf : undefined, | ||
symbolToString = Symbol ? symbolProto.toString : undefined; | ||
symbolValueOf = Symbol ? symbolProto.valueOf : undefined; | ||
@@ -299,2 +299,5 @@ /** | ||
if (isBuffer(value)) { | ||
return cloneBuffer(value, isDeep); | ||
} | ||
if (tag == objectTag || tag == argsTag || (isFunc && !object)) { | ||
@@ -486,14 +489,33 @@ if (isHostObject(value)) { | ||
/** | ||
* Creates a clone of `buffer`. | ||
* Creates a clone of `buffer`. | ||
* | ||
* @private | ||
* @param {ArrayBuffer} buffer The array buffer to clone. | ||
* @param {Buffer} buffer The buffer to clone. | ||
* @param {boolean} [isDeep] Specify a deep clone. | ||
* @returns {Buffer} Returns the cloned buffer. | ||
*/ | ||
function cloneBuffer(buffer, isDeep) { | ||
if (isDeep) { | ||
return buffer.slice(); | ||
} | ||
var Ctor = buffer.constructor, | ||
result = new Ctor(buffer.length); | ||
buffer.copy(result); | ||
return result; | ||
} | ||
/** | ||
* Creates a clone of `arrayBuffer`. | ||
* | ||
* @private | ||
* @param {ArrayBuffer} arrayBuffer The array buffer to clone. | ||
* @returns {ArrayBuffer} Returns the cloned array buffer. | ||
*/ | ||
function cloneBuffer(buffer) { | ||
var Ctor = buffer.constructor, | ||
result = new Ctor(buffer.byteLength), | ||
function cloneArrayBuffer(arrayBuffer) { | ||
var Ctor = arrayBuffer.constructor, | ||
result = new Ctor(arrayBuffer.byteLength), | ||
view = new Uint8Array(result); | ||
view.set(new Uint8Array(buffer)); | ||
view.set(new Uint8Array(arrayBuffer)); | ||
return result; | ||
@@ -564,3 +586,3 @@ } | ||
return new Ctor(isDeep ? cloneBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); | ||
return new Ctor(isDeep ? cloneArrayBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); | ||
} | ||
@@ -690,4 +712,6 @@ | ||
// Fallback for IE 11 providing `toStringTag` values for maps and sets. | ||
if ((Map && getTag(new Map) != mapTag) || (Set && getTag(new Set) != setTag)) { | ||
// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. | ||
if ((Map && getTag(new Map) != mapTag) || | ||
(Set && getTag(new Set) != setTag) || | ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) { | ||
getTag = function(value) { | ||
@@ -699,8 +723,7 @@ var result = objectToString.call(value), | ||
if (ctorString) { | ||
if (ctorString == mapCtorString) { | ||
return mapTag; | ||
switch (ctorString) { | ||
case mapCtorString: return mapTag; | ||
case setCtorString: return setTag; | ||
case weakMapCtorString: return weakMapTag; | ||
} | ||
if (ctorString == setCtorString) { | ||
return setTag; | ||
} | ||
} | ||
@@ -761,3 +784,3 @@ return result; | ||
case arrayBufferTag: | ||
return cloneBuffer(object); | ||
return cloneArrayBuffer(object); | ||
@@ -1015,62 +1038,6 @@ case boolTag: | ||
/** | ||
* Checks if `value` is classified as a `Symbol` primitive or object. | ||
* This method returns the first argument given to it. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @example | ||
* | ||
* _.isSymbol(Symbol.iterator); | ||
* // => true | ||
* | ||
* _.isSymbol('abc'); | ||
* // => false | ||
*/ | ||
function isSymbol(value) { | ||
return typeof value == 'symbol' || | ||
(isObjectLike(value) && objectToString.call(value) == symbolTag); | ||
} | ||
/** | ||
* Converts `value` to a string if it's not one. An empty string is returned | ||
* for `null` and `undefined` values. The sign of `-0` is preserved. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to process. | ||
* @returns {string} Returns the string. | ||
* @example | ||
* | ||
* _.toString(null); | ||
* // => '' | ||
* | ||
* _.toString(-0); | ||
* // => '-0' | ||
* | ||
* _.toString([1, 2, 3]); | ||
* // => '1,2,3' | ||
*/ | ||
function toString(value) { | ||
// Exit early for strings to avoid a performance hit in some environments. | ||
if (typeof value == 'string') { | ||
return value; | ||
} | ||
if (value == null) { | ||
return ''; | ||
} | ||
if (isSymbol(value)) { | ||
return Symbol ? symbolToString.call(value) : ''; | ||
} | ||
var result = (value + ''); | ||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; | ||
} | ||
/** | ||
* This method returns the first argument provided to it. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Util | ||
@@ -1077,0 +1044,0 @@ * @param {*} value Any value. |
{ | ||
"name": "lodash.iteratee", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "The lodash method `_.iteratee` exported as a module.", | ||
@@ -26,5 +26,7 @@ "homepage": "https://lodash.com/", | ||
"lodash.hasin": "^4.0.0", | ||
"lodash.isbuffer": "^4.0.0", | ||
"lodash.keys": "^4.0.0", | ||
"lodash.topairs": "^4.0.0" | ||
"lodash.topairs": "^4.0.0", | ||
"lodash.tostring": "^4.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash.iteratee v4.1.0 | ||
# lodash.iteratee v4.1.1 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.iteratee` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#iteratee) or [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash.iteratee) for more details. | ||
See the [documentation](https://lodash.com/docs#iteratee) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.iteratee) for more details. |
Sorry, the diff of this file is not supported yet
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
32802
12
1009
+ Addedlodash.isbuffer@^4.0.0
+ Addedlodash.tostring@^4.0.0
+ Addedlodash.isbuffer@4.3.4(transitive)
+ Addedlodash.tostring@4.1.4(transitive)