@turf/helpers 7.0.0-alpha.0 → 7.0.0-alpha.2

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/dist/es/index.js CHANGED
@@ -52,6 +52,7 @@ export const areaFactors = {
52
52
  meters: 1,
53
53
  metres: 1,
54
54
  miles: 3.86e-7,
55
+ nauticalmiles: 2.9155334959812285e-7,
55
56
  millimeters: 1000000,
56
57
  millimetres: 1000000,
57
58
  yards: 1.195990046,
@@ -2,7 +2,8 @@ import { BBox, Feature, FeatureCollection, Geometry, GeometryCollection, Geometr
2
2
  import { Id } from "./lib/geojson";
3
3
  export * from "./lib/geojson";
4
4
  export declare type Coord = Feature<Point> | Point | Position;
5
- export declare type Units = "meters" | "metres" | "millimeters" | "millimetres" | "centimeters" | "centimetres" | "kilometers" | "kilometres" | "acres" | "miles" | "nauticalmiles" | "inches" | "yards" | "feet" | "radians" | "degrees" | "hectares";
5
+ export declare type Units = "meters" | "metres" | "millimeters" | "millimetres" | "centimeters" | "centimetres" | "kilometers" | "kilometres" | "miles" | "nauticalmiles" | "inches" | "yards" | "feet" | "radians" | "degrees";
6
+ export declare type AreaUnits = Exclude<Units, "radians" | "degrees"> | "acres" | "hectares";
6
7
  export declare type Grid = "point" | "square" | "hex" | "triangle";
7
8
  export declare type Corners = "sw" | "se" | "nw" | "ne" | "center" | "centroid";
8
9
  export declare type Lines = LineString | MultiLineString | Polygon | MultiPolygon;
@@ -25,9 +26,7 @@ export declare const earthRadius = 6371008.8;
25
26
  * @memberof helpers
26
27
  * @type {Object}
27
28
  */
28
- export declare const factors: {
29
- [key: string]: number;
30
- };
29
+ export declare const factors: Record<Units, number>;
31
30
  /**
32
31
 
33
32
  * Area of measurement factors based on 1 square meter.
@@ -35,9 +34,7 @@ export declare const factors: {
35
34
  * @memberof helpers
36
35
  * @type {Object}
37
36
  */
38
- export declare const areaFactors: {
39
- [key: string]: number;
40
- };
37
+ export declare const areaFactors: Record<AreaUnits, number>;
41
38
  /**
42
39
  * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.
43
40
  *
@@ -408,7 +405,7 @@ export declare function convertLength(length: number, originalUnit?: Units, fina
408
405
  * @param {Units} [finalUnit="kilometers"] returned unit
409
406
  * @returns {number} the converted area
410
407
  */
411
- export declare function convertArea(area: number, originalUnit?: Units, finalUnit?: Units): number;
408
+ export declare function convertArea(area: number, originalUnit?: AreaUnits, finalUnit?: AreaUnits): number;
412
409
  /**
413
410
  * isNumber
414
411
  *
package/dist/js/index.js CHANGED
@@ -54,6 +54,7 @@ exports.areaFactors = {
54
54
  meters: 1,
55
55
  metres: 1,
56
56
  miles: 3.86e-7,
57
+ nauticalmiles: 2.9155334959812285e-7,
57
58
  millimeters: 1000000,
58
59
  millimetres: 1000000,
59
60
  yards: 1.195990046,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/helpers",
3
- "version": "7.0.0-alpha.0",
3
+ "version": "7.0.0-alpha.2",
4
4
  "description": "turf helpers module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -33,6 +33,7 @@
33
33
  "exports": {
34
34
  "./package.json": "./package.json",
35
35
  ".": {
36
+ "types": "./dist/js/index.d.ts",
36
37
  "import": "./dist/es/index.js",
37
38
  "require": "./dist/js/index.js"
38
39
  }
@@ -43,13 +44,13 @@
43
44
  "dist"
44
45
  ],
45
46
  "scripts": {
46
- "bench": "ts-node bench.js",
47
+ "bench": "tsx bench.js",
47
48
  "build": "npm-run-all build:*",
48
49
  "build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
49
50
  "build:js": "tsc",
50
- "docs": "node ../../scripts/generate-readmes",
51
+ "docs": "tsx ../../scripts/generate-readmes",
51
52
  "test": "npm-run-all test:*",
52
- "test:tape": "ts-node -r esm test.js",
53
+ "test:tape": "tsx test.js",
53
54
  "test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
54
55
  },
55
56
  "devDependencies": {
@@ -57,12 +58,12 @@
57
58
  "benchmark": "*",
58
59
  "npm-run-all": "*",
59
60
  "tape": "*",
60
- "ts-node": "*",
61
61
  "tslint": "*",
62
+ "tsx": "*",
62
63
  "typescript": "*"
63
64
  },
64
65
  "dependencies": {
65
66
  "tslib": "^2.3.0"
66
67
  },
67
- "gitHead": "0edc4c491b999e5ace770a61e1cf549f7c004189"
68
+ "gitHead": "dd35b52725945b4fa29a98d9a550733e06cc222e"
68
69
  }