Socket
Socket
Sign inDemoInstall

@turf/sector

Package Overview
Dependencies
Maintainers
4
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/sector - npm Package Compare versions

Comparing version 5.0.4 to 5.1.0

main.mjs

2

index.js

@@ -12,3 +12,3 @@ import circle from '@turf/circle';

* @name sector
* @param {Feature<Point>} center center point
* @param {Coord} center center point
* @param {number} radius radius of the circle

@@ -15,0 +15,0 @@ * @param {number} bearing1 angle, in decimal degrees, of the first radius of the sector

@@ -16,3 +16,3 @@ 'use strict';

* @name sector
* @param {Feature<Point>} center center point
* @param {Coord} center center point
* @param {number} radius radius of the circle

@@ -39,10 +39,10 @@ * @param {number} bearing1 angle, in decimal degrees, of the first radius of the sector

options = options || {};
if (!helpers.isObject(options)) throw new Error('options is invalid');
if (!helpers.isObject(options)) { throw new Error('options is invalid'); }
// validation
if (!center) throw new Error('center is required');
if (bearing1 === undefined || bearing1 === null) throw new Error('bearing1 is required');
if (bearing2 === undefined || bearing2 === null) throw new Error('bearing2 is required');
if (!radius) throw new Error('radius is required');
if (typeof options !== 'object') throw new Error('options must be an object');
if (!center) { throw new Error('center is required'); }
if (bearing1 === undefined || bearing1 === null) { throw new Error('bearing1 is required'); }
if (bearing2 === undefined || bearing2 === null) { throw new Error('bearing2 is required'); }
if (!radius) { throw new Error('radius is required'); }
if (typeof options !== 'object') { throw new Error('options must be an object'); }

@@ -73,3 +73,3 @@ if (convertAngleTo360(bearing1) === convertAngleTo360(bearing2)) {

var beta = alfa % 360;
if (beta < 0) beta += 360;
if (beta < 0) { beta += 360; }
return beta;

@@ -76,0 +76,0 @@ }

{
"name": "@turf/sector",
"version": "5.0.4",
"version": "5.1.0",
"description": "turf sector 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"
},

@@ -37,6 +38,7 @@ "repository": {

"@std/esm": "*",
"@turf/truncate": "^5.0.4",
"@turf/truncate": "^5.1.0",
"benchmark": "*",
"load-json-file": "*",
"rollup": "*",
"rollup-plugin-buble": "*",
"tape": "*",

@@ -46,7 +48,7 @@ "write-json-file": "*"

"dependencies": {
"@turf/circle": "^5.0.4",
"@turf/helpers": "^5.0.4",
"@turf/invariant": "^5.0.4",
"@turf/line-arc": "^5.0.4",
"@turf/meta": "^5.0.4"
"@turf/circle": "^5.1.0",
"@turf/helpers": "^5.1.0",
"@turf/invariant": "^5.1.0",
"@turf/line-arc": "^5.1.0",
"@turf/meta": "^5.1.0"
},

@@ -53,0 +55,0 @@ "@std/esm": {

@@ -7,3 +7,3 @@ # @turf/sector

Creates a circular sector of a circle of given radius and center [Point](http://geojson.org/geojson-spec.html#point),
Creates a circular sector of a circle of given radius and center [Point](https://tools.ietf.org/html/rfc7946#section-3.1.2),
between (clockwise) bearing1 and bearing2; 0 bearing is North of center point, positive clockwise.

@@ -13,3 +13,3 @@

- `center` **[Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;[Point](http://geojson.org/geojson-spec.html#point)>** center point
- `center` **[Coord](https://tools.ietf.org/html/rfc7946#section-3.1.1)** center point
- `radius` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** radius of the circle

@@ -36,3 +36,3 @@ - `bearing1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle, in decimal degrees, of the first radius of the sector

Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;[Polygon](http://geojson.org/geojson-spec.html#polygon)>** sector polygon
Returns **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)&lt;[Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6)>** sector polygon

@@ -39,0 +39,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