Package Exports
- @turf/invariant
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@turf/invariant) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@turf/invariant
getCoord
Unwrap a coordinate from a Feature with a Point geometry, a Point geometry, or a single coordinate.
Parameters
objAny any value
Returns Array<number> a coordinate
geojsonType
Enforce expectations about types of GeoJSON objects for Turf.
Parameters
valueGeoJSON any GeoJSON objecttypestring expected GeoJSON typenamestring name of calling functionThrows Error if value is not the expected type.
featureOf
Enforce expectations about types of Feature inputs for Turf. Internally this uses geojsonType to judge geometry types.
Parameters
featureFeature a feature with an expected geometry typetypestring expected GeoJSON typenamestring name of calling functionThrows Error error if value is not the expected type.
collectionOf
Enforce expectations about types of FeatureCollection inputs for Turf. Internally this uses geojsonType to judge geometry types.
Parameters
featurecollectionFeatureCollection a featurecollection for which features will be judgedtypestring expected GeoJSON typenamestring name of calling functionThrows Error if value is not the expected type.
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @turf/invariantOr install the Turf module that includes it as a function:
$ npm install @turf/turf