From b6897c91e8d59583d391b513212130bcb636533b Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sun, 24 Nov 2024 11:31:57 -0500 Subject: [PATCH] feat: Look for opencpn extensions to GPX (#129) * Look for opencpn extensions to GPX - Refs #128 * Try handling all extensions * Trim contents, add gpxx by default * Biome format lib * Make formatting similar to main branch * Move biome to devDependencies * v6.0.0-0 --- biome.json | 31 ++++ lib/__snapshots__/index.test.ts.snap | 224 +++++++++++++++++++++++++-- lib/gpx.ts | 36 +++-- lib/gpx/properties.ts | 16 +- lib/index.test.ts | 5 +- lib/kml/placemark.ts | 10 +- lib/shared.ts | 2 + package.json | 3 +- test/data/opencpn.gpx | 224 +++++++++++++++++++++++++++ tsconfig.json | 20 +-- yarn.lock | 54 +++++++ 11 files changed, 574 insertions(+), 51 deletions(-) create mode 100644 biome.json create mode 100644 test/data/opencpn.gpx diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..9c8c13e --- /dev/null +++ b/biome.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { + "enabled": false, + "clientKind": "git", + "useIgnoreFile": false + }, + "files": { + "ignoreUnknown": false, + "ignore": [] + }, + "formatter": { + "enabled": true, + "indentStyle": "space" + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double", + "trailingCommas": "es5" + } + } +} diff --git a/lib/__snapshots__/index.test.ts.snap b/lib/__snapshots__/index.test.ts.snap index 216b9ef..0a6cddf 100644 --- a/lib/__snapshots__/index.test.ts.snap +++ b/lib/__snapshots__/index.test.ts.snap @@ -3175,6 +3175,7 @@ exports[`toGeoJSON > blue_hills.gpx 1`] = ` "desc": "Big loop around the base of Great Blue Hill", "name": "BIG LOOP", "time": "2001-06-24T15:09:09Z", + "topografix_color": "00ffff", }, "type": "Feature", }, @@ -6190,6 +6191,7 @@ exports[`toGeoJSON > blue_hills.gpx 1`] = ` "desc": "The usual ride around Buck Hill", "name": "BUCK HILL", "time": "2001-10-13T17:55:59Z", + "topografix_color": "2068ff", }, "type": "Feature", }, @@ -8837,6 +8839,7 @@ exports[`toGeoJSON > blue_hills.gpx 1`] = ` "desc": "Short Loop skipping the loop around Buck Hill", "name": "SHORT LOOP", "time": "2001-05-26T15:15:07Z", + "topografix_color": "009300", }, "type": "Feature", }, @@ -12777,9 +12780,8 @@ exports[`toGeoJSON > garmin_extensions.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, - "gpxx_TrackExtension": " - Magenta - ", + "gpxx_DisplayColor": "Magenta", + "gpxx_TrackExtension": "Magenta", "name": "track name", }, "type": "Feature", @@ -18234,6 +18236,8 @@ exports[`toGeoJSON > missing_hr.gpx 1`] = ` ], ], }, + "gpxtpx_TrackPointExtension": "131", + "gpxtpx_hr": "131", "name": "missing hr", "time": "2017-05-27T04:00:00Z", }, @@ -20587,9 +20591,8 @@ exports[`toGeoJSON > multitrackgpx.gpx 1`] = ` "2008-07-12T10:05:33Z", ], }, - "gpxx_TrackExtension": " - Transparent - ", + "gpxx_DisplayColor": "Transparent", + "gpxx_TrackExtension": "Transparent", "name": "Tag 1", "time": "2008-07-12T09:58:23Z", }, @@ -20997,9 +21000,8 @@ exports[`toGeoJSON > multitrackgpx.gpx 1`] = ` "2008-07-13T08:13:33Z", ], }, - "gpxx_TrackExtension": " - Transparent - ", + "gpxx_DisplayColor": "Transparent", + "gpxx_TrackExtension": "Transparent", "name": "Tag 2", "time": "2008-07-13T07:57:31Z", }, @@ -21101,9 +21103,8 @@ exports[`toGeoJSON > multitrackgpx.gpx 1`] = ` "2008-07-14T07:09:43Z", ], }, - "gpxx_TrackExtension": " - Transparent - ", + "gpxx_DisplayColor": "Transparent", + "gpxx_TrackExtension": "Transparent", "name": "Tag 3", "time": "2008-07-14T07:08:19Z", }, @@ -21946,6 +21947,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "BEN", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Bimbereke - Kandi", + "ogr_NOM_PROJET": "North Core Project, Benin - Niger", + "ogr_PUISSANCE": "161", + "ogr_SOURCE01": "This Fixture demonstrates issue 102, a crash that can occur if trkseg and trkpoint don't match exactly", + "ogr_SOURCE02": "WB map archive IBRD #33246, #33245; June 2004", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "2004.0", "type": "NC", }, "type": "Feature", @@ -21967,6 +21977,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "BEN", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Bembereke - Zabori", + "ogr_NOM_PROJET": "North Core Project, Benin - Niger", + "ogr_PUISSANCE": "330", + "ogr_SOURCE01": "African Infrastructure Country Diagnostics", + "ogr_SOURCE02": "WAPP North Core Project, Benin - Niger", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "-99.0", "type": "NC", }, "type": "Feature", @@ -22010,6 +22029,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "BFA", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Birnin Kebbi - Ouagadougou", + "ogr_NOM_PROJET": "North Core Project, Niger - Burkina Faso", + "ogr_PUISSANCE": "330", + "ogr_SOURCE01": "African Infrastructure Country Diagnostics", + "ogr_SOURCE02": "WAPP North Core Project, Niger - Burkina Faso", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "-99.0", "type": "NC", }, "type": "Feature", @@ -22035,6 +22063,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "NGA", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Dosso - Birnin Kebbi", + "ogr_NOM_PROJET": "North Core Project, Nigeria - Niger", + "ogr_PUISSANCE": "330", + "ogr_SOURCE01": "African Infrastructure Country Diagnostics", + "ogr_SOURCE02": "WAPP North Core Project, Nigeria - Niger", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "-99.0", "type": "NC", }, "type": "Feature", @@ -22056,6 +22093,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "NGA", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Dosso - Birnin Kebbi", + "ogr_NOM_PROJET": "North Core Project, Nigeria - Niger", + "ogr_PUISSANCE": "330", + "ogr_SOURCE01": "African Infrastructure Country Diagnostics", + "ogr_SOURCE02": "WAPP North Core Project, Nigeria - Niger", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "-99.0", "type": "NC", }, "type": "Feature", @@ -22093,6 +22139,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "NER", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Dosso - Birnin Kebbi", + "ogr_NOM_PROJET": "North Core Project, Nigeria - Niger", + "ogr_PUISSANCE": "330", + "ogr_SOURCE01": "African Infrastructure Country Diagnostics", + "ogr_SOURCE02": "WAPP North Core Project, Nigeria - Niger", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "-99.0", "type": "NC", }, "type": "Feature", @@ -22122,6 +22177,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "NER", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Dosso - Niamey", + "ogr_NOM_PROJET": "North Core Project, Nigeria - Niger", + "ogr_PUISSANCE": "330", + "ogr_SOURCE01": "African Infrastructure Country Diagnostics", + "ogr_SOURCE02": "WAPP North Core Project, Nigeria - Niger", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "-99.0", "type": "NC", }, "type": "Feature", @@ -22155,6 +22219,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "NER", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Birnin Kebbi - Ouagadougou", + "ogr_NOM_PROJET": "North Core Project, Niger - Burkina Faso", + "ogr_PUISSANCE": "330", + "ogr_SOURCE01": "African Infrastructure Country Diagnostics", + "ogr_SOURCE02": "WAPP North Core Project, Niger - Burkina Faso", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "-99.0", "type": "NC", }, "type": "Feature", @@ -22180,6 +22253,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "NER", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Bembereke - Zabori", + "ogr_NOM_PROJET": "North Core Project, Benin - Niger", + "ogr_PUISSANCE": "330", + "ogr_SOURCE01": "African Infrastructure Country Diagnostics", + "ogr_SOURCE02": "WAPP North Core Project, Nigeria - Niger", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "-99.0", "type": "NC", }, "type": "Feature", @@ -22201,6 +22283,15 @@ exports[`toGeoJSON > north_core.gpx 1`] = ` "properties": { "_gpxType": "trk", "coordinateProperties": {}, + "ogr_CODE_PAYS": "NER", + "ogr_DATE": "2014/04/01", + "ogr_NOM_LIGNE": "Dosso - Birnin Kebbi", + "ogr_NOM_PROJET": "North Core Project, Nigeria - Niger", + "ogr_PUISSANCE": "330", + "ogr_SOURCE01": "African Infrastructure Country Diagnostics", + "ogr_SOURCE02": "WAPP North Core Project, Nigeria - Niger", + "ogr_STATUT": "Ligne planifie", + "ogr_VALIDITE": "-99.0", "type": "NC", }, "type": "Feature", @@ -22357,6 +22448,103 @@ exports[`toGeoJSON > opacity_override.kml 3`] = ` } `; +exports[`toGeoJSON > opencpn.gpx 1`] = ` +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + -122.794704192, + 48.701544636, + ], + [ + -122.730903268, + 48.660069943, + ], + [ + -122.753942491, + 48.619862833, + ], + [ + -122.791159696, + 48.594603156, + ], + [ + -122.814789668, + 48.588742147, + ], + [ + -122.878196759, + 48.585746258, + ], + [ + -122.956963332, + 48.593431009, + ], + [ + -122.982365552, + 48.594082205, + ], + [ + -123.020567339, + 48.586658069, + ], + [ + -123.039668233, + 48.588351389, + ], + [ + -123.035729905, + 48.612182103, + ], + [ + -123.036714487, + 48.633008489, + ], + [ + -122.943179182, + 48.733634813, + ], + [ + -122.891587077, + 48.731686601, + ], + [ + -122.806125345, + 48.70739255, + ], + [ + -122.806125345, + 48.70739255, + ], + ], + "type": "LineString", + }, + "properties": { + "_gpxType": "rte", + "gpxx_IsAutoNamed": "false", + "gpxx_RouteExtension": "false", + "name": "Around Orcas", + "opencpn_arrival_radius": "0.050", + "opencpn_auto_name": "1", + "opencpn_guid": "08a80000-d9a5-4f58-9aaa-3eda20ad0000", + "opencpn_planned_departure": "2022-01-01T23:27:53Z", + "opencpn_planned_speed": "6.00", + "opencpn_scale_min_max": "", + "opencpn_time_display": "PC", + "opencpn_viz": "1", + "opencpn_waypoint_range_rings": "", + "time": "2022-01-01T15:26:17Z", + "type": "WPT", + }, + "type": "Feature", + }, + ], + "type": "FeatureCollection", +} +`; + exports[`toGeoJSON > osm.gpx 1`] = ` { "features": [ @@ -26162,6 +26350,8 @@ exports[`toGeoJSON > run.gpx 1`] = ` "2012-10-24T23:45:28.000Z", ], }, + "gpxtpx_TrackPointExtension": "186", + "gpxtpx_hr": "186", "name": "Untitled", "time": "2012-10-24T23:29:40.000Z", }, @@ -26483,6 +26673,8 @@ exports[`toGeoJSON > run_gpxtpx.gpx 1`] = ` "2015-01-19T21:25:01Z", ], }, + "gpxtpx_TrackPointExtension": "150", + "gpxtpx_hr": "150", "name": "Greeting SF with a dumb, dumb route", "time": "2015-01-19T21:24:20Z", }, @@ -27077,6 +27269,13 @@ exports[`toGeoJSON > strava.gpx 1`] = ` ], }, "desc": "Strava sample file based on: https://github.com/sports-alliance/sports-lib/blob/develop/samples/gpx/strava.gpx", + "gpxtpx_TrackPointExtension": "9 + 160 + 85 + 21", + "gpxtpx_atemp": "21", + "gpxtpx_cad": "85", + "gpxtpx_hr": "160", "name": "120' moderate and hard", "time": "2018-05-14T14:54:21Z", }, @@ -34667,6 +34866,7 @@ exports[`toGeoJSON > zero_elevation.gpx 1`] = ` "desc": "Big loop around the base of Great Blue Hill", "name": "BIG LOOP", "time": "2001-06-24T15:09:09Z", + "topografix_color": "00ffff", }, "type": "Feature", }, diff --git a/lib/gpx.ts b/lib/gpx.ts index 83badea..0676abf 100644 --- a/lib/gpx.ts +++ b/lib/gpx.ts @@ -9,7 +9,7 @@ import type { import { getLineStyle } from "./gpx/line"; import { coordPair } from "./gpx/coord_pair"; import { extractProperties } from "./gpx/properties"; -import { P, $, get1, getMulti } from "./shared"; +import { P, $, get1, getMulti, type NS } from "./shared"; /** * Extract points from a trkseg or rte element. @@ -50,14 +50,14 @@ function getPoints(node: Element, pointname: "trkpt" | "rtept") { * Extract a LineString geometry from a rte * element. */ -function getRoute(node: Element): Feature | undefined { +function getRoute(ns: NS, node: Element): Feature | undefined { const line = getPoints(node, "rtept"); if (!line) return; return { type: "Feature", properties: Object.assign( { _gpxType: "rte" }, - extractProperties(node), + extractProperties(ns, node), getLineStyle(get1(node, "extensions")) ), geometry: { @@ -67,7 +67,10 @@ function getRoute(node: Element): Feature | undefined { }; } -function getTrack(node: Element): Feature | null { +function getTrack( + ns: NS, + node: Element +): Feature | null { const segments = $(node, "trkseg"); const track = []; const times = []; @@ -87,7 +90,7 @@ function getTrack(node: Element): Feature | null { const properties: Feature["properties"] = Object.assign( { _gpxType: "trk" }, - extractProperties(node), + extractProperties(ns, node), getLineStyle(get1(node, "extensions")), times.length ? { @@ -139,9 +142,9 @@ function getTrack(node: Element): Feature | null { * Extract a point, if possible, from a given node, * which is usually a wpt or trkpt */ -function getPoint(node: Element): Feature | null { +function getPoint(ns: NS, node: Element): Feature | null { const properties: Feature["properties"] = Object.assign( - extractProperties(node), + extractProperties(ns, node), getMulti(node, ["sym"]) ); const pair = coordPair(node); @@ -162,18 +165,31 @@ function getPoint(node: Element): Feature | null { * that yields output feature by feature. */ export function* gpxGen(node: Document): Generator { + const GPXX = "gpxx"; + const GPXX_URI = "http://www.garmin.com/xmlschemas/GpxExtensions/v3"; + // Namespaces + const ns: NS = [[GPXX, GPXX_URI]]; + const attrs = node.getElementsByTagName("gpx")[0]?.attributes; + if (attrs) { + for (const attr of Array.from(attrs)) { + if (attr.name?.startsWith("xmlns:") && attr.value !== GPXX_URI) { + ns.push([attr.name, attr.value]); + } + } + } + for (const track of $(node, "trk")) { - const feature = getTrack(track); + const feature = getTrack(ns, track); if (feature) yield feature; } for (const route of $(node, "rte")) { - const feature = getRoute(route); + const feature = getRoute(ns, route); if (feature) yield feature; } for (const waypoint of $(node, "wpt")) { - const point = getPoint(waypoint); + const point = getPoint(ns, waypoint); if (point) yield point; } } diff --git a/lib/gpx/properties.ts b/lib/gpx/properties.ts index e2bb156..b4165c0 100644 --- a/lib/gpx/properties.ts +++ b/lib/gpx/properties.ts @@ -1,6 +1,6 @@ -import { $, getMulti, nodeVal } from "../shared"; +import { $, getMulti, nodeVal, type NS } from "../shared"; -export function extractProperties(node: Element) { +export function extractProperties(ns: NS, node: Element) { const properties = getMulti(node, [ "name", "cmt", @@ -10,15 +10,9 @@ export function extractProperties(node: Element) { "keywords", ]); - const extensions = Array.from( - node.getElementsByTagNameNS( - "http://www.garmin.com/xmlschemas/GpxExtensions/v3", - "*" - ) - ); - for (const child of extensions) { - if (child.parentNode?.parentNode === node) { - properties[child.tagName.replace(":", "_")] = nodeVal(child); + for (const [n, url] of ns) { + for (const child of Array.from(node.getElementsByTagNameNS(url, "*"))) { + properties[child.tagName.replace(":", "_")] = nodeVal(child)?.trim(); } } diff --git a/lib/index.test.ts b/lib/index.test.ts index b0f711a..aa3a2f2 100644 --- a/lib/index.test.ts +++ b/lib/index.test.ts @@ -51,8 +51,9 @@ describe("mini cases", () => { ).toHaveLength(1); }); it("folder nesting", () => { - expect(tj.kmlWithFolders(parse(path.join(d, "inline_style_mini.kml")))) - .toMatchInlineSnapshot(` + expect( + tj.kmlWithFolders(parse(path.join(d, "inline_style_mini.kml"))) + ).toMatchInlineSnapshot(` { "children": [ { diff --git a/lib/kml/placemark.ts b/lib/kml/placemark.ts index 86c19e5..7c39fb9 100644 --- a/lib/kml/placemark.ts +++ b/lib/kml/placemark.ts @@ -16,11 +16,11 @@ function geometryListToGeometry(geometries: Geometry[]): Geometry | null { return geometries.length === 0 ? null : geometries.length === 1 - ? geometries[0] - : { - type: "GeometryCollection", - geometries, - }; + ? geometries[0] + : { + type: "GeometryCollection", + geometries, + }; } export function getPlacemark( diff --git a/lib/shared.ts b/lib/shared.ts index c3076b9..d567d7e 100644 --- a/lib/shared.ts +++ b/lib/shared.ts @@ -9,6 +9,8 @@ export type F = Feature; export type StyleMap = { [key: string]: P }; +export type NS = [string, string][]; + export function normalizeId(id: string) { return id[0] === "#" ? id : `#${id}`; } diff --git a/package.json b/package.json index c8220d6..9962712 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tmcw/togeojson", - "version": "5.8.1", + "version": "6.0.0-0", "description": "convert KML and GPX to GeoJSON", "source": "lib/index.ts", "umd:main": "dist/togeojson.umd.js", @@ -29,6 +29,7 @@ "@types/geojson": "*" }, "devDependencies": { + "@biomejs/biome": "^1.9.4", "@placemarkio/check-geojson": "^0.1.12", "@rollup/plugin-typescript": "^8.3.3", "@types/geojson": "^7946.0.8", diff --git a/test/data/opencpn.gpx b/test/data/opencpn.gpx new file mode 100644 index 0000000..5d1f149 --- /dev/null +++ b/test/data/opencpn.gpx @@ -0,0 +1,224 @@ + + + + Around Orcas + + 25070000-5d86-4d10-aa10-dcbb6953ffff + 1 + 6.00 + 2022-01-01T23:27:53Z + PC + + false + + + + + 001 + diamond + WPT + + 7042ffff-685e-4b61-86d0-8fc70d8a0000 + 1 + 0.050 + + + + + + + 002 + diamond + WPT + + 3eb10000-fa0b-4b10-90ee-3df852faffff + 1 + 0.050 + + + + + + + 003 + diamond + WPT + + 503cffff-6a62-4d13-9134-57800aa80000 + 1 + 0.050 + + + + + + + 004 + diamond + WPT + + 6738ffff-367e-4f35-8ee0-b23100e80000 + 1 + 0.050 + + + + + + + 005 + diamond + WPT + + 53fcffff-72cc-4cd8-8620-31100c6c0000 + 1 + 0.050 + + + + + + + 006 + diamond + WPT + + 5bc0ffff-bd85-4b79-9d40-684e1f1c0000 + 1 + 0.050 + + + + + + + 007 + diamond + WPT + + 1c740000-1152-4a81-aa92-c6b52fd20000 + 1 + 0.050 + + + + + + + 008 + diamond + WPT + + 53d6ffff-413a-4bbd-9247-d85d1b650000 + 1 + 0.050 + + + + + + + 009 + diamond + WPT + + 36990000-73b0-4dae-99c0-60e010a60000 + 1 + 0.050 + + + + + + + 010 + diamond + WPT + + 75b9ffff-ae35-4a6e-990c-30e22cb70000 + 1 + 0.050 + + + + + + + 011 + diamond + WPT + + 36b10000-13f4-4a3b-ac2e-87cf5723ffff + 1 + 0.050 + + + + + + + 012 + diamond + WPT + + 2a7b0000-0cbe-479d-b99b-66da36b00000 + 1 + 0.050 + + + + + + + 013 + diamond + WPT + + 2c840000-38ee-46d7-a997-4eb22e6c0000 + 1 + 0.050 + + + + + + + 014 + diamond + WPT + + 45a7ffff-cc81-4230-b6db-68945ce8ffff + 1 + 0.050 + + + + + + + 015 + diamond + WPT + + 72f3ffff-aea9-4216-9e45-1c7404a60000 + 1 + 0.050 + + + + + + + 016 + diamond + WPT + + 08a80000-d9a5-4f58-9aaa-3eda20ad0000 + 1 + 0.050 + + + + + + diff --git a/tsconfig.json b/tsconfig.json index cc43c3a..e883476 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ - "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ @@ -28,8 +28,8 @@ /* Modules */ // "module": "es2020", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, + "baseUrl": "./" /* Specify the base directory to resolve non-relative module names. */, // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ @@ -44,14 +44,14 @@ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, // "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./", /* Specify an output folder for all emitted files. */ + "outDir": "./" /* Specify an output folder for all emitted files. */, // "removeComments": true, /* Disable emitting comments. */ - "noEmit": true, /* Disable emitting files from a compilation. */ + "noEmit": true /* Disable emitting files from a compilation. */, // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ @@ -71,12 +71,12 @@ /* Interop Constraints */ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ + "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ @@ -98,6 +98,6 @@ /* Completeness */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ } } diff --git a/yarn.lock b/yarn.lock index 90c3ded..94cafb9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28,6 +28,60 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@biomejs/biome@^1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.9.4.tgz#89766281cbc3a0aae865a7ff13d6aaffea2842bf" + integrity sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog== + optionalDependencies: + "@biomejs/cli-darwin-arm64" "1.9.4" + "@biomejs/cli-darwin-x64" "1.9.4" + "@biomejs/cli-linux-arm64" "1.9.4" + "@biomejs/cli-linux-arm64-musl" "1.9.4" + "@biomejs/cli-linux-x64" "1.9.4" + "@biomejs/cli-linux-x64-musl" "1.9.4" + "@biomejs/cli-win32-arm64" "1.9.4" + "@biomejs/cli-win32-x64" "1.9.4" + +"@biomejs/cli-darwin-arm64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz#dfa376d23a54a2d8f17133c92f23c1bf2e62509f" + integrity sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw== + +"@biomejs/cli-darwin-x64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz#eafc2ce3849d385fc02238aad1ca4a73395a64d9" + integrity sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg== + +"@biomejs/cli-linux-arm64-musl@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz#d780c3e01758fc90f3268357e3f19163d1f84fca" + integrity sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA== + +"@biomejs/cli-linux-arm64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz#8ed1dd0e89419a4b66a47f95aefb8c46ae6041c9" + integrity sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g== + +"@biomejs/cli-linux-x64-musl@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz#f36982b966bd671a36671e1de4417963d7db15fb" + integrity sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg== + +"@biomejs/cli-linux-x64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz#a0a7f56680c76b8034ddc149dbf398bdd3a462e8" + integrity sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg== + +"@biomejs/cli-win32-arm64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz#e2ef4e0084e76b7e26f0fc887c5ef1265ea56200" + integrity sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg== + +"@biomejs/cli-win32-x64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz#4c7afa90e3970213599b4095e62f87e5972b2340" + integrity sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA== + "@esbuild/android-arm@0.15.13": version "0.15.13" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.13.tgz#ce11237a13ee76d5eae3908e47ba4ddd380af86a"