Changements dans les modules (nouvelle version Express, mysql, ..)

This commit is contained in:
2023-11-23 13:21:05 +01:00
parent 6af45b3ee2
commit bdab795506
820 changed files with 82281 additions and 35986 deletions

View File

@@ -1,10 +1,3 @@
'use strict'
/**
* Expose `arrayFlatten`.
*/
module.exports = arrayFlatten
/**
* Recursive flatten function with depth.
*
@@ -13,12 +6,12 @@ module.exports = arrayFlatten
* @param {Number} depth
* @return {Array}
*/
function flattenWithDepth (array, result, depth) {
function flattenDepth (array, result, depth) {
for (var i = 0; i < array.length; i++) {
var value = array[i]
if (depth > 0 && Array.isArray(value)) {
flattenWithDepth(value, result, depth - 1)
flattenDepth(value, result, depth - 1)
} else {
result.push(value)
}
@@ -55,10 +48,10 @@ function flattenForever (array, result) {
* @param {Number} depth
* @return {Array}
*/
function arrayFlatten (array, depth) {
module.exports = function (array, depth) {
if (depth == null) {
return flattenForever(array, [])
}
return flattenWithDepth(array, [], depth)
return flattenDepth(array, [], depth)
}

View File

@@ -1,6 +1,6 @@
{
"name": "array-flatten",
"version": "1.1.1",
"version": "1.1.0",
"description": "Flatten an array of nested arrays into a single flat array",
"main": "array-flatten.js",
"files": [