Socket
Socket
Sign inDemoInstall

@turf/circle

Package Overview
Dependencies
Maintainers
4
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/circle - npm Package Compare versions

Comparing version 5.0.0 to 5.0.4

16

index.d.ts

@@ -1,2 +0,2 @@

import { Feature, Point, Polygon, Units, Position } from '@turf/helpers'
import { Feature, Coord, Polygon, Units, Properties } from '@turf/helpers'

@@ -7,9 +7,9 @@ /**

export default function (
center: Feature<Point> | Point | Position,
radius: number,
options?: {
steps?: number;
units?: Units;
properties?: object;
}
center: Coord,
radius: number,
options?: {
steps?: number;
units?: Units;
properties?: Properties;
}
): Feature<Polygon>;

@@ -18,8 +18,5 @@ import destination from '@turf/destination';

* var radius = 5;
* var steps = 10;
* var units = 'kilometers';
* var properties = {foo: 'bar'};
* var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};
* var circle = turf.circle(center, radius, options);
*
* var circle = turf.circle(center, radius, steps, units, properties);
*
* //addToMap

@@ -32,3 +29,2 @@ * var addToMap = [turf.point(center), circle]

var steps = options.steps || 64;
var units = options.units;
var properties = options.properties;

@@ -48,3 +44,3 @@

for (var i = 0; i < steps; i++) {
coordinates.push(destination(center, radius, i * 360 / steps, units).geometry.coordinates);
coordinates.push(destination(center, radius, i * -360 / steps, options).geometry.coordinates);
}

@@ -51,0 +47,0 @@ coordinates.push(coordinates[0]);

@@ -22,8 +22,5 @@ 'use strict';

* var radius = 5;
* var steps = 10;
* var units = 'kilometers';
* var properties = {foo: 'bar'};
* var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};
* var circle = turf.circle(center, radius, options);
*
* var circle = turf.circle(center, radius, steps, units, properties);
*
* //addToMap

@@ -36,3 +33,2 @@ * var addToMap = [turf.point(center), circle]

var steps = options.steps || 64;
var units = options.units;
var properties = options.properties;

@@ -52,3 +48,3 @@

for (var i = 0; i < steps; i++) {
coordinates.push(destination(center, radius, i * 360 / steps, units).geometry.coordinates);
coordinates.push(destination(center, radius, i * -360 / steps, options).geometry.coordinates);
}

@@ -55,0 +51,0 @@ coordinates.push(coordinates[0]);

{
"name": "@turf/circle",
"version": "5.0.0",
"version": "5.0.4",
"description": "turf circle module",

@@ -17,3 +17,2 @@ "main": "main",

"test": "node -r @std/esm test.js",
"posttest": "uglifyjs main.js -o main.min.js",
"bench": "node -r @std/esm bench.js"

@@ -40,14 +39,14 @@ },

"devDependencies": {
"@turf/truncate": "*",
"@mapbox/geojsonhint": "*",
"@std/esm": "*",
"@turf/truncate": "^5.0.4",
"benchmark": "*",
"load-json-file": "*",
"rollup": "*",
"tape": "*",
"write-json-file": "*",
"rollup": "*",
"@std/esm": "*",
"uglify-js": "*"
"write-json-file": "*"
},
"dependencies": {
"@turf/destination": "5.0.0",
"@turf/helpers": "5.0.0"
"@turf/destination": "^5.0.4",
"@turf/helpers": "^5.0.4"
},

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

@@ -13,6 +13,6 @@ # @turf/circle

- `radius` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** radius of the circle
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional parameters
- `steps` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** number of steps (optional, default `64`)
- `units` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** miles, kilometers, degrees, or radians (optional, default `"kilometers"`)
- `properties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** properties (optional, default `{}`)
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`)
- `options.steps` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** number of steps (optional, default `64`)
- `options.units` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** miles, kilometers, degrees, or radians (optional, default `'kilometers'`)
- `options.properties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** properties (optional, default `{}`)

@@ -24,8 +24,5 @@ **Examples**

var radius = 5;
var steps = 10;
var units = 'kilometers';
var properties = {foo: 'bar'};
var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};
var circle = turf.circle(center, radius, options);
var circle = turf.circle(center, radius, steps, units, properties);
//addToMap

@@ -32,0 +29,0 @@ var addToMap = [turf.point(center), circle]

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