@turf/boolean-intersects 7.0.0-alpha.2 → 7.1.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,7 +14,7 @@ Boolean-intersects returns (TRUE) two geometries intersect.
14
14
  ### Examples
15
15
 
16
16
  ```javascript
17
- var point = turf.point([1, 2]);
17
+ var point = turf.point([2, 2]);
18
18
  var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
19
19
 
20
20
  turf.booleanIntersects(line, point);
@@ -29,26 +29,21 @@ Returns **[boolean][3]** true/false
29
29
 
30
30
  [3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
31
31
 
32
- <!-- This file is automatically generated. Please don't edit it directly:
33
- if you find an error, edit the source file (likely index.js), and re-run
34
- ./scripts/generate-readmes in the turf project. -->
32
+ <!-- This file is automatically generated. Please don't edit it directly. If you find an error, edit the source file of the module in question (likely index.js or index.ts), and re-run "yarn docs" from the root of the turf project. -->
35
33
 
36
34
  ---
37
35
 
38
- This module is part of the [Turfjs project](http://turfjs.org/), an open source
39
- module collection dedicated to geographic algorithms. It is maintained in the
40
- [Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
41
- PRs and issues.
36
+ This module is part of the [Turfjs project](https://turfjs.org/), an open source module collection dedicated to geographic algorithms. It is maintained in the [Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create PRs and issues.
42
37
 
43
38
  ### Installation
44
39
 
45
- Install this module individually:
40
+ Install this single module individually:
46
41
 
47
42
  ```sh
48
43
  $ npm install @turf/boolean-intersects
49
44
  ```
50
45
 
51
- Or install the Turf module that includes it as a function:
46
+ Or install the all-encompassing @turf/turf module that includes all modules as functions:
52
47
 
53
48
  ```sh
54
49
  $ npm install @turf/turf
@@ -0,0 +1,21 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// index.ts
2
+ var _booleandisjoint = require('@turf/boolean-disjoint');
3
+ var _meta = require('@turf/meta');
4
+ function booleanIntersects(feature1, feature2) {
5
+ let bool = false;
6
+ _meta.flattenEach.call(void 0, feature1, (flatten1) => {
7
+ _meta.flattenEach.call(void 0, feature2, (flatten2) => {
8
+ if (bool === true) {
9
+ return true;
10
+ }
11
+ bool = !_booleandisjoint.booleanDisjoint.call(void 0, flatten1.geometry, flatten2.geometry);
12
+ });
13
+ });
14
+ return bool;
15
+ }
16
+ var turf_boolean_intersects_default = booleanIntersects;
17
+
18
+
19
+
20
+ exports.booleanIntersects = booleanIntersects; exports.default = turf_boolean_intersects_default;
21
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.ts"],"names":[],"mappings":";AACA,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAgB5B,SAAS,kBACP,UACA,UACA;AACA,MAAI,OAAO;AACX,cAAY,UAAU,CAAC,aAAa;AAClC,gBAAY,UAAU,CAAC,aAAa;AAClC,UAAI,SAAS,MAAM;AACjB,eAAO;AAAA,MACT;AACA,aAAO,CAAC,gBAAgB,SAAS,UAAU,SAAS,QAAQ;AAAA,IAC9D,CAAC;AAAA,EACH,CAAC;AACD,SAAO;AACT;AAGA,IAAO,kCAAQ","sourcesContent":["import { Feature, Geometry } from \"geojson\";\nimport { booleanDisjoint } from \"@turf/boolean-disjoint\";\nimport { flattenEach } from \"@turf/meta\";\n\n/**\n * Boolean-intersects returns (TRUE) two geometries intersect.\n *\n * @name booleanIntersects\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var point = turf.point([2, 2]);\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n *\n * turf.booleanIntersects(line, point);\n * //=true\n */\nfunction booleanIntersects(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry\n) {\n let bool = false;\n flattenEach(feature1, (flatten1) => {\n flattenEach(feature2, (flatten2) => {\n if (bool === true) {\n return true;\n }\n bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry);\n });\n });\n return bool;\n}\n\nexport { booleanIntersects };\nexport default booleanIntersects;\n"]}
@@ -0,0 +1,19 @@
1
+ import { Feature, Geometry } from 'geojson';
2
+
3
+ /**
4
+ * Boolean-intersects returns (TRUE) two geometries intersect.
5
+ *
6
+ * @name booleanIntersects
7
+ * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
8
+ * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
9
+ * @returns {boolean} true/false
10
+ * @example
11
+ * var point = turf.point([2, 2]);
12
+ * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
13
+ *
14
+ * turf.booleanIntersects(line, point);
15
+ * //=true
16
+ */
17
+ declare function booleanIntersects(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry): boolean;
18
+
19
+ export { booleanIntersects, booleanIntersects as default };
@@ -1,4 +1,5 @@
1
- import { Feature, Geometry } from "geojson";
1
+ import { Feature, Geometry } from 'geojson';
2
+
2
3
  /**
3
4
  * Boolean-intersects returns (TRUE) two geometries intersect.
4
5
  *
@@ -13,4 +14,6 @@ import { Feature, Geometry } from "geojson";
13
14
  * turf.booleanIntersects(line, point);
14
15
  * //=true
15
16
  */
16
- export default function booleanIntersects(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry): boolean;
17
+ declare function booleanIntersects(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry): boolean;
18
+
19
+ export { booleanIntersects, booleanIntersects as default };
@@ -0,0 +1,21 @@
1
+ // index.ts
2
+ import { booleanDisjoint } from "@turf/boolean-disjoint";
3
+ import { flattenEach } from "@turf/meta";
4
+ function booleanIntersects(feature1, feature2) {
5
+ let bool = false;
6
+ flattenEach(feature1, (flatten1) => {
7
+ flattenEach(feature2, (flatten2) => {
8
+ if (bool === true) {
9
+ return true;
10
+ }
11
+ bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry);
12
+ });
13
+ });
14
+ return bool;
15
+ }
16
+ var turf_boolean_intersects_default = booleanIntersects;
17
+ export {
18
+ booleanIntersects,
19
+ turf_boolean_intersects_default as default
20
+ };
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, Geometry } from \"geojson\";\nimport { booleanDisjoint } from \"@turf/boolean-disjoint\";\nimport { flattenEach } from \"@turf/meta\";\n\n/**\n * Boolean-intersects returns (TRUE) two geometries intersect.\n *\n * @name booleanIntersects\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var point = turf.point([2, 2]);\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n *\n * turf.booleanIntersects(line, point);\n * //=true\n */\nfunction booleanIntersects(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry\n) {\n let bool = false;\n flattenEach(feature1, (flatten1) => {\n flattenEach(feature2, (flatten2) => {\n if (bool === true) {\n return true;\n }\n bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry);\n });\n });\n return bool;\n}\n\nexport { booleanIntersects };\nexport default booleanIntersects;\n"],"mappings":";AACA,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAgB5B,SAAS,kBACP,UACA,UACA;AACA,MAAI,OAAO;AACX,cAAY,UAAU,CAAC,aAAa;AAClC,gBAAY,UAAU,CAAC,aAAa;AAClC,UAAI,SAAS,MAAM;AACjB,eAAO;AAAA,MACT;AACA,aAAO,CAAC,gBAAgB,SAAS,UAAU,SAAS,QAAQ;AAAA,IAC9D,CAAC;AAAA,EACH,CAAC;AACD,SAAO;AACT;AAGA,IAAO,kCAAQ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/boolean-intersects",
3
- "version": "7.0.0-alpha.2",
3
+ "version": "7.1.0-alpha.7+0ce6ecca0",
4
4
  "description": "turf boolean-intersects module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -26,46 +26,51 @@
26
26
  "boolean",
27
27
  "de-9im"
28
28
  ],
29
- "main": "dist/js/index.js",
30
- "module": "dist/es/index.js",
29
+ "type": "module",
30
+ "main": "dist/cjs/index.cjs",
31
+ "module": "dist/esm/index.js",
32
+ "types": "dist/esm/index.d.ts",
31
33
  "exports": {
32
34
  "./package.json": "./package.json",
33
35
  ".": {
34
- "types": "./dist/js/index.d.ts",
35
- "import": "./dist/es/index.js",
36
- "require": "./dist/js/index.js"
36
+ "import": {
37
+ "types": "./dist/esm/index.d.ts",
38
+ "default": "./dist/esm/index.js"
39
+ },
40
+ "require": {
41
+ "types": "./dist/cjs/index.d.cts",
42
+ "default": "./dist/cjs/index.cjs"
43
+ }
37
44
  }
38
45
  },
39
- "types": "dist/js/index.d.ts",
40
46
  "sideEffects": false,
41
47
  "files": [
42
48
  "dist"
43
49
  ],
44
50
  "scripts": {
45
- "bench": "tsx bench.js",
46
- "build": "npm-run-all build:*",
47
- "build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
48
- "build:js": "tsc",
49
- "docs": "tsx ../../scripts/generate-readmes",
50
- "test": "npm-run-all test:*",
51
- "test:tape": "tsx test.js"
51
+ "bench": "tsx bench.ts",
52
+ "build": "tsup --config ../../tsup.config.ts",
53
+ "docs": "tsx ../../scripts/generate-readmes.ts",
54
+ "test": "npm-run-all --npm-path npm test:*",
55
+ "test:tape": "tsx test.ts"
52
56
  },
53
57
  "devDependencies": {
54
- "@types/tape": "*",
55
- "benchmark": "*",
58
+ "@types/benchmark": "^2.1.5",
59
+ "@types/tape": "^4.2.32",
60
+ "benchmark": "^2.1.4",
56
61
  "boolean-shapely": "*",
57
- "load-json-file": "*",
58
- "npm-run-all": "*",
59
- "tape": "*",
60
- "tslint": "*",
61
- "tsx": "*",
62
- "typescript": "*"
62
+ "load-json-file": "^7.0.1",
63
+ "npm-run-all": "^4.1.5",
64
+ "tape": "^5.7.2",
65
+ "tsup": "^8.0.1",
66
+ "tsx": "^4.6.2",
67
+ "typescript": "^5.2.2"
63
68
  },
64
69
  "dependencies": {
65
- "@turf/boolean-disjoint": "^7.0.0-alpha.2",
66
- "@turf/helpers": "^7.0.0-alpha.2",
67
- "@turf/meta": "^7.0.0-alpha.2",
68
- "tslib": "^2.3.0"
70
+ "@turf/boolean-disjoint": "^7.1.0-alpha.7+0ce6ecca0",
71
+ "@turf/helpers": "^7.1.0-alpha.7+0ce6ecca0",
72
+ "@turf/meta": "^7.1.0-alpha.7+0ce6ecca0",
73
+ "tslib": "^2.6.2"
69
74
  },
70
- "gitHead": "dd35b52725945b4fa29a98d9a550733e06cc222e"
75
+ "gitHead": "0ce6ecca05829690270fec6d6bed2003495fe0ea"
71
76
  }
package/dist/es/index.js DELETED
@@ -1,28 +0,0 @@
1
- import booleanDisjoint from "@turf/boolean-disjoint";
2
- import { flattenEach } from "@turf/meta";
3
- /**
4
- * Boolean-intersects returns (TRUE) two geometries intersect.
5
- *
6
- * @name booleanIntersects
7
- * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
8
- * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
9
- * @returns {boolean} true/false
10
- * @example
11
- * var point = turf.point([2, 2]);
12
- * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
13
- *
14
- * turf.booleanIntersects(line, point);
15
- * //=true
16
- */
17
- export default function booleanIntersects(feature1, feature2) {
18
- let bool = false;
19
- flattenEach(feature1, (flatten1) => {
20
- flattenEach(feature2, (flatten2) => {
21
- if (bool === true) {
22
- return true;
23
- }
24
- bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry);
25
- });
26
- });
27
- return bool;
28
- }
@@ -1 +0,0 @@
1
- {"type":"module"}
package/dist/js/index.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const boolean_disjoint_1 = tslib_1.__importDefault(require("@turf/boolean-disjoint"));
5
- const meta_1 = require("@turf/meta");
6
- /**
7
- * Boolean-intersects returns (TRUE) two geometries intersect.
8
- *
9
- * @name booleanIntersects
10
- * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
11
- * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
12
- * @returns {boolean} true/false
13
- * @example
14
- * var point = turf.point([2, 2]);
15
- * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
16
- *
17
- * turf.booleanIntersects(line, point);
18
- * //=true
19
- */
20
- function booleanIntersects(feature1, feature2) {
21
- let bool = false;
22
- meta_1.flattenEach(feature1, (flatten1) => {
23
- meta_1.flattenEach(feature2, (flatten2) => {
24
- if (bool === true) {
25
- return true;
26
- }
27
- bool = !boolean_disjoint_1.default(flatten1.geometry, flatten2.geometry);
28
- });
29
- });
30
- return bool;
31
- }
32
- exports.default = booleanIntersects;