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;
|
||||
}
|
||||
|
||||
function flatten(arr) {
|
||||
return arr.reduce((acc, val) => Array.isArray(val) ? acc.concat(flatten(val)) : acc.concat(val), [])
|
||||
}
|
||||
|
||||
/** ******************************************************************
|
||||
* Connect to base
|
||||
******************************************************************* */
|
||||
|
|
@ -599,6 +603,7 @@
|
|||
area2,
|
||||
pwait,
|
||||
ptimer,
|
||||
flatten,
|
||||
center2d,
|
||||
center2pr,
|
||||
thetaDiff,
|
||||
|
|
|
|||
Loading…
Reference in a new issue