@turf/boolean-parallel
Advanced tools
Comparing version
@@ -1,5 +0,5 @@ | ||
import cleanCoords from '@turf/clean-coords'; | ||
import lineSegment from '@turf/line-segment'; | ||
import rhumbBearing from '@turf/rhumb-bearing'; | ||
import { bearingToAzimuth } from '@turf/helpers'; | ||
import cleanCoords from "@turf/clean-coords"; | ||
import lineSegment from "@turf/line-segment"; | ||
import rhumbBearing from "@turf/rhumb-bearing"; | ||
import { bearingToAzimuth } from "@turf/helpers"; | ||
/** | ||
@@ -22,11 +22,11 @@ * Boolean-Parallel returns True if each segment of `line1` is parallel to the correspondent segment of `line2` | ||
if (!line1) | ||
throw new Error('line1 is required'); | ||
throw new Error("line1 is required"); | ||
if (!line2) | ||
throw new Error('line2 is required'); | ||
var type1 = getType(line1, 'line1'); | ||
if (type1 !== 'LineString') | ||
throw new Error('line1 must be a LineString'); | ||
var type2 = getType(line2, 'line2'); | ||
if (type2 !== 'LineString') | ||
throw new Error('line2 must be a LineString'); | ||
throw new Error("line2 is required"); | ||
var type1 = getType(line1, "line1"); | ||
if (type1 !== "LineString") | ||
throw new Error("line1 must be a LineString"); | ||
var type2 = getType(line2, "line2"); | ||
if (type2 !== "LineString") | ||
throw new Error("line2 must be a LineString"); | ||
var segments1 = lineSegment(cleanCoords(line1)).features; | ||
@@ -70,4 +70,4 @@ var segments2 = lineSegment(cleanCoords(line2)).features; | ||
return geojson.type; // if GeoJSON geometry | ||
throw new Error('Invalid GeoJSON object for ' + name); | ||
throw new Error("Invalid GeoJSON object for " + name); | ||
} | ||
export default booleanParallel; |
@@ -1,2 +0,2 @@ | ||
import { Feature, LineString } from '@turf/helpers'; | ||
import { Feature, LineString } from "@turf/helpers"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Boolean-Parallel returns True if each segment of `line1` is parallel to the correspondent segment of `line2` |
@@ -27,11 +27,11 @@ "use strict"; | ||
if (!line1) | ||
throw new Error('line1 is required'); | ||
throw new Error("line1 is required"); | ||
if (!line2) | ||
throw new Error('line2 is required'); | ||
var type1 = getType(line1, 'line1'); | ||
if (type1 !== 'LineString') | ||
throw new Error('line1 must be a LineString'); | ||
var type2 = getType(line2, 'line2'); | ||
if (type2 !== 'LineString') | ||
throw new Error('line2 must be a LineString'); | ||
throw new Error("line2 is required"); | ||
var type1 = getType(line1, "line1"); | ||
if (type1 !== "LineString") | ||
throw new Error("line1 must be a LineString"); | ||
var type2 = getType(line2, "line2"); | ||
if (type2 !== "LineString") | ||
throw new Error("line2 must be a LineString"); | ||
var segments1 = line_segment_1.default(clean_coords_1.default(line1)).features; | ||
@@ -75,4 +75,4 @@ var segments2 = line_segment_1.default(clean_coords_1.default(line2)).features; | ||
return geojson.type; // if GeoJSON geometry | ||
throw new Error('Invalid GeoJSON object for ' + name); | ||
throw new Error("Invalid GeoJSON object for " + name); | ||
} | ||
exports.default = booleanParallel; |
{ | ||
"name": "@turf/boolean-parallel", | ||
"version": "6.2.0-alpha.2", | ||
"version": "6.2.0-alpha.3", | ||
"description": "turf boolean-parallel module", | ||
@@ -29,2 +29,6 @@ "author": "Turf Authors", | ||
"module": "dist/es/index.js", | ||
"exports": { | ||
"import": "./dist/es/index.js", | ||
"require": "./dist/js/index.js" | ||
}, | ||
"types": "dist/js/index.d.ts", | ||
@@ -36,10 +40,9 @@ "sideEffects": false, | ||
"scripts": { | ||
"bench": "npm-run-all prepare bench:run", | ||
"bench:run": "node bench.js", | ||
"bench": "ts-node bench.js", | ||
"build": "npm-run-all build:*", | ||
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json", | ||
"build:js": "tsc", | ||
"docs": "node ../../scripts/generate-readmes", | ||
"prepare": "npm-run-all prepare:*", | ||
"prepare:es": "tsc --outDir dist/es --module esnext --declaration false", | ||
"prepare:js": "tsc", | ||
"test": "npm-run-all prepare test:*", | ||
"test:tape": "node -r esm test.js" | ||
"test": "npm-run-all test:*", | ||
"test:tape": "ts-node -r esm test.js" | ||
}, | ||
@@ -52,2 +55,3 @@ "devDependencies": { | ||
"tape": "*", | ||
"ts-node": "*", | ||
"tslint": "*", | ||
@@ -58,8 +62,8 @@ "typescript": "*", | ||
"dependencies": { | ||
"@turf/clean-coords": "^6.2.0-alpha.2", | ||
"@turf/helpers": "^6.2.0-alpha.2", | ||
"@turf/line-segment": "^6.2.0-alpha.2", | ||
"@turf/rhumb-bearing": "^6.2.0-alpha.2" | ||
"@turf/clean-coords": "^6.2.0-alpha.3", | ||
"@turf/helpers": "^6.2.0-alpha.3", | ||
"@turf/line-segment": "^6.2.0-alpha.3", | ||
"@turf/rhumb-bearing": "^6.2.0-alpha.3" | ||
}, | ||
"gitHead": "23d5cb91d77e0c1e2e903a2252f525797f1d0d09" | ||
"gitHead": "dce9edfc705352e8cb9e0083c9330ba0e8d77409" | ||
} |
10501
1.2%7
16.67%9
12.5%