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

@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.1.5 to 6.0.0

index.ts

33

index.js

@@ -1,4 +0,5 @@

import destination from '@turf/destination';
import { polygon } from '@turf/helpers';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var destination_1 = require("@turf/destination");
var helpers_1 = require("@turf/helpers");
/**

@@ -25,26 +26,14 @@ * Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.

function circle(center, radius, options) {
// Optional params
options = options || {};
if (options === void 0) { options = {}; }
// default params
var steps = options.steps || 64;
var properties = options.properties;
// validation
if (!center) throw new Error('center is required');
if (!radius) throw new Error('radius is required');
if (typeof options !== 'object') throw new Error('options must be an object');
if (typeof steps !== 'number') throw new Error('steps must be a number');
// default params
steps = steps || 64;
properties = properties || center.properties || {};
var properties = options.properties ? options.properties : (!Array.isArray(center) && center.type === 'Feature' && center.properties) ? center.properties : {};
// main
var coordinates = [];
for (var i = 0; i < steps; i++) {
coordinates.push(destination(center, radius, i * -360 / steps, options).geometry.coordinates);
coordinates.push(destination_1.default(center, radius, i * -360 / steps, options).geometry.coordinates);
}
coordinates.push(coordinates[0]);
return polygon([coordinates], properties);
return helpers_1.polygon([coordinates], properties);
}
export default circle;
exports.default = circle;
{
"name": "@turf/circle",
"version": "5.1.5",
"version": "6.0.0",
"description": "turf circle module",
"main": "main.js",
"module": "main.es.js",
"types": "index.d.ts",
"main": "index",
"files": [
"index.js",
"index.d.ts",
"main.js",
"main.es.js"
"index.ts"
],
"scripts": {
"pretest": "rollup -c ../../rollup.config.js",
"test": "node -r @std/esm test.js",
"posttest": "node -r @std/esm ../../scripts/validate-es5-dependencies.js",
"bench": "node -r @std/esm bench.js",
"prepare": "tsc",
"pretest": "tsc",
"test": "node test.js",
"bench": "node bench.js",
"docs": "node ../../scripts/generate-readmes"

@@ -41,7 +37,6 @@ },

"@mapbox/geojsonhint": "*",
"@std/esm": "*",
"@turf/truncate": "^5.1.5",
"@turf/truncate": "*",
"benchmark": "*",
"load-json-file": "*",
"rollup": "*",
"typescript": "*",
"tape": "*",

@@ -51,9 +46,5 @@ "write-json-file": "*"

"dependencies": {
"@turf/destination": "^5.1.5",
"@turf/helpers": "^5.1.5"
},
"@std/esm": {
"esm": "js",
"cjs": true
"@turf/destination": "6.x",
"@turf/helpers": "6.x"
}
}
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