New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@turf/line-offset

Package Overview
Dependencies
Maintainers
4
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/line-offset - npm Package Compare versions

Comparing version 5.0.4 to 5.1.0

main.mjs

8

main.js

@@ -119,3 +119,3 @@ 'use strict';

function intersection(a, b) {
if (isParallel(a, b)) return false;
if (isParallel(a, b)) { return false; }
return intersectSegments(a, b);

@@ -145,8 +145,8 @@ }

options = options || {};
if (!helpers.isObject(options)) throw new Error('options is invalid');
if (!helpers.isObject(options)) { throw new Error('options is invalid'); }
var units = options.units;
// Valdiation
if (!geojson) throw new Error('geojson is required');
if (distance === undefined || distance === null || isNaN(distance)) throw new Error('distance is required');
if (!geojson) { throw new Error('geojson is required'); }
if (distance === undefined || distance === null || isNaN(distance)) { throw new Error('distance is required'); }

@@ -153,0 +153,0 @@ var type = invariant.getType(geojson);

{
"name": "@turf/line-offset",
"version": "5.0.4",
"version": "5.1.0",
"description": "turf line-offset module",
"main": "main",
"module": "index",
"jsnext:main": "index",
"main": "main.js",
"module": "main.mjs",
"types": "index.d.ts",

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

"main.js",
"lib"
"lib",
"main.mjs"
],

@@ -19,3 +19,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"
},

@@ -45,6 +46,7 @@ "repository": {

"@std/esm": "*",
"@turf/truncate": "^5.0.4",
"@turf/truncate": "^5.1.0",
"benchmark": "*",
"load-json-file": "*",
"rollup": "*",
"rollup-plugin-buble": "*",
"tape": "*",

@@ -54,5 +56,5 @@ "write-json-file": "*"

"dependencies": {
"@turf/helpers": "^5.0.4",
"@turf/invariant": "^5.0.4",
"@turf/meta": "^5.0.4"
"@turf/helpers": "^5.1.0",
"@turf/invariant": "^5.1.0",
"@turf/meta": "^5.1.0"
},

@@ -59,0 +61,0 @@ "@std/esm": {

@@ -7,7 +7,7 @@ # @turf/line-offset

Takes a [line](http://geojson.org/geojson-spec.html#linestring) and returns a [line](http://geojson.org/geojson-spec.html#linestring) at offset by the specified distance.
Takes a [line](https://tools.ietf.org/html/rfc7946#section-3.1.4) and returns a [line](https://tools.ietf.org/html/rfc7946#section-3.1.4) at offset by the specified distance.
**Parameters**
- `geojson` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects)<([LineString](http://geojson.org/geojson-spec.html#linestring) \| [MultiLineString](http://geojson.org/geojson-spec.html#multilinestring))>)** input GeoJSON
- `geojson` **([Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<([LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) \| [MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5))>)** input GeoJSON
- `distance` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** distance to offset the line (can be of negative value)

@@ -29,3 +29,3 @@ - `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`)

Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<([LineString](http://geojson.org/geojson-spec.html#linestring) \| [MultiLineString](http://geojson.org/geojson-spec.html#multilinestring))>** Line offset from the input line
Returns **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<([LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) \| [MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5))>** Line offset from the input line

@@ -32,0 +32,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