Socket
Socket
Sign inDemoInstall

@turf/invariant

Package Overview
Dependencies
Maintainers
4
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/invariant - npm Package Compare versions

Comparing version 5.0.0-alpha to 5.0.0

main.js

27

package.json
{
"name": "@turf/invariant",
"version": "5.0.0-alpha",
"version": "5.0.0",
"description": "turf invariant module",
"main": "index.es5.js",
"module": "index.js",
"jsnext:main": "index.js",
"main": "main",
"module": "index",
"jsnext:main": "index",
"types": "index.d.ts",

@@ -12,8 +12,9 @@ "files": [

"index.d.ts",
"index.es5.js"
"main.js"
],
"scripts": {
"pretest": "rollup -c ../../rollup.config.js",
"test": "node test.es5.js",
"bench": "node bench.js"
"test": "node -r @std/esm test.js",
"posttest": "uglifyjs main.js -o main.min.js",
"bench": "node -r @std/esm bench.js"
},

@@ -40,8 +41,14 @@ "repository": {

"devDependencies": {
"@turf/helpers": "*",
"@turf/helpers": "5.0.0",
"benchmark": "*",
"rollup": "*",
"tape": "*"
"tape": "*",
"@std/esm": "*",
"uglify-js": "*"
},
"dependencies": {}
"dependencies": {},
"@std/esm": {
"esm": "js",
"cjs": true
}
}
# @turf/invariant
# getCoord
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## getCoord
Unwrap a coordinate from a Point Feature, Geometry or a single coordinate.

@@ -22,3 +24,3 @@

# getCoords
## getCoords

@@ -42,3 +44,3 @@ Unwrap coordinates from a Feature, Geometry Object or an Array of numbers

# containsNumber
## containsNumber

@@ -53,3 +55,3 @@ Checks if coordinates contains a number

# geojsonType
## geojsonType

@@ -67,3 +69,3 @@ Enforce expectations about types of GeoJSON objects for Turf.

# featureOf
## featureOf

@@ -82,3 +84,3 @@ Enforce expectations about types of [Feature](http://geojson.org/geojson-spec.html#feature-objects) inputs for Turf.

# collectionOf
## collectionOf

@@ -97,3 +99,3 @@ Enforce expectations about types of [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) inputs for Turf.

# getGeom
## getGeom

@@ -125,33 +127,10 @@ Get Geometry from Feature or Geometry Object

# getGeomType
## getGeomType
Get Geometry Type from Feature or Geometry Object
**DEPRECATED** in v5.0.0 in favor of getType
**Parameters**
- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** **DEPRECATED** in v5.0.0 in favor of getType
- `geojson` **([Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry))** GeoJSON Feature or Geometry Object
- `name` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** name of the variable to display in error message
## getType
**Examples**
```javascript
var point = {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [110, 40]
}
}
var geom = turf.getGeomType(point)
//="Point"
```
- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if geojson is not a Feature or Geometry Object
Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** GeoJSON Geometry Type
# getType
Get GeoJSON object's type, Geometry type is prioritize.

@@ -162,3 +141,3 @@

- `geojson` **[GeoJSON](http://geojson.org/geojson-spec.html#geojson-objects)** GeoJSON object
- `name` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** name of the variable to display in error message
- `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of the variable to display in error message

@@ -165,0 +144,0 @@ **Examples**

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc