3.0.12 • Published 8 years ago

turf-invariant v3.0.12

Weekly downloads
12,406
License
ISC
Repository
github
Last release
8 years ago

turf-invariant

build status

enforce expectations about inputs to turf

geojsonType(value, type, name)

Enforce expectations about types of GeoJSON objects for Turf.

Parameters

parametertypedescription
valueGeoJSONany GeoJSON object
typestringexpected GeoJSON type
nameStringname of calling function

featureOf(feature, types, name)

Enforce expectations about types of Feature inputs for Turf. Internally this uses geojsonType to judge geometry types.

Parameters

parametertypedescription
featureFeaturea feature with an expected geometry type
typesstringexpected GeoJSON type
nameStringname of calling function

collectionOf(featurecollection, type, name)

Enforce expectations about types of FeatureCollection inputs for Turf. Internally this uses geojsonType to judge geometry types.

Parameters

parametertypedescription
featurecollectionFeatureCollectiona featurecollection for which features will be judged
typestringexpected GeoJSON type
nameStringname of calling function

Installation

Requires nodejs.

$ npm install turf-invariant

Tests

$ npm test