ismx-nexo-node-app 0.4.95 → 0.4.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -75,6 +75,15 @@ class ArrayUtils {
|
|
|
75
75
|
static unify(value) {
|
|
76
76
|
return Array.isArray(value) ? value : [value];
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Flattens a two-dimensional array (array of arrays) into a single-dimensional array.
|
|
80
|
+
*
|
|
81
|
+
* @param {T[][]} array - The two-dimensional array to be flattened.
|
|
82
|
+
* @return {T[]} A new array containing all elements from the nested arrays in a single, flat structure.
|
|
83
|
+
*/
|
|
84
|
+
static flatten(array) {
|
|
85
|
+
return array.reduce((acc, val) => acc.concat(val), []);
|
|
86
|
+
}
|
|
78
87
|
/**
|
|
79
88
|
* Returns elements from the first array that are not present in the second array.
|
|
80
89
|
*
|
|
@@ -42,6 +42,13 @@ export default abstract class ArrayUtils {
|
|
|
42
42
|
* @return {T[]} An array containing the input value(s).
|
|
43
43
|
*/
|
|
44
44
|
static unify<T>(value: T | T[]): T[];
|
|
45
|
+
/**
|
|
46
|
+
* Flattens a two-dimensional array (array of arrays) into a single-dimensional array.
|
|
47
|
+
*
|
|
48
|
+
* @param {T[][]} array - The two-dimensional array to be flattened.
|
|
49
|
+
* @return {T[]} A new array containing all elements from the nested arrays in a single, flat structure.
|
|
50
|
+
*/
|
|
51
|
+
static flatten<T>(array: T[][]): T[];
|
|
45
52
|
/**
|
|
46
53
|
* Returns elements from the first array that are not present in the second array.
|
|
47
54
|
*
|
package/package.json
CHANGED
|
@@ -66,6 +66,16 @@ export default abstract class ArrayUtils {
|
|
|
66
66
|
return Array.isArray(value) ? value : [value];
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Flattens a two-dimensional array (array of arrays) into a single-dimensional array.
|
|
71
|
+
*
|
|
72
|
+
* @param {T[][]} array - The two-dimensional array to be flattened.
|
|
73
|
+
* @return {T[]} A new array containing all elements from the nested arrays in a single, flat structure.
|
|
74
|
+
*/
|
|
75
|
+
static flatten<T>(array: T[][]): T[] {
|
|
76
|
+
return array.reduce((acc, val) => acc.concat(val), []);
|
|
77
|
+
}
|
|
78
|
+
|
|
69
79
|
/**
|
|
70
80
|
* Returns elements from the first array that are not present in the second array.
|
|
71
81
|
*
|