all files / mapbox-gl-draw/src/lib/ to_dense_array.js

100% Statements 3/3
100% Branches 0/0
100% Functions 2/2
100% Lines 2/2
1 2 3 4 5 6 7 8 9 10 11 12              614×      
/**
 * 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);
}
 
module.exports = toDenseArray;