We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fd34fd commit ac3f5cdCopy full SHA for ac3f5cd
src/StatusHandler.js
@@ -5,14 +5,15 @@ const PUSH_STATUS_COLLECTION = '_PushStatus';
5
const JOB_STATUS_COLLECTION = '_JobStatus';
6
7
export function flatten(array) {
8
- return array.reduce((memo, element) => {
9
- if (Array.isArray(element)) {
10
- memo = memo.concat(flatten(element));
+ var flattened = [];
+ for(var i = 0; i < array.length; i++) {
+ if(Array.isArray(array[i])) {
11
+ flattened = flattened.concat(flatten(array[i]));
12
} else {
- memo = memo.concat(element);
13
+ flattened.push(array[i]);
14
}
- return memo;
15
- }, []);
+ }
16
+ return flattened;
17
18
19
function statusHandler(className, database) {
0 commit comments