UNPKG

geotoolbox

Version:

geotoolbox is GIS javascript library. It is based on d3geo, topojson and geos-wasm.

19 lines (18 loc) 485 B
/** * @function <s>properties/remove</s> * @deprecated * @summary From now on, use {@link columns} */ export function remove({ x, field }) { let data = [...x.features.map((d) => ({ ...d.properties }))]; data.forEach((d) => { if (Array.isArray(field)) { field.forEach((e) => delete d[e]); } else { delete d[field]; } }); let output = JSON.parse(JSON.stringify(x)); output.features.map((d, i) => (d.properties = { ...data[i] })); return output; }