modify-spec

object modification function specifications


modify-spec

use

const modify = require('./modify.js')
/// ...
  f = modify(f)
  if (f) console.log(f)
/// ...

define

// modify.js
module.exports = f => {
  f.tippecanoe = {minzoom: 2, maxzoom: 5, layer: 'some'}
  return f
}

specifications

  1. If the feature shall be deleted, the modify function shall return false.
  2. Otherwise, the modify function shall return the modified object.

actual use of this specifications

os-gpkg-vt

modify.js works for index.js.

pnd

pnd was renovated to use modify-spec.