mapbox / geojsonhint

IMPORTANT: This repo will be archived. Use @placemarkio/check-geojson instead
ISC License
258 stars 37 forks source link

Any way to specify expected geojson object type? #27

Closed sckott closed 9 years ago

sckott commented 9 years ago

E.g.,

geojsonhint.hint(<object>, expected = "point")

Would be nice to be able to not only know if the geojson passes the linter, but if the object passed in is actually a Point if you expect it to be - Perhaps this is out of scope.

tmcw commented 9 years ago

This is equivalent to

!geojsonhint.hint(<object>).length && <object>.type === 'Point';

Which I think is more clear

sckott commented 9 years ago

@tmcw thanks, makes sense