Socket
Socket
Sign inDemoInstall

@turf/line-slice-along

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/line-slice-along - npm Package Compare versions

Comparing version 5.0.4 to 5.1.0

main.mjs

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.0.4",
"version": "5.1.0",
"description": "turf line-slice-along module",
"main": "main",
"module": "index",
"jsnext:main": "index",
"main": "main.js",
"module": "main.mjs",
"types": "index.d.ts",

@@ -12,3 +11,4 @@ "files": [

"index.d.ts",
"main.js"
"main.js",
"main.mjs"
],

@@ -18,3 +18,4 @@ "scripts": {

"test": "node -r @std/esm test.js",
"bench": "node -r @std/esm bench.js"
"bench": "node -r @std/esm bench.js",
"docs": "node ../../scripts/generate-readmes"
},

@@ -38,13 +39,14 @@ "repository": {

"@std/esm": "*",
"@turf/along": "^5.0.4",
"@turf/along": "^5.1.0",
"benchmark": "*",
"load-json-file": "*",
"rollup": "*",
"rollup-plugin-buble": "*",
"tape": "*"
},
"dependencies": {
"@turf/bearing": "^5.0.4",
"@turf/destination": "^5.0.4",
"@turf/distance": "^5.0.4",
"@turf/helpers": "^5.0.4"
"@turf/bearing": "^5.1.0",
"@turf/destination": "^5.1.0",
"@turf/distance": "^5.1.0",
"@turf/helpers": "^5.1.0"
},

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

@@ -7,3 +7,3 @@ # @turf/line-slice-along

Takes a [line](http://geojson.org/geojson-spec.html#linestring), a specified distance along the line to a start [Point](http://geojson.org/geojson-spec.html#point),
Takes a [line](https://tools.ietf.org/html/rfc7946#section-3.1.4), a specified distance along the line to a start [Point](https://tools.ietf.org/html/rfc7946#section-3.1.2),
and a specified distance along the line to a stop point

@@ -16,3 +16,3 @@ and returns a subsection of the line in-between those points.

- `line` **([Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;[LineString](http://geojson.org/geojson-spec.html#linestring)> | [LineString](http://geojson.org/geojson-spec.html#linestring))** input line
- `line` **([Feature](https://tools.ietf.org/html/rfc7946#section-3.2)&lt;[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4)> | [LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4))** input line
- `startDist` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** distance along the line to starting point

@@ -35,3 +35,3 @@ - `stopDist` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** distance along the line to ending point

Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;[LineString](http://geojson.org/geojson-spec.html#linestring)>** sliced line
Returns **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)&lt;[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4)>** sliced line

@@ -38,0 +38,0 @@ <!-- This file is automatically generated. Please don't edit it directly:

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