@turf/line-slice-along
Advanced tools
Comparing version 5.1.0 to 5.1.5
10
main.js
@@ -36,3 +36,3 @@ 'use strict'; | ||
options = options || {}; | ||
if (!helpers.isObject(options)) { throw new Error('options is invalid'); } | ||
if (!helpers.isObject(options)) throw new Error('options is invalid'); | ||
@@ -43,5 +43,5 @@ var coords; | ||
// Validation | ||
if (line.type === 'Feature') { coords = line.geometry.coordinates; } | ||
else if (line.type === 'LineString') { coords = line.coordinates; } | ||
else { throw new Error('input must be a LineString Feature or Geometry'); } | ||
if (line.type === 'Feature') coords = line.geometry.coordinates; | ||
else if (line.type === 'LineString') coords = line.coordinates; | ||
else throw new Error('input must be a LineString Feature or Geometry'); | ||
@@ -51,3 +51,3 @@ var travelled = 0; | ||
for (var i = 0; i < coords.length; i++) { | ||
if (startDist >= travelled && i === coords.length - 1) { break; } | ||
if (startDist >= travelled && i === coords.length - 1) break; | ||
else if (travelled > startDist && slice.length === 0) { | ||
@@ -54,0 +54,0 @@ overshot = startDist - travelled; |
{ | ||
"name": "@turf/line-slice-along", | ||
"version": "5.1.0", | ||
"version": "5.1.5", | ||
"description": "turf line-slice-along module", | ||
"main": "main.js", | ||
"module": "main.mjs", | ||
"module": "main.es.js", | ||
"types": "index.d.ts", | ||
@@ -12,3 +12,3 @@ "files": [ | ||
"main.js", | ||
"main.mjs" | ||
"main.es.js" | ||
], | ||
@@ -18,2 +18,3 @@ "scripts": { | ||
"test": "node -r @std/esm test.js", | ||
"posttest": "node -r @std/esm ../../scripts/validate-es5-dependencies.js", | ||
"bench": "node -r @std/esm bench.js", | ||
@@ -39,14 +40,13 @@ "docs": "node ../../scripts/generate-readmes" | ||
"@std/esm": "*", | ||
"@turf/along": "^5.1.0", | ||
"@turf/along": "^5.1.5", | ||
"benchmark": "*", | ||
"load-json-file": "*", | ||
"rollup": "*", | ||
"rollup-plugin-buble": "*", | ||
"tape": "*" | ||
}, | ||
"dependencies": { | ||
"@turf/bearing": "^5.1.0", | ||
"@turf/destination": "^5.1.0", | ||
"@turf/distance": "^5.1.0", | ||
"@turf/helpers": "^5.1.0" | ||
"@turf/bearing": "^5.1.5", | ||
"@turf/destination": "^5.1.5", | ||
"@turf/distance": "^5.1.5", | ||
"@turf/helpers": "^5.1.5" | ||
}, | ||
@@ -53,0 +53,0 @@ "@std/esm": { |
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
14510
6
Updated@turf/bearing@^5.1.5
Updated@turf/destination@^5.1.5
Updated@turf/distance@^5.1.5
Updated@turf/helpers@^5.1.5