包详细信息

turf-invariant

Turfjs82.4kISC不推荐使用3.0.12

Turf packages are now namespaced: please use @turf/invariant instead

enforce expectations about inputs to turf

turf, invariant, expectations

自述文件

turf-invariant

build status

enforce expectations about inputs to turf

geojsonType(value, type, name)

Enforce expectations about types of GeoJSON objects for Turf.

Parameters

parameter type description
value GeoJSON any GeoJSON object
type string expected GeoJSON type
name String name 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

parameter type description
feature Feature a feature with an expected geometry type
types string expected GeoJSON type
name String name 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

parameter type description
featurecollection FeatureCollection a featurecollection for which features will be judged
type string expected GeoJSON type
name String name of calling function

Installation

Requires nodejs.

$ npm install turf-invariant

Tests

$ npm test