Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash._baseflatten

Package Overview
Dependencies
Maintainers
5
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash._baseflatten - npm Package Compare versions

Comparing version 3.1.3 to 3.1.4

LICENSE

46

index.js
/**
* lodash 3.1.3 (Custom Build) <https://lodash.com/>
* lodash 3.1.4 (Custom Build) <https://lodash.com/>
* Build: `lodash modern modularize exports="npm" -o ./`

@@ -24,3 +24,3 @@ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>

/**
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
* of an array-like value.

@@ -31,2 +31,21 @@ */

/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
/**
* The base implementation of `_.flatten` with added support for restricting

@@ -39,9 +58,10 @@ * flattening and specifying the start index.

* @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, isDeep, isStrict) {
function baseFlatten(array, isDeep, isStrict, result) {
result || (result = []);
var index = -1,
length = array.length,
resIndex = -1,
result = [];
length = array.length;

@@ -54,12 +74,8 @@ while (++index < length) {

// Recursively flatten arrays (susceptible to call stack limits).
value = baseFlatten(value, isDeep, isStrict);
baseFlatten(value, isDeep, isStrict, result);
} else {
arrayPush(result, value);
}
var valIndex = -1,
valLength = value.length;
while (++valIndex < valLength) {
result[++resIndex] = value[valIndex];
}
} else if (!isStrict) {
result[++resIndex] = value;
result[result.length] = value;
}

@@ -109,3 +125,3 @@ }

*
* **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
* **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*

@@ -112,0 +128,0 @@ * @private

{
"name": "lodash._baseflatten",
"version": "3.1.3",
"version": "3.1.4",
"description": "The modern build of lodash’s internal `baseFlatten` as a module.",

@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/",

@@ -1,2 +0,2 @@

# lodash._baseflatten v3.1.3
# lodash._baseflatten v3.1.4

@@ -20,2 +20,2 @@ The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseFlatten` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.

See the [package source](https://github.com/lodash/lodash/blob/3.1.3-npm-packages/lodash._baseflatten) for more details.
See the [package source](https://github.com/lodash/lodash/blob/3.1.4-npm-packages/lodash._baseflatten) for more details.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc