Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/projection

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/projection - npm Package Compare versions

Comparing version 5.0.4 to 5.1.0

main.mjs

16

main.js

@@ -63,10 +63,10 @@ 'use strict';

options = options || {};
if (!helpers.isObject(options)) throw new Error('options is invalid');
if (!helpers.isObject(options)) { throw new Error('options is invalid'); }
var mutate = options.mutate;
// Validation
if (!geojson) throw new Error('geojson is required');
if (!geojson) { throw new Error('geojson is required'); }
// Handle Position
if (Array.isArray(geojson) && helpers.isNumber(geojson[0])) geojson = (projection === 'mercator') ? convertToMercator(geojson) : convertToWgs84(geojson);
if (Array.isArray(geojson) && helpers.isNumber(geojson[0])) { geojson = (projection === 'mercator') ? convertToMercator(geojson) : convertToWgs84(geojson); }

@@ -76,3 +76,3 @@ // Handle GeoJSON

// Handle possible data mutation
if (mutate !== true) geojson = clone(geojson);
if (mutate !== true) { geojson = clone(geojson); }

@@ -111,6 +111,6 @@ meta.coordEach(geojson, function (coord) {

// if xy value is beyond maxextent (e.g. poles), return maxextent
if (xy[0] > MAXEXTENT) xy[0] = MAXEXTENT;
if (xy[0] < -MAXEXTENT) xy[0] = -MAXEXTENT;
if (xy[1] > MAXEXTENT) xy[1] = MAXEXTENT;
if (xy[1] < -MAXEXTENT) xy[1] = -MAXEXTENT;
if (xy[0] > MAXEXTENT) { xy[0] = MAXEXTENT; }
if (xy[0] < -MAXEXTENT) { xy[0] = -MAXEXTENT; }
if (xy[1] > MAXEXTENT) { xy[1] = MAXEXTENT; }
if (xy[1] < -MAXEXTENT) { xy[1] = -MAXEXTENT; }

@@ -117,0 +117,0 @@ return xy;

{
"name": "@turf/projection",
"version": "5.0.4",
"version": "5.1.0",
"description": "turf projection module",
"main": "main",
"module": "index",
"jsnext:main": "index",
"main": "main.js",
"module": "main.mjs",
"types": "index.d.ts",

@@ -12,3 +11,4 @@ "files": [

"index.d.ts",
"main.js"
"main.js",
"main.mjs"
],

@@ -18,3 +18,4 @@ "scripts": {

"test": "node -r @std/esm test.js",
"bench": "node -r @std/esm bench.js"
"bench": "node -r @std/esm bench.js",
"docs": "node ../../scripts/generate-readmes"
},

@@ -51,3 +52,3 @@ "repository": {

"@std/esm": "*",
"@turf/truncate": "^5.0.4",
"@turf/truncate": "^5.1.0",
"benchmark": "*",

@@ -57,2 +58,3 @@ "load-json-file": "*",

"rollup": "*",
"rollup-plugin-buble": "*",
"tape": "*",

@@ -62,5 +64,5 @@ "write-json-file": "*"

"dependencies": {
"@turf/clone": "^5.0.4",
"@turf/helpers": "^5.0.4",
"@turf/meta": "^5.0.4"
"@turf/clone": "^5.1.0",
"@turf/helpers": "^5.1.0",
"@turf/meta": "^5.1.0"
},

@@ -67,0 +69,0 @@ "@std/esm": {

@@ -11,3 +11,3 @@ # @turf/projection

- `geojson` **([GeoJSON](http://geojson.org/geojson-spec.html#geojson-objects) | Position)** WGS84 GeoJSON object
- `geojson` **([GeoJSON](https://tools.ietf.org/html/rfc7946#section-3) | Position)** WGS84 GeoJSON object
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional parameters

@@ -26,3 +26,3 @@ - `options.mutate` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** allows GeoJSON input to be mutated (significant performance increase if true) (optional, default `false`)

Returns **[GeoJSON](http://geojson.org/geojson-spec.html#geojson-objects)** true/false
Returns **[GeoJSON](https://tools.ietf.org/html/rfc7946#section-3)** true/false

@@ -35,3 +35,3 @@ ## toWgs84

- `geojson` **([GeoJSON](http://geojson.org/geojson-spec.html#geojson-objects) | Position)** Mercator GeoJSON object
- `geojson` **([GeoJSON](https://tools.ietf.org/html/rfc7946#section-3) | Position)** Mercator GeoJSON object
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional parameters

@@ -50,3 +50,3 @@ - `options.mutate` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** allows GeoJSON input to be mutated (significant performance increase if true) (optional, default `false`)

Returns **[GeoJSON](http://geojson.org/geojson-spec.html#geojson-objects)** true/false
Returns **[GeoJSON](https://tools.ietf.org/html/rfc7946#section-3)** true/false

@@ -53,0 +53,0 @@ <!-- This file is automatically generated. Please don't edit it directly:

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