add flatten util
This commit is contained in:
parent
83f814d42b
commit
3c0e735f63
1 changed files with 5 additions and 0 deletions
|
|
@ -513,6 +513,10 @@
|
||||||
return oa;
|
return oa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function flatten(arr) {
|
||||||
|
return arr.reduce((acc, val) => Array.isArray(val) ? acc.concat(flatten(val)) : acc.concat(val), [])
|
||||||
|
}
|
||||||
|
|
||||||
/** ******************************************************************
|
/** ******************************************************************
|
||||||
* Connect to base
|
* Connect to base
|
||||||
******************************************************************* */
|
******************************************************************* */
|
||||||
|
|
@ -599,6 +603,7 @@
|
||||||
area2,
|
area2,
|
||||||
pwait,
|
pwait,
|
||||||
ptimer,
|
ptimer,
|
||||||
|
flatten,
|
||||||
center2d,
|
center2d,
|
||||||
center2pr,
|
center2pr,
|
||||||
thetaDiff,
|
thetaDiff,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue