Skip to main content
Version: Next

featureOf

Description

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

Parameters

NameTypeDescription
featureFeaturea feature with an expected geometry type
typestringexpected GeoJSON type
namestringname of calling function

Returns

Installation

$ npm install @turf/invariant

import { featureOf } from "@turf/invariant";
const result = featureOf(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.featureOf(...);