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

@turf/along

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/along - npm Package Compare versions

Comparing version 5.1.0 to 5.1.5

main.es.js

14

main.js

@@ -31,17 +31,17 @@ 'use strict';

options = options || {};
if (!helpers.isObject(options)) { throw new Error('options is invalid'); }
if (!helpers.isObject(options)) throw new Error('options is invalid');
// Validation
var coords;
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 (!helpers.isNumber(distance)) { throw new Error('distance must be a number'); }
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 (!helpers.isNumber(distance)) throw new Error('distance must be a number');
var travelled = 0;
for (var i = 0; i < coords.length; i++) {
if (distance >= travelled && i === coords.length - 1) { break; }
if (distance >= travelled && i === coords.length - 1) break;
else if (travelled >= distance) {
var overshot = distance - travelled;
if (!overshot) { return helpers.point(coords[i]); }
if (!overshot) return helpers.point(coords[i]);
else {

@@ -48,0 +48,0 @@ var direction = bearing(coords[i], coords[i - 1]) - 180;

{
"name": "@turf/along",
"version": "5.1.0",
"version": "5.1.5",
"description": "turf 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",

@@ -44,10 +45,9 @@ "docs": "node ../../scripts/generate-readmes"

"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"
},

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

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