@turf/boolean-clockwise
Advanced tools
Comparing version 5.1.5 to 6.0.0
20
index.js
@@ -1,3 +0,4 @@ | ||
import { getCoords } from '@turf/invariant'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var invariant_1 = require("@turf/invariant"); | ||
/** | ||
@@ -7,3 +8,3 @@ * Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise. | ||
* @name booleanClockwise | ||
* @param {Feature<LineString>} line to be evaluated | ||
* @param {Feature<LineString>|LineString|Array<Array<number>>} line to be evaluated | ||
* @returns {boolean} true/false | ||
@@ -20,11 +21,7 @@ * @example | ||
function booleanClockwise(line) { | ||
// validation | ||
if (!line) throw new Error('line is required'); | ||
var type = (line.geometry) ? line.geometry.type : line.type; | ||
if (!Array.isArray(line) && type !== 'LineString') throw new Error('geometry must be a LineString'); | ||
var ring = getCoords(line); | ||
var ring = invariant_1.getCoords(line); | ||
var sum = 0; | ||
var i = 1; | ||
var prev, cur; | ||
var prev; | ||
var cur; | ||
while (i < ring.length) { | ||
@@ -38,3 +35,2 @@ prev = cur || ring[0]; | ||
} | ||
export default booleanClockwise; | ||
exports.default = booleanClockwise; |
{ | ||
"name": "@turf/boolean-clockwise", | ||
"version": "5.1.5", | ||
"version": "6.0.0", | ||
"description": "turf boolean-clockwise 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", | ||
"pretest": "tsc", | ||
"test": "node test.js", | ||
"bench": "node bench.js", | ||
"docs": "node ../../scripts/generate-readmes" | ||
@@ -43,17 +38,12 @@ }, | ||
"devDependencies": { | ||
"@std/esm": "*", | ||
"benchmark": "*", | ||
"glob": "*", | ||
"load-json-file": "*", | ||
"rollup": "*", | ||
"typescript": "*", | ||
"tape": "*" | ||
}, | ||
"dependencies": { | ||
"@turf/helpers": "^5.1.5", | ||
"@turf/invariant": "^5.1.5" | ||
}, | ||
"@std/esm": { | ||
"esm": "js", | ||
"cjs": true | ||
"@turf/helpers": "6.x", | ||
"@turf/invariant": "6.x" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
5585
5
64
+ Added@turf/helpers@6.5.0(transitive)
+ Added@turf/invariant@6.5.0(transitive)
- Removed@turf/helpers@5.1.5(transitive)
- Removed@turf/invariant@5.2.0(transitive)
Updated@turf/helpers@6.x
Updated@turf/invariant@6.x