lodash._baseflatten
Advanced tools
Comparing version 4.0.1 to 4.1.0
19
index.js
/** | ||
* lodash 4.0.1 (Custom Build) <https://lodash.com/> | ||
* lodash 4.1.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -57,3 +57,3 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* @param {Array} array The array to flatten. | ||
* @param {boolean} [isDeep] Specify a deep flatten. | ||
* @param {number} depth The maximum recursion depth. | ||
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects. | ||
@@ -63,3 +63,3 @@ * @param {Array} [result=[]] The initial result value. | ||
*/ | ||
function baseFlatten(array, isDeep, isStrict, result) { | ||
function baseFlatten(array, depth, isStrict, result) { | ||
result || (result = []); | ||
@@ -72,7 +72,7 @@ | ||
var value = array[index]; | ||
if (isArrayLikeObject(value) && | ||
if (depth > 0 && isArrayLikeObject(value) && | ||
(isStrict || isArray(value) || isArguments(value))) { | ||
if (isDeep) { | ||
if (depth > 1) { | ||
// Recursively flatten arrays (susceptible to call stack limits). | ||
baseFlatten(value, isDeep, isStrict, result); | ||
baseFlatten(value, depth - 1, isStrict, result); | ||
} else { | ||
@@ -140,3 +140,3 @@ arrayPush(result, value); | ||
* @memberOf _ | ||
* @type Function | ||
* @type {Function} | ||
* @category Lang | ||
@@ -168,3 +168,2 @@ * @param {*} value The value to check. | ||
* @memberOf _ | ||
* @type Function | ||
* @category Lang | ||
@@ -198,3 +197,2 @@ * @param {*} value The value to check. | ||
* @memberOf _ | ||
* @type Function | ||
* @category Lang | ||
@@ -270,3 +268,4 @@ * @param {*} value The value to check. | ||
function isLength(value) { | ||
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; | ||
return typeof value == 'number' && | ||
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; | ||
} | ||
@@ -273,0 +272,0 @@ |
{ | ||
"name": "lodash._baseflatten", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "The internal lodash function `baseFlatten` exported as a module.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/", |
@@ -1,2 +0,2 @@ | ||
# lodash._baseflatten v4.0.1 | ||
# lodash._baseflatten v4.1.0 | ||
@@ -18,2 +18,2 @@ The internal [lodash](https://lodash.com/) function `baseFlatten` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [package source](https://github.com/lodash/lodash/blob/4.0.1-npm-packages/lodash._baseflatten) for more details. | ||
See the [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash._baseflatten) 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
10652
299