UNPKG

@mapbox/mapbox-gl-draw

Version:

A drawing component for Mapbox GL JS

12 lines (10 loc) 236 B
/** * 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;