@mailwoman/soil 9.4.0 → 10.1.0
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 +118 -116
- package/lib/index.ts +66 -98
- package/lib/paths.ts +24 -0
- package/lib/schema.ts +188 -120
- package/lib/vocabulary.ts +40 -107
- package/out/index.d.ts +52 -70
- package/out/index.d.ts.map +1 -1
- package/out/index.js +24 -72
- package/out/index.js.map +1 -1
- package/out/paths.d.ts +19 -0
- package/out/paths.d.ts.map +1 -0
- package/out/paths.js +21 -0
- package/out/paths.js.map +1 -0
- package/out/schema.d.ts +187 -119
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js +31 -31
- package/out/schema.js.map +1 -1
- package/out/sdk/acquire.d.ts +15 -24
- package/out/sdk/acquire.d.ts.map +1 -1
- package/out/sdk/acquire.js +5 -20
- package/out/sdk/acquire.js.map +1 -1
- package/out/sdk/build-soil.d.ts +67 -70
- package/out/sdk/build-soil.d.ts.map +1 -1
- package/out/sdk/build-soil.js +65 -95
- package/out/sdk/build-soil.js.map +1 -1
- package/out/sdk/cell-tiers.d.ts +7 -19
- package/out/sdk/cell-tiers.d.ts.map +1 -1
- package/out/sdk/cell-tiers.js +19 -38
- package/out/sdk/cell-tiers.js.map +1 -1
- package/out/sdk/cells.d.ts +15 -41
- package/out/sdk/cells.d.ts.map +1 -1
- package/out/sdk/cells.js +11 -38
- package/out/sdk/cells.js.map +1 -1
- package/out/sdk/client.d.ts +23 -48
- package/out/sdk/client.d.ts.map +1 -1
- package/out/sdk/client.js +19 -63
- package/out/sdk/client.js.map +1 -1
- package/out/sdk/download.d.ts +24 -47
- package/out/sdk/download.d.ts.map +1 -1
- package/out/sdk/download.js +14 -54
- package/out/sdk/download.js.map +1 -1
- package/out/sdk/ingest/chunk.d.ts +77 -0
- package/out/sdk/ingest/chunk.d.ts.map +1 -0
- package/out/sdk/{ingest-chunk.js → ingest/chunk.js} +19 -17
- package/out/sdk/ingest/chunk.js.map +1 -0
- package/out/sdk/ingest/worker.d.ts +9 -0
- package/out/sdk/ingest/worker.d.ts.map +1 -0
- package/out/{scripts/ingest-chunk.js → sdk/ingest/worker.js} +11 -10
- package/out/sdk/ingest/worker.js.map +1 -0
- package/out/sdk/ingest.d.ts +40 -52
- package/out/sdk/ingest.d.ts.map +1 -1
- package/out/sdk/ingest.js +18 -61
- package/out/sdk/ingest.js.map +1 -1
- package/out/sdk/measure-resolutions.d.ts +5 -16
- package/out/sdk/measure-resolutions.d.ts.map +1 -1
- package/out/sdk/measure-resolutions.js +3 -15
- package/out/sdk/measure-resolutions.js.map +1 -1
- package/out/sdk/reduce.d.ts +33 -59
- package/out/sdk/reduce.d.ts.map +1 -1
- package/out/sdk/reduce.js +47 -78
- package/out/sdk/reduce.js.map +1 -1
- package/out/sdk/survey-area.d.ts +16 -48
- package/out/sdk/survey-area.d.ts.map +1 -1
- package/out/sdk/survey-area.js +33 -77
- package/out/sdk/survey-area.js.map +1 -1
- package/out/sdk/tabular.d.ts +32 -31
- package/out/sdk/tabular.d.ts.map +1 -1
- package/out/sdk/tabular.js +58 -56
- package/out/sdk/tabular.js.map +1 -1
- package/out/sdk/test-kit.d.ts +57 -0
- package/out/sdk/test-kit.d.ts.map +1 -0
- package/out/{test-kit.js → sdk/test-kit.js} +18 -39
- package/out/sdk/test-kit.js.map +1 -0
- package/out/sdk/verify.d.ts +15 -51
- package/out/sdk/verify.d.ts.map +1 -1
- package/out/sdk/verify.js +19 -77
- package/out/sdk/verify.js.map +1 -1
- package/out/vocabulary.d.ts +37 -103
- package/out/vocabulary.d.ts.map +1 -1
- package/out/vocabulary.js +34 -107
- package/out/vocabulary.js.map +1 -1
- package/package.json +36 -190
- package/{lib/sdk → sdk}/acquire.ts +17 -27
- package/{lib/sdk → sdk}/build-soil.ts +114 -128
- package/{lib/sdk → sdk}/cell-tiers.ts +20 -39
- package/{lib/sdk → sdk}/cells.ts +17 -43
- package/sdk/client.ts +147 -0
- package/sdk/download.ts +131 -0
- package/{lib/sdk/ingest-chunk.ts → sdk/ingest/chunk.ts} +34 -26
- package/{lib/scripts/ingest-chunk.ts → sdk/ingest/worker.ts} +10 -9
- package/sdk/ingest.ts +253 -0
- package/{lib/sdk → sdk}/measure-resolutions.ts +5 -16
- package/sdk/reduce.ts +344 -0
- package/{lib/sdk → sdk}/survey-area.ts +39 -83
- package/{lib/sdk → sdk}/tabular.ts +62 -59
- package/{lib → sdk}/test-kit.ts +18 -40
- package/{lib/sdk → sdk}/verify.ts +29 -85
- package/lib/sdk/client.ts +0 -184
- package/lib/sdk/download.ts +0 -161
- package/lib/sdk/index.ts +0 -20
- package/lib/sdk/ingest.ts +0 -278
- package/lib/sdk/reduce.ts +0 -375
- package/out/scripts/ingest-chunk.d.ts +0 -11
- package/out/scripts/ingest-chunk.d.ts.map +0 -1
- package/out/scripts/ingest-chunk.js.map +0 -1
- package/out/sdk/index.d.ts +0 -20
- package/out/sdk/index.d.ts.map +0 -1
- package/out/sdk/index.js +0 -20
- package/out/sdk/index.js.map +0 -1
- package/out/sdk/ingest-chunk.d.ts +0 -73
- package/out/sdk/ingest-chunk.d.ts.map +0 -1
- package/out/sdk/ingest-chunk.js.map +0 -1
- package/out/test-kit.d.ts +0 -79
- package/out/test-kit.d.ts.map +0 -1
- package/out/test-kit.js.map +0 -1
package/out/index.js
CHANGED
|
@@ -3,42 +3,9 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* THREE ANSWERS, AND KEEPING THEM APART IS THE WHOLE JOB.
|
|
9
|
-
*
|
|
10
|
-
* 1. `designated` — the survey mapped this location and the cell's class distribution is the answer.
|
|
11
|
-
* 2. `designated_no_rating` — the survey mapped this location and rated nothing there. A cell that is
|
|
12
|
-
* 100% `unrated_share` or `notrateable_share` is `designated`-complete and carries no capability
|
|
13
|
-
* reading whatsoever, and that is not a corner case: 17.1% of national components carry no capability
|
|
14
|
-
* rating.
|
|
15
|
-
* 3. `unknown` — no coverage row. Outside any published survey area, or inside one where the polygon
|
|
16
|
-
* exists and the soil mapping behind it does not.
|
|
17
|
-
*
|
|
18
|
-
* READINGS 2 AND 3 LOOK THE SAME FROM A CLASS CODE AND ARE OPPOSITE ANSWERS FROM THE READER. A layer that
|
|
19
|
-
* could not tell them apart would report unmapped ground as unrated ground, which is one of the four
|
|
20
|
-
* absences this whole layer exists to keep separate.
|
|
21
|
-
*
|
|
22
|
-
* THE ANSWER IS A DISTRIBUTION, AND THE TOP CLASS ALWAYS ARRIVES WITH THE SHARE IT RESTS ON. NRCS's own
|
|
23
|
-
* `muaggatt` ships `niccdcd` beside `niccdcdpct` for exactly this reason, with an observed minimum of 2%.
|
|
24
|
-
* A caller that wants one class may take `topClass`; it cannot take it without also being handed
|
|
25
|
-
* `topClassShare`, because a 2% plurality and an 85% majority are different claims.
|
|
26
|
-
*
|
|
27
|
-
* NEITHER READING IS A STATEMENT ABOUT WHETHER THE LAND CAN BE FARMED. The layer reports what the soil
|
|
28
|
-
* survey assigns to the map unit covering a location, which is a fact about the map. NRCS states that its
|
|
29
|
-
* data "do not eliminate the need for onsite sampling, testing, and detailed study of specific sites for
|
|
30
|
-
* intensive uses" and are "intended for planning purposes only" — so `limits` carries the authority's own
|
|
31
|
-
* exclusions on every answer.
|
|
32
|
-
*
|
|
33
|
-
* THE PROBE IS ONE PRIMARY-KEY READ. The reduction is single-resolution and one row per cell, which is
|
|
34
|
-
* what makes it the spine key: a coordinate becomes a cell, the cell becomes a row, and the geometry tier
|
|
35
|
-
* underneath is never touched at read time. The unsimplified rings are there for a caller that wants to
|
|
36
|
-
* re-derive the claim, not for the probe.
|
|
37
|
-
*
|
|
38
|
-
* THE READER IS SYNCHRONOUS AND USES RAW PREPARED STATEMENTS, matching the resolution ladder's existing
|
|
39
|
-
* shape. The DDL that created these tables IS Kysely — see `schema.ts`.
|
|
6
|
+
* Synchronous reader for `soil.db` that returns the soil survey's capability-class distribution at a coordinate.
|
|
40
7
|
*/
|
|
41
|
-
import { parseJSONStrict } from "@mailwoman/core/json";
|
|
8
|
+
import { parseJSONStrict, stringifyJSON } from "@mailwoman/core/json";
|
|
42
9
|
import { assertCoverageNotEmpty, singleManifestRow, toLayerManifest, } from "@mailwoman/core/layers";
|
|
43
10
|
import { shortCellToInt } from "@mailwoman/spatial";
|
|
44
11
|
import { readCoverageAt } from "@mailwoman/spatial/h3/coverage";
|
|
@@ -47,29 +14,28 @@ import { latLngToCell } from "h3-js";
|
|
|
47
14
|
import { SOIL_LAYER_NAME_PREFIX, SSURGO_PRODUCT_LIMITS } from "#vocabulary";
|
|
48
15
|
export { FarmlandScope, farmlandScope, SSURGO_PRODUCT_LIMITS } from "#vocabulary";
|
|
49
16
|
/**
|
|
50
|
-
*
|
|
17
|
+
* The kinds of answer the layer gives for a coordinate, where `DesignatedNoRating`
|
|
18
|
+
* and `Unknown` must stay apart.
|
|
51
19
|
*/
|
|
52
20
|
export const SoilReadingKind = {
|
|
53
21
|
/**
|
|
54
|
-
* The survey mapped this location and assigns at least one capability class
|
|
22
|
+
* The survey mapped this location and assigns at least one capability class.
|
|
55
23
|
*/
|
|
56
24
|
Designated: "designated",
|
|
57
25
|
/**
|
|
58
|
-
* The survey mapped this location and
|
|
26
|
+
* The survey mapped this location and assigned no rating.
|
|
27
|
+
* Every share is reported as an absence share.
|
|
59
28
|
*/
|
|
60
29
|
DesignatedNoRating: "designated_no_rating",
|
|
61
30
|
/**
|
|
62
|
-
*
|
|
31
|
+
* The layer has no coverage for this location.
|
|
32
|
+
* This does not imply low capability.
|
|
63
33
|
*/
|
|
64
34
|
Unknown: "unknown",
|
|
65
35
|
};
|
|
66
36
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* Everything that would make the reader answer a well-formed wrong thing is refused at CONSTRUCTION rather than at
|
|
70
|
-
* query time: a manifest naming a different product, a coverage table with no rows, a vocabulary with no classes. Each
|
|
71
|
-
* of those would otherwise present as a reader that simply always answers `unknown`, which on a receipt is
|
|
72
|
-
* indistinguishable from a region the authority genuinely has not surveyed.
|
|
37
|
+
* Reads a sealed `soil.db`, throwing at construction on a manifest for a different product,
|
|
38
|
+
* an empty coverage table, an empty class vocabulary, or a missing share weighting.
|
|
73
39
|
*/
|
|
74
40
|
export class SoilCapabilityLookup {
|
|
75
41
|
identity;
|
|
@@ -96,14 +62,13 @@ export class SoilCapabilityLookup {
|
|
|
96
62
|
this.#selectCoverage = this.#database.prepare("SELECT h3_cell, completeness, basis, observed_rows FROM layer_coverage WHERE h3_cell = ?");
|
|
97
63
|
}
|
|
98
64
|
/**
|
|
99
|
-
*
|
|
65
|
+
* Returns what the soil survey assigns at this coordinate.
|
|
100
66
|
*/
|
|
101
67
|
lookup(latitude, longitude) {
|
|
102
68
|
const indexCell = latLngToCell(latitude, longitude, this.identity.indexResolution);
|
|
103
69
|
const coverage = this.#readCoverage(indexCell);
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
// summary, so a summary row without a coverage row would state a determination outside the authority's footprint.
|
|
70
|
+
// Every answer is a per-cell summary, so a cell outside the coverage table
|
|
71
|
+
// is unknown even if a summary row exists.
|
|
107
72
|
if (!coverage) {
|
|
108
73
|
return {
|
|
109
74
|
kind: SoilReadingKind.Unknown,
|
|
@@ -113,9 +78,8 @@ export class SoilCapabilityLookup {
|
|
|
113
78
|
}
|
|
114
79
|
const row = this.#selectCell.get(shortCellToInt(indexCell));
|
|
115
80
|
if (!row) {
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
// this location may be outside the delineations it covers.
|
|
81
|
+
// At a survey-area edge the coarser coverage cell is covered and this index cell
|
|
82
|
+
// has no delineation, so the location may be outside the survey.
|
|
119
83
|
return {
|
|
120
84
|
kind: SoilReadingKind.Unknown,
|
|
121
85
|
coverage,
|
|
@@ -150,23 +114,15 @@ export class SoilCapabilityLookup {
|
|
|
150
114
|
[Symbol.dispose]() {
|
|
151
115
|
this.#database.destroy();
|
|
152
116
|
}
|
|
153
|
-
/**
|
|
154
|
-
* The coverage row for the index cell's parent at the coverage resolution.
|
|
155
|
-
*/
|
|
156
117
|
#readCoverage(indexCell) {
|
|
157
118
|
return readCoverageAt(this.#selectCoverage, indexCell, this.identity.coverageResolution);
|
|
158
119
|
}
|
|
159
120
|
/**
|
|
160
|
-
*
|
|
121
|
+
* Returns the first survey area whose bounding rectangle contains the coordinate.
|
|
122
|
+
* overlapping rectangles may give the wrong area near a corner.
|
|
161
123
|
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* not depend on it — the cell row is the answer — so a corner ambiguity costs a label rather than a determination.
|
|
165
|
-
*
|
|
166
|
-
* A LINEAR SCAN, WHICH THE PILOT'S 99 SURVEY AREAS MAKE FREE AND A NATIONAL BUILD WOULD NOT. It returns on the first
|
|
167
|
-
* containing rectangle, so the pilot costs a few dozen comparisons per geocode. At the 3,380 survey areas the country
|
|
168
|
-
* holds this wants a bounding-box index; it is left as a scan because a structure sized for a set this build does not
|
|
169
|
-
* hold would be untested at the size it was built for.
|
|
124
|
+
* This affects only the `surveyArea` label.
|
|
125
|
+
* A spatial index would be needed to avoid the linear scan for thousands of areas.
|
|
170
126
|
*/
|
|
171
127
|
#surveyAreaAt(latitude, longitude) {
|
|
172
128
|
for (const [index, bounds] of this.#bounds.entries()) {
|
|
@@ -180,18 +136,14 @@ export class SoilCapabilityLookup {
|
|
|
180
136
|
return undefined;
|
|
181
137
|
}
|
|
182
138
|
}
|
|
183
|
-
/**
|
|
184
|
-
* Read and check the layer's identity.
|
|
185
|
-
*/
|
|
186
139
|
function readIdentity(database, databasePath) {
|
|
187
140
|
const manifestRows = database.prepare("SELECT * FROM layer_manifest").all();
|
|
188
|
-
// The name
|
|
189
|
-
//
|
|
190
|
-
// vocabulary per artifact, over whichever survey areas were built.
|
|
141
|
+
// The layer name ends with the region the build covers, so the reader checks only the prefix
|
|
142
|
+
// rather than `parseManifestRows`, which compares whole names.
|
|
191
143
|
const row = singleManifestRow(manifestRows, `soil reader: ${databasePath}`);
|
|
192
144
|
const name = String(row.name);
|
|
193
145
|
if (!name.startsWith(SOIL_LAYER_NAME_PREFIX)) {
|
|
194
|
-
throw new Error(`soil reader: ${databasePath} is layer ${
|
|
146
|
+
throw new Error(`soil reader: ${databasePath} is layer ${stringifyJSON(name)}, which is not a ${stringifyJSON(SOIL_LAYER_NAME_PREFIX)} layer — one authority, one product, one rating vocabulary per artifact`);
|
|
195
147
|
}
|
|
196
148
|
const manifest = toLayerManifest(row);
|
|
197
149
|
const spineKeys = manifest.spineKeys;
|
|
@@ -241,7 +193,7 @@ function readIdentity(database, databasePath) {
|
|
|
241
193
|
})),
|
|
242
194
|
classCodes: [...definitions.keys()],
|
|
243
195
|
weighting: { code: weighting.code, description: weighting.definition },
|
|
244
|
-
databasePath,
|
|
196
|
+
databasePath: databasePath.toString(),
|
|
245
197
|
},
|
|
246
198
|
definitions,
|
|
247
199
|
bounds: areaRows.map((area) => ({
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EACN,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,GAGf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAIpC,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CA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C,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACpC,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,gBAAgB,EAAE,IAAI,CAAC,kBAAkB;gBACzC,iBAAiB,EAAE,IAAI,CAAC,mBAAmB;gBAC3C,WAAW,EAAE,IAAI,CAAC,YAAY;gBAC9B,YAAY,EAAE,IAAI,CAAC,aAAa;aAChC,CAAC,CAAC;YACH,UAAU,EAAE,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;YACnC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,CAAC,UAAU,EAAE;YACtE,YAAY,EAAE,YAAY,CAAC,QAAQ,EAAE;SACrC;QACD,WAAW;QACX,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC/B,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,MAAM,EAAE,IAAI,CAAC,OAAO;SACpB,CAAC,CAAC;KACH,CAAA;AACF,CAAC"}
|
package/out/paths.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Where the soil layer database and its download caches live under the data root's `db/` group.
|
|
7
|
+
*/
|
|
8
|
+
import type { PathBuilder, PathBuilderLike } from "path-ts";
|
|
9
|
+
/**
|
|
10
|
+
* `<dataRoot>/db/soil`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function soilDatabaseRoot(dataRoot: PathBuilderLike): PathBuilder;
|
|
13
|
+
/**
|
|
14
|
+
* `$MAILWOMAN_DATA_ROOT/db/soil`, read when a path is requested.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link soilDatabaseRoot} for another data root.
|
|
17
|
+
*/
|
|
18
|
+
export declare const soilDatabasePath: PathBuilder;
|
|
19
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../lib/paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE3D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,WAAW,CAEvE;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAA8C,CAAA"}
|
package/out/paths.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Where the soil layer database and its download caches live under the data root's `db/` group.
|
|
7
|
+
*/
|
|
8
|
+
import { databaseRootPath, dataRootPath } from "@mailwoman/core/data-root";
|
|
9
|
+
/**
|
|
10
|
+
* `<dataRoot>/db/soil`.
|
|
11
|
+
*/
|
|
12
|
+
export function soilDatabaseRoot(dataRoot) {
|
|
13
|
+
return databaseRootPath(dataRoot)("soil");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `$MAILWOMAN_DATA_ROOT/db/soil`, read when a path is requested.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link soilDatabaseRoot} for another data root.
|
|
19
|
+
*/
|
|
20
|
+
export const soilDatabasePath = soilDatabaseRoot(dataRootPath());
|
|
21
|
+
//# sourceMappingURL=paths.js.map
|
package/out/paths.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../lib/paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAG1E;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAyB;IACzD,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAgB,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAA"}
|