UNPKG
@mapbox/mapbox-gl-draw
Version:
dev (1.4.4-alpha.db018ed)
latest (1.5.1)
next (1.2.0-beta.1)
1.5.1
1.5.0
1.4.4-alpha.db018ed
1.4.3
1.4.2
1.4.1
1.4.0
1.3.0
1.2.2
1.2.1
1.2.0
1.2.0-beta.1
1.1.2
1.1.1
1.1.0
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.19.1
0.19.0
0.18.1
0.18.0
0.17.4
0.17.3
0.17.2
0.17.1
0.17.0
0.16.1
0.16.0
A drawing component for Mapbox GL JS
github.com/mapbox/mapbox-gl-draw
mapbox/mapbox-gl-draw
@mapbox/mapbox-gl-draw
/
src
/
lib
/
to_dense_array.js
12 lines
(10 loc)
•
236 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
/** * Derive a dense array (no `undefined`s) from a single value or array. * *
@param
{
any
}
x
*
@return
{
Array<any>
} */
function
toDenseArray
(
x
) {
return
[].
concat
(x).
filter
(
y
=>
y !==
undefined
); }
export
default
toDenseArray;