@speleotica/frcsdata 4.3.0 → 5.0.0-beta.1
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/FrcsPlotFile.d.ts +1 -0
- package/FrcsPlotFile.d.ts.map +1 -0
- package/FrcsPlotFile.js +2 -1
- package/FrcsPlotFile.js.map +1 -0
- package/FrcsPlotShot.d.ts +1 -0
- package/FrcsPlotShot.d.ts.map +1 -0
- package/FrcsPlotShot.js +2 -1
- package/FrcsPlotShot.js.map +1 -0
- package/FrcsTripSummary.d.ts +1 -0
- package/FrcsTripSummary.d.ts.map +1 -0
- package/FrcsTripSummary.js +2 -1
- package/FrcsTripSummary.js.map +1 -0
- package/FrcsTripSummaryFile.d.ts +1 -0
- package/FrcsTripSummaryFile.d.ts.map +1 -0
- package/FrcsTripSummaryFile.js +2 -1
- package/FrcsTripSummaryFile.js.map +1 -0
- package/ParseIssue.d.ts +98 -0
- package/ParseIssue.d.ts.map +1 -0
- package/ParseIssue.js +17 -0
- package/ParseIssue.js.map +1 -0
- package/SourceLoc.d.ts +67 -0
- package/SourceLoc.d.ts.map +1 -0
- package/SourceLoc.js +18 -0
- package/SourceLoc.js.map +1 -0
- package/chunksToLines.d.ts +5 -0
- package/chunksToLines.d.ts.map +1 -0
- package/chunksToLines.js +139 -0
- package/chunksToLines.js.map +1 -0
- package/cli/check-survey.d.ts +2 -0
- package/cli/check-survey.d.ts.map +1 -0
- package/cli/check-survey.js +88 -0
- package/cli/check-survey.js.map +1 -0
- package/cli/parse-survey.d.ts +2 -0
- package/cli/parse-survey.d.ts.map +1 -0
- package/cli/parse-survey.js +37 -0
- package/cli/parse-survey.js.map +1 -0
- package/cli.d.ts +2 -0
- package/cli.d.ts.map +1 -0
- package/cli.js +83 -0
- package/cli.js.map +1 -0
- package/index.d.ts +6 -7
- package/index.d.ts.map +1 -0
- package/index.js +4 -36
- package/index.js.map +1 -0
- package/node/index.d.ts +2 -1
- package/node/index.d.ts.map +1 -0
- package/node/index.js +14 -5
- package/node/index.js.map +1 -0
- package/package.json +12 -7
- package/parseFrcsPlotFile.d.ts +1 -0
- package/parseFrcsPlotFile.d.ts.map +1 -0
- package/parseFrcsPlotFile.js +2 -1
- package/parseFrcsPlotFile.js.map +1 -0
- package/parseFrcsTripSummaryFile.d.ts +1 -0
- package/parseFrcsTripSummaryFile.d.ts.map +1 -0
- package/parseFrcsTripSummaryFile.js +2 -1
- package/parseFrcsTripSummaryFile.js.map +1 -0
- package/src/FrcsPlotFile.ts +9 -0
- package/src/FrcsPlotShot.ts +18 -0
- package/src/FrcsTripSummary.ts +14 -0
- package/src/FrcsTripSummaryFile.ts +7 -0
- package/src/ParseIssue.ts +19 -0
- package/src/SourceLoc.ts +13 -0
- package/src/chunksToLines.ts +26 -0
- package/src/cli/check-survey.ts +84 -0
- package/src/cli/parse-survey.ts +10 -0
- package/src/cli.ts +30 -0
- package/src/index.ts +31 -0
- package/src/node/index.ts +33 -0
- package/src/parseFrcsPlotFile.ts +168 -0
- package/src/parseFrcsTripSummaryFile.ts +76 -0
- package/src/string/index.ts +34 -0
- package/src/survey/FrcsSurveyFile.ts +217 -0
- package/src/survey/FrcsSurveyFileJson.ts +46 -0
- package/src/survey/ZodFrcsSurveyFileJson.ts +260 -0
- package/src/survey/ZodFrcsSurveyFileToJson.ts +297 -0
- package/src/survey/formatFrcsShot.ts +185 -0
- package/src/survey/formatFrcsSurveyFile.ts +96 -0
- package/src/survey/getColumnRanges.ts +82 -0
- package/src/survey/normalizeTeamMemberName.ts +10 -0
- package/src/survey/parseFrcsSurveyFile.ts +862 -0
- package/src/survey/parsers.ts +128 -0
- package/src/survey/validators.ts +24 -0
- package/src/underlineSource.ts +34 -0
- package/src/web/index.ts +125 -0
- package/string/index.d.ts +2 -1
- package/string/index.d.ts.map +1 -0
- package/string/index.js +14 -5
- package/string/index.js.map +1 -0
- package/survey/FrcsSurveyFile.d.ts +172 -0
- package/survey/FrcsSurveyFile.d.ts.map +1 -0
- package/{FrcsSurveyFile.js → survey/FrcsSurveyFile.js} +4 -1
- package/survey/FrcsSurveyFile.js.map +1 -0
- package/survey/FrcsSurveyFileJson.d.ts +15 -0
- package/survey/FrcsSurveyFileJson.d.ts.map +1 -0
- package/{FrcsTrip.js → survey/FrcsSurveyFileJson.js} +2 -1
- package/survey/FrcsSurveyFileJson.js.map +1 -0
- package/survey/ZodFrcsSurveyFileJson.d.ts +60549 -0
- package/survey/ZodFrcsSurveyFileJson.d.ts.map +1 -0
- package/survey/ZodFrcsSurveyFileJson.js +188 -0
- package/survey/ZodFrcsSurveyFileJson.js.map +1 -0
- package/survey/ZodFrcsSurveyFileToJson.d.ts +60390 -0
- package/survey/ZodFrcsSurveyFileToJson.d.ts.map +1 -0
- package/survey/ZodFrcsSurveyFileToJson.js +219 -0
- package/survey/ZodFrcsSurveyFileToJson.js.map +1 -0
- package/{formatFrcsShot.d.ts → survey/formatFrcsShot.d.ts} +3 -3
- package/survey/formatFrcsShot.d.ts.map +1 -0
- package/{formatFrcsShot.js → survey/formatFrcsShot.js} +13 -4
- package/survey/formatFrcsShot.js.map +1 -0
- package/survey/formatFrcsSurveyFile.d.ts +3 -0
- package/survey/formatFrcsSurveyFile.d.ts.map +1 -0
- package/{formatFrcsSurveyFile.js → survey/formatFrcsSurveyFile.js} +6 -5
- package/survey/formatFrcsSurveyFile.js.map +1 -0
- package/survey/getColumnRanges.d.ts +24 -0
- package/survey/getColumnRanges.d.ts.map +1 -0
- package/survey/getColumnRanges.js +70 -0
- package/survey/getColumnRanges.js.map +1 -0
- package/survey/normalizeTeamMemberName.d.ts +2 -0
- package/survey/normalizeTeamMemberName.d.ts.map +1 -0
- package/survey/normalizeTeamMemberName.js +16 -0
- package/survey/normalizeTeamMemberName.js.map +1 -0
- package/{parseFrcsSurveyFile.d.ts → survey/parseFrcsSurveyFile.d.ts} +3 -5
- package/survey/parseFrcsSurveyFile.d.ts.map +1 -0
- package/survey/parseFrcsSurveyFile.js +818 -0
- package/survey/parseFrcsSurveyFile.js.map +1 -0
- package/survey/parsers.d.ts +11 -0
- package/survey/parsers.d.ts.map +1 -0
- package/survey/parsers.js +119 -0
- package/survey/parsers.js.map +1 -0
- package/survey/validators.d.ts +7 -0
- package/survey/validators.d.ts.map +1 -0
- package/survey/validators.js +36 -0
- package/survey/validators.js.map +1 -0
- package/underlineSource.d.ts +6 -0
- package/underlineSource.d.ts.map +1 -0
- package/underlineSource.js +30 -0
- package/underlineSource.js.map +1 -0
- package/web/index.d.ts +7 -6
- package/web/index.d.ts.map +1 -0
- package/web/index.js +13 -10
- package/web/index.js.map +1 -0
- package/FrcsShot.d.ts +0 -56
- package/FrcsShot.js +0 -12
- package/FrcsSurveyFile.d.ts +0 -28
- package/FrcsTrip.d.ts +0 -22
- package/formatFrcsSurveyFile.d.ts +0 -2
- package/parseFrcsSurveyFile.js +0 -811
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UnitType,
|
|
3
|
+
Unit,
|
|
4
|
+
UnitizedNumber,
|
|
5
|
+
Angle,
|
|
6
|
+
Length,
|
|
7
|
+
} from '@speleotica/unitized'
|
|
8
|
+
import { Unitize } from '@speleotica/unitized'
|
|
9
|
+
import type { FrcsShot } from './FrcsSurveyFile'
|
|
10
|
+
import { isValidOptFloat } from './validators'
|
|
11
|
+
|
|
12
|
+
export function parseMonth(month: string) {
|
|
13
|
+
switch (month.substring(0, 3).toLowerCase()) {
|
|
14
|
+
case 'jan':
|
|
15
|
+
return 1
|
|
16
|
+
case 'feb':
|
|
17
|
+
return 2
|
|
18
|
+
case 'mar':
|
|
19
|
+
return 3
|
|
20
|
+
case 'apr':
|
|
21
|
+
return 4
|
|
22
|
+
case 'may':
|
|
23
|
+
return 5
|
|
24
|
+
case 'jun':
|
|
25
|
+
return 6
|
|
26
|
+
case 'jul':
|
|
27
|
+
return 7
|
|
28
|
+
case 'aug':
|
|
29
|
+
return 8
|
|
30
|
+
case 'sep':
|
|
31
|
+
return 9
|
|
32
|
+
case 'oct':
|
|
33
|
+
return 10
|
|
34
|
+
case 'nov':
|
|
35
|
+
return 11
|
|
36
|
+
case 'dec':
|
|
37
|
+
return 12
|
|
38
|
+
default:
|
|
39
|
+
throw new Error(`invalid month: ${month}`)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export function parseNumber<T extends UnitType<T>>(
|
|
43
|
+
s: string,
|
|
44
|
+
unit: Unit<T>
|
|
45
|
+
): UnitizedNumber<T> | undefined {
|
|
46
|
+
const value = parseFloat(s)
|
|
47
|
+
if (isNaN(value)) return undefined
|
|
48
|
+
return new UnitizedNumber(value, unit)
|
|
49
|
+
}
|
|
50
|
+
export function parseAzimuth(
|
|
51
|
+
s: string,
|
|
52
|
+
unit: Unit<Angle>
|
|
53
|
+
): UnitizedNumber<Angle> | undefined {
|
|
54
|
+
const parsed = parseNumber(s, unit)
|
|
55
|
+
return parsed?.get(Angle.degrees) === 360 ? Unitize.degrees(0) : parsed
|
|
56
|
+
}
|
|
57
|
+
export function parseSpecialKind(kind: string): FrcsShot['specialKind'] {
|
|
58
|
+
switch (kind) {
|
|
59
|
+
case 'H':
|
|
60
|
+
return 'horizontal'
|
|
61
|
+
case 'D':
|
|
62
|
+
return 'diagonal'
|
|
63
|
+
default:
|
|
64
|
+
return undefined
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export function parseLengthUnit(unit: string): Unit<Length> | undefined {
|
|
68
|
+
switch (unit) {
|
|
69
|
+
case 'FI':
|
|
70
|
+
return Length.inches
|
|
71
|
+
case 'FF':
|
|
72
|
+
case 'FT':
|
|
73
|
+
return Length.feet
|
|
74
|
+
case 'MT':
|
|
75
|
+
case 'MM':
|
|
76
|
+
case 'M ':
|
|
77
|
+
return Length.meters
|
|
78
|
+
}
|
|
79
|
+
return undefined
|
|
80
|
+
}
|
|
81
|
+
export function parseAngleUnit(unit: string): Unit<Angle> | undefined {
|
|
82
|
+
switch (unit) {
|
|
83
|
+
case 'D':
|
|
84
|
+
return Angle.degrees
|
|
85
|
+
case 'G':
|
|
86
|
+
return Angle.gradians
|
|
87
|
+
case 'M':
|
|
88
|
+
return Angle.milsNATO
|
|
89
|
+
}
|
|
90
|
+
return undefined
|
|
91
|
+
}
|
|
92
|
+
export function parseLrud<T extends UnitType<T>>(
|
|
93
|
+
s: string,
|
|
94
|
+
unit: Unit<Length>
|
|
95
|
+
): UnitizedNumber<Length> | undefined {
|
|
96
|
+
const value = parseFloat(s)
|
|
97
|
+
return !Number.isFinite(value) || value < 0
|
|
98
|
+
? undefined
|
|
99
|
+
: new UnitizedNumber(value, unit)
|
|
100
|
+
}
|
|
101
|
+
export function parseFromStationLruds(
|
|
102
|
+
line: string,
|
|
103
|
+
distanceUnit: Unit<Length>
|
|
104
|
+
): [string, NonNullable<FrcsShot['fromLruds']>] | undefined {
|
|
105
|
+
const fromStr = line.substring(0, 5)
|
|
106
|
+
if (!/^\s*\S+$/.test(fromStr)) return undefined
|
|
107
|
+
const gap = line.substring(5, 40)
|
|
108
|
+
if (gap.trim()) return undefined
|
|
109
|
+
const lrudStr = line.substring(40, 52)
|
|
110
|
+
if (!/\d/.test(lrudStr)) return undefined
|
|
111
|
+
const lStr = line.substring(40, 43)
|
|
112
|
+
const rStr = line.substring(43, 46)
|
|
113
|
+
const uStr = line.substring(46, 49)
|
|
114
|
+
const dStr = line.substring(49, 52)
|
|
115
|
+
if (
|
|
116
|
+
!isValidOptFloat(lStr) ||
|
|
117
|
+
!isValidOptFloat(rStr) ||
|
|
118
|
+
!isValidOptFloat(uStr) ||
|
|
119
|
+
!isValidOptFloat(dStr)
|
|
120
|
+
) {
|
|
121
|
+
return undefined
|
|
122
|
+
}
|
|
123
|
+
const up = parseLrud(uStr, distanceUnit)
|
|
124
|
+
const down = parseLrud(dStr, distanceUnit)
|
|
125
|
+
const left = parseLrud(lStr, distanceUnit)
|
|
126
|
+
const right = parseLrud(rStr, distanceUnit)
|
|
127
|
+
return [fromStr.trim(), { left, right, up, down }]
|
|
128
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// determines if a cell contains a valid station name.
|
|
2
|
+
export function isValidStation(s: string): boolean {
|
|
3
|
+
return /^\s*\S+\s*$/.test(s)
|
|
4
|
+
}
|
|
5
|
+
// determines if a cell contains a valid unsigned integer.
|
|
6
|
+
export function isValidUInt(s: string): boolean {
|
|
7
|
+
return /^\s*[0-9]+\s*$/.test(s)
|
|
8
|
+
}
|
|
9
|
+
// determines if a cell contains a valid float.
|
|
10
|
+
export function isValidFloat(s: string): boolean {
|
|
11
|
+
return /^\s*[-+]?([0-9]+(\.[0-9]*)?|\.[0-9]+)\s*$/.test(s)
|
|
12
|
+
}
|
|
13
|
+
// determines if a cell contains a valid unsigned float or whitespace.
|
|
14
|
+
export function isValidOptFloat(s: string): boolean {
|
|
15
|
+
return /^\s*([-+]?([0-9]+(\.[0-9]*)?|\.[0-9]+))?\s*$/.test(s)
|
|
16
|
+
}
|
|
17
|
+
// determines if a cell contains a valid unsigned float or whitespace.
|
|
18
|
+
export function isValidOptUFloat(s: string): boolean {
|
|
19
|
+
return /^\s*([0-9]+(\.[0-9]*)?|\.[0-9]+)?\s*$/.test(s)
|
|
20
|
+
}
|
|
21
|
+
// determines if a cell contains a valid unsigned float.
|
|
22
|
+
export function isValidUFloat(s: string): boolean {
|
|
23
|
+
return /^\s*([0-9]+(\.[0-9]*)?|\.[0-9]+)\s*$/.test(s)
|
|
24
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SourceLoc } from './SourceLoc'
|
|
2
|
+
|
|
3
|
+
export function underlineSource(
|
|
4
|
+
source: string,
|
|
5
|
+
loc: SourceLoc,
|
|
6
|
+
{
|
|
7
|
+
underlineChar = '^',
|
|
8
|
+
underlineStyle = (s) => s,
|
|
9
|
+
}: { underlineChar?: string; underlineStyle?: (s: string) => string } = {}
|
|
10
|
+
) {
|
|
11
|
+
let start = source.lastIndexOf('\n', loc.start.index)
|
|
12
|
+
if (start < 0) start = source.lastIndexOf('\r', loc.start.index)
|
|
13
|
+
if (start < 0) start = -1
|
|
14
|
+
if (start < loc.start.index) start++
|
|
15
|
+
|
|
16
|
+
let end = source.indexOf('\r', loc.end.index)
|
|
17
|
+
if (end < 0) end = source.indexOf('\n', loc.end.index)
|
|
18
|
+
if (end < 0) end = source.length
|
|
19
|
+
|
|
20
|
+
const sourcelines = source.substring(start, end).split(/\r\n?|\n/gm)
|
|
21
|
+
const underlineLines = (
|
|
22
|
+
' '.repeat(loc.start.index - start) +
|
|
23
|
+
source
|
|
24
|
+
.substring(loc.start.index, Math.max(loc.start.index + 1, loc.end.index))
|
|
25
|
+
.replace(/[^\r\n]/g, underlineChar) +
|
|
26
|
+
' '.repeat(end - loc.end.index)
|
|
27
|
+
)
|
|
28
|
+
.split(/\r\n?|\n/gm)
|
|
29
|
+
.map((line) => underlineStyle(line))
|
|
30
|
+
|
|
31
|
+
return sourcelines
|
|
32
|
+
.flatMap((line, index) => [line, underlineLines[index]])
|
|
33
|
+
.join('\n')
|
|
34
|
+
}
|
package/src/web/index.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import _parseFrcsSurveyFile from '../survey/parseFrcsSurveyFile'
|
|
2
|
+
import { ParseFrcsSurveyFileOptions } from '../survey/FrcsSurveyFile'
|
|
3
|
+
import _parseFrcsPlotFile from '../parseFrcsPlotFile'
|
|
4
|
+
import _parseFrcsTripSummaryFile from '../parseFrcsTripSummaryFile'
|
|
5
|
+
import type {
|
|
6
|
+
FrcsSurveyFile,
|
|
7
|
+
InvalidFrcsSurveyFile,
|
|
8
|
+
} from '../survey/FrcsSurveyFile'
|
|
9
|
+
|
|
10
|
+
class LinesTransform extends TransformStream<string> {
|
|
11
|
+
parts: string[] = []
|
|
12
|
+
|
|
13
|
+
constructor() {
|
|
14
|
+
super({
|
|
15
|
+
transform: (chunk, controller) => {
|
|
16
|
+
let end = 0
|
|
17
|
+
for (const match of chunk.matchAll(/\r\n?|\n/gm)) {
|
|
18
|
+
this.parts.push(chunk.substring(end, match.index))
|
|
19
|
+
controller.enqueue(this.parts.join(''))
|
|
20
|
+
this.parts.length = 0
|
|
21
|
+
end = match.index + match[0].length
|
|
22
|
+
}
|
|
23
|
+
if (end < chunk.length) this.parts.push(chunk.substring(end))
|
|
24
|
+
},
|
|
25
|
+
flush: (controller) => {
|
|
26
|
+
if (this.parts.length) {
|
|
27
|
+
controller.enqueue(this.parts.join(''))
|
|
28
|
+
this.parts.length = 0
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function readableStreamValues<T>(
|
|
36
|
+
stream: ReadableStream<T>,
|
|
37
|
+
{ preventCancel = false }: { preventCancel?: boolean } = {}
|
|
38
|
+
): AsyncIterableIterator<T> {
|
|
39
|
+
const reader = stream.getReader()
|
|
40
|
+
return {
|
|
41
|
+
async next() {
|
|
42
|
+
try {
|
|
43
|
+
const result = await reader.read()
|
|
44
|
+
if (result.done) {
|
|
45
|
+
reader.releaseLock()
|
|
46
|
+
}
|
|
47
|
+
return result
|
|
48
|
+
} catch (e) {
|
|
49
|
+
reader.releaseLock()
|
|
50
|
+
throw e
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
async return(value: T) {
|
|
54
|
+
if (!preventCancel) {
|
|
55
|
+
const cancelPromise = reader.cancel(value)
|
|
56
|
+
reader.releaseLock()
|
|
57
|
+
await cancelPromise
|
|
58
|
+
} else {
|
|
59
|
+
reader.releaseLock()
|
|
60
|
+
}
|
|
61
|
+
return { done: true, value }
|
|
62
|
+
},
|
|
63
|
+
[Symbol.asyncIterator]() {
|
|
64
|
+
return this
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function linesOf(input: Blob | ReadableStream): AsyncIterable<string> {
|
|
70
|
+
return readableStreamValues(
|
|
71
|
+
(input instanceof ReadableStream ? input : input.stream())
|
|
72
|
+
.pipeThrough(new TextDecoderStream())
|
|
73
|
+
.pipeThrough(new LinesTransform())
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const convertLineBased = <T>(
|
|
78
|
+
fn: (file: string, lines: AsyncIterable<string>) => Promise<T>
|
|
79
|
+
) => {
|
|
80
|
+
function converted(file: File): Promise<T>
|
|
81
|
+
function converted(file: string, input: Blob | ReadableStream): Promise<T>
|
|
82
|
+
function converted(
|
|
83
|
+
file: string | File,
|
|
84
|
+
input?: Blob | ReadableStream
|
|
85
|
+
): Promise<T> {
|
|
86
|
+
if (file instanceof File) return converted(file.name, file)
|
|
87
|
+
return fn(file, linesOf(input!))
|
|
88
|
+
}
|
|
89
|
+
return converted
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function chunksOf(input: Blob | ReadableStream): AsyncIterable<string> {
|
|
93
|
+
return readableStreamValues(
|
|
94
|
+
(input instanceof ReadableStream ? input : input.stream()).pipeThrough(
|
|
95
|
+
new TextDecoderStream()
|
|
96
|
+
)
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function parseFrcsSurveyFile(
|
|
101
|
+
file: File,
|
|
102
|
+
options?: ParseFrcsSurveyFileOptions
|
|
103
|
+
): Promise<FrcsSurveyFile | InvalidFrcsSurveyFile>
|
|
104
|
+
export function parseFrcsSurveyFile(
|
|
105
|
+
file: string,
|
|
106
|
+
input: Blob | ReadableStream<Uint8Array>,
|
|
107
|
+
options?: ParseFrcsSurveyFileOptions
|
|
108
|
+
): Promise<FrcsSurveyFile | InvalidFrcsSurveyFile>
|
|
109
|
+
export function parseFrcsSurveyFile(
|
|
110
|
+
file: string | File,
|
|
111
|
+
input?: Blob | ReadableStream<Uint8Array> | ParseFrcsSurveyFileOptions,
|
|
112
|
+
options?: ParseFrcsSurveyFileOptions
|
|
113
|
+
): Promise<FrcsSurveyFile | InvalidFrcsSurveyFile> {
|
|
114
|
+
if (file instanceof File)
|
|
115
|
+
return _parseFrcsSurveyFile(file.name, chunksOf(file), options)
|
|
116
|
+
if (input instanceof Blob || input instanceof ReadableStream) {
|
|
117
|
+
return _parseFrcsSurveyFile(file, chunksOf(input), options)
|
|
118
|
+
}
|
|
119
|
+
throw new Error(`input ust be a Blob or ReadableStream if file is not a File`)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const parseFrcsPlotFile = convertLineBased(_parseFrcsPlotFile)
|
|
123
|
+
export const parseFrcsTripSummaryFile = convertLineBased(
|
|
124
|
+
_parseFrcsTripSummaryFile
|
|
125
|
+
)
|
package/string/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export declare const parseFrcsSurveyFile: (file: string, str: string, rest_0?: import("../
|
|
1
|
+
export declare const parseFrcsSurveyFile: (file: string, str: string, rest_0?: import("../survey/FrcsSurveyFile").ParseFrcsSurveyFileOptions | undefined) => Promise<import("..").FrcsSurveyFile | import("../survey/FrcsSurveyFile").InvalidFrcsSurveyFile>;
|
|
2
2
|
export declare const parseFrcsPlotFile: (file: string, str: string) => Promise<import("..").FrcsPlotFile>;
|
|
3
3
|
export declare const parseFrcsTripSummaryFile: (file: string, str: string) => Promise<import("..").FrcsTripSummaryFile>;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/string/index.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,mBAAmB,SAHvB,MAAM,OAAO,MAAM,wLAG8C,CAAA;AAC1E,eAAO,MAAM,iBAAiB,SAfrB,MAAM,OAAO,MAAM,uCAeyC,CAAA;AACrE,eAAO,MAAM,wBAAwB,SAhB5B,MAAM,OAAO,MAAM,8CAkB3B,CAAA"}
|
package/string/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
9
9
|
var _wrapAsyncGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapAsyncGenerator"));
|
|
10
10
|
var _awaitAsyncGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/awaitAsyncGenerator"));
|
|
11
11
|
var _asyncGeneratorDelegate2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncGeneratorDelegate"));
|
|
12
|
-
var _parseFrcsSurveyFile2 = _interopRequireDefault(require("../parseFrcsSurveyFile.js"));
|
|
12
|
+
var _parseFrcsSurveyFile2 = _interopRequireDefault(require("../survey/parseFrcsSurveyFile.js"));
|
|
13
13
|
var _parseFrcsPlotFile2 = _interopRequireDefault(require("../parseFrcsPlotFile.js"));
|
|
14
14
|
var _parseFrcsTripSummaryFile2 = _interopRequireDefault(require("../parseFrcsTripSummaryFile.js"));
|
|
15
15
|
function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
|
|
@@ -31,7 +31,7 @@ function _linesOf() {
|
|
|
31
31
|
}));
|
|
32
32
|
return _linesOf.apply(this, arguments);
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var convertLineBased = function convertLineBased(fn) {
|
|
35
35
|
return function (file, str) {
|
|
36
36
|
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
37
37
|
rest[_key - 2] = arguments[_key];
|
|
@@ -39,6 +39,15 @@ var convert = function convert(fn) {
|
|
|
39
39
|
return fn.apply(void 0, [file, linesOf(str)].concat(rest));
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
var
|
|
42
|
+
var convertChunkBased = function convertChunkBased(fn) {
|
|
43
|
+
return function (file, str) {
|
|
44
|
+
for (var _len2 = arguments.length, rest = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
45
|
+
rest[_key2 - 2] = arguments[_key2];
|
|
46
|
+
}
|
|
47
|
+
return fn.apply(void 0, [file, [str]].concat(rest));
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
var parseFrcsSurveyFile = exports.parseFrcsSurveyFile = convertChunkBased(_parseFrcsSurveyFile2["default"]);
|
|
51
|
+
var parseFrcsPlotFile = exports.parseFrcsPlotFile = convertLineBased(_parseFrcsPlotFile2["default"]);
|
|
52
|
+
var parseFrcsTripSummaryFile = exports.parseFrcsTripSummaryFile = convertLineBased(_parseFrcsTripSummaryFile2["default"]);
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_parseFrcsSurveyFile2","_interopRequireDefault","require","_parseFrcsPlotFile2","_parseFrcsTripSummaryFile2","_asyncIterator","r","n","t","o","e","Symbol","asyncIterator","iterator","call","AsyncFromSyncIterator","TypeError","AsyncFromSyncIteratorContinuation","Object","Promise","reject","done","resolve","value","then","s","next","prototype","apply","arguments","_return","_throw","linesOf","_x","_linesOf","_wrapAsyncGenerator2","_regenerator","mark","_callee","wrap","_callee$","_context","prev","delegateYield","_asyncGeneratorDelegate2","split","_awaitAsyncGenerator2","stop","convertLineBased","fn","file","str","_len","length","rest","Array","_key","concat","convertChunkBased","_len2","_key2","parseFrcsSurveyFile","exports","_parseFrcsSurveyFile","parseFrcsPlotFile","_parseFrcsPlotFile","parseFrcsTripSummaryFile","_parseFrcsTripSummaryFile"],"sources":["../../src/string/index.ts"],"sourcesContent":["import _parseFrcsSurveyFile from '../survey/parseFrcsSurveyFile'\nimport _parseFrcsPlotFile from '../parseFrcsPlotFile'\nimport _parseFrcsTripSummaryFile from '../parseFrcsTripSummaryFile'\n\nasync function* linesOf(s: string): AsyncIterable<string> {\n yield* s.split(/\\r\\n?|\\n/gm)\n}\nconst convertLineBased =\n <T, Rest extends any[]>(\n fn: (\n file: string,\n lines: AsyncIterable<string>,\n ...rest: Rest\n ) => Promise<T>\n ) =>\n (file: string, str: string, ...rest: Rest): Promise<T> =>\n fn(file, linesOf(str), ...rest)\n\nconst convertChunkBased =\n <T, Rest extends any[]>(\n fn: (\n file: string,\n lines: Iterable<string> | AsyncIterable<string>,\n ...rest: Rest\n ) => Promise<T>\n ) =>\n (file: string, str: string, ...rest: Rest): Promise<T> =>\n fn(file, [str], ...rest)\n\nexport const parseFrcsSurveyFile = convertChunkBased(_parseFrcsSurveyFile)\nexport const parseFrcsPlotFile = convertLineBased(_parseFrcsPlotFile)\nexport const parseFrcsTripSummaryFile = convertLineBased(\n _parseFrcsTripSummaryFile\n)\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAmE,SAAAG,eAAAC,CAAA,QAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,iCAAAC,MAAA,KAAAH,CAAA,GAAAG,MAAA,CAAAC,aAAA,EAAAH,CAAA,GAAAE,MAAA,CAAAE,QAAA,GAAAH,CAAA,WAAAF,CAAA,aAAAD,CAAA,GAAAD,CAAA,CAAAE,CAAA,WAAAD,CAAA,CAAAO,IAAA,CAAAR,CAAA,OAAAG,CAAA,aAAAF,CAAA,GAAAD,CAAA,CAAAG,CAAA,eAAAM,qBAAA,CAAAR,CAAA,CAAAO,IAAA,CAAAR,CAAA,IAAAE,CAAA,sBAAAC,CAAA,6BAAAO,SAAA;AAAA,SAAAD,sBAAAT,CAAA,aAAAW,kCAAAX,CAAA,QAAAY,MAAA,CAAAZ,CAAA,MAAAA,CAAA,SAAAa,OAAA,CAAAC,MAAA,KAAAJ,SAAA,CAAAV,CAAA,+BAAAC,CAAA,GAAAD,CAAA,CAAAe,IAAA,SAAAF,OAAA,C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ACtDmB,qCACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { ParseIssue } from '../ParseIssue';
|
|
2
|
+
import { SourceLoc } from '../SourceLoc';
|
|
3
|
+
import { Unit, Length, Angle, UnitizedNumber } from '@speleotica/unitized';
|
|
4
|
+
type Invalid<T> = {
|
|
5
|
+
INVALID: T;
|
|
6
|
+
/**
|
|
7
|
+
* An array of indexes of issues in {@link InvalidFrcsSurveyFile['issues']} within the
|
|
8
|
+
* `INVALID` node
|
|
9
|
+
*/
|
|
10
|
+
issues?: number[];
|
|
11
|
+
};
|
|
12
|
+
type Prettify<T> = {
|
|
13
|
+
[K in keyof T]: T[K];
|
|
14
|
+
} & {};
|
|
15
|
+
type Replace<T, U> = Prettify<Omit<T, keyof U> & U>;
|
|
16
|
+
export type FrcsSurveyFile = {
|
|
17
|
+
cave?: string;
|
|
18
|
+
columns?: FrcsShotColumnConfig;
|
|
19
|
+
location?: string;
|
|
20
|
+
comment?: string;
|
|
21
|
+
trips: FrcsTrip[];
|
|
22
|
+
locs?: {
|
|
23
|
+
cave?: SourceLoc;
|
|
24
|
+
location?: SourceLoc;
|
|
25
|
+
comment?: SourceLoc;
|
|
26
|
+
};
|
|
27
|
+
issues?: ParseIssue[];
|
|
28
|
+
};
|
|
29
|
+
export type FrcsShotColumnConfig = {
|
|
30
|
+
toStation: number;
|
|
31
|
+
fromStation: number;
|
|
32
|
+
distance: number;
|
|
33
|
+
distanceFeet: number;
|
|
34
|
+
distanceInches: number;
|
|
35
|
+
kind: number;
|
|
36
|
+
exclude: number;
|
|
37
|
+
frontsightAzimuth: number;
|
|
38
|
+
backsightAzimuth: number;
|
|
39
|
+
frontsightInclination: number;
|
|
40
|
+
backsightInclination: number;
|
|
41
|
+
left: number;
|
|
42
|
+
right: number;
|
|
43
|
+
up: number;
|
|
44
|
+
down: number;
|
|
45
|
+
};
|
|
46
|
+
export type InvalidFrcsSurveyFile = {
|
|
47
|
+
INVALID: Replace<FrcsSurveyFile, {
|
|
48
|
+
trips: (FrcsTrip | InvalidFrcsTrip)[];
|
|
49
|
+
}>;
|
|
50
|
+
issues: ParseIssue[];
|
|
51
|
+
};
|
|
52
|
+
export type FrcsUnits = {
|
|
53
|
+
distanceUnit: Unit<Length>;
|
|
54
|
+
azimuthUnit: Unit<Angle>;
|
|
55
|
+
inclinationUnit: Unit<Angle>;
|
|
56
|
+
backsightAzimuthCorrected?: boolean;
|
|
57
|
+
backsightInclinationCorrected?: boolean;
|
|
58
|
+
hasBacksightAzimuth?: boolean;
|
|
59
|
+
hasBacksightInclination?: boolean;
|
|
60
|
+
loc?: SourceLoc;
|
|
61
|
+
locs?: {
|
|
62
|
+
distanceUnit?: SourceLoc;
|
|
63
|
+
azimuthUnit?: SourceLoc;
|
|
64
|
+
inclinationUnit?: SourceLoc;
|
|
65
|
+
backsightAzimuthCorrected?: SourceLoc;
|
|
66
|
+
backsightInclinationCorrected?: SourceLoc;
|
|
67
|
+
hasBacksightAzimuth?: SourceLoc;
|
|
68
|
+
hasBacksightInclination?: SourceLoc;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export type InvalidFrcsUnits = Invalid<Partial<FrcsUnits>>;
|
|
72
|
+
export type FrcsTripHeader = {
|
|
73
|
+
name: string;
|
|
74
|
+
comment?: string;
|
|
75
|
+
section?: string;
|
|
76
|
+
date?: Date;
|
|
77
|
+
team?: string[];
|
|
78
|
+
loc?: SourceLoc;
|
|
79
|
+
locs?: {
|
|
80
|
+
name: SourceLoc;
|
|
81
|
+
comment?: SourceLoc;
|
|
82
|
+
section?: SourceLoc;
|
|
83
|
+
date?: SourceLoc;
|
|
84
|
+
team?: SourceLoc[];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export type InvalidFrcsTripHeader = Invalid<Partial<FrcsTripHeader>>;
|
|
88
|
+
export type FrcsTrip = {
|
|
89
|
+
tripNumber: number;
|
|
90
|
+
header: FrcsTripHeader;
|
|
91
|
+
units: FrcsUnits;
|
|
92
|
+
shots: FrcsShot[];
|
|
93
|
+
loc?: SourceLoc;
|
|
94
|
+
};
|
|
95
|
+
export type InvalidFrcsTrip = Invalid<Replace<FrcsTrip, {
|
|
96
|
+
tripNumber?: number;
|
|
97
|
+
header: FrcsTripHeader | InvalidFrcsTripHeader;
|
|
98
|
+
units: FrcsUnits | InvalidFrcsUnits;
|
|
99
|
+
shots: (FrcsShot | InvalidFrcsShot)[];
|
|
100
|
+
}>>;
|
|
101
|
+
export type FrcsShotBase = {
|
|
102
|
+
/**
|
|
103
|
+
* Name of from station
|
|
104
|
+
*/
|
|
105
|
+
from: string;
|
|
106
|
+
/**
|
|
107
|
+
* Name of to station
|
|
108
|
+
*/
|
|
109
|
+
to?: string;
|
|
110
|
+
specialKind?: 'horizontal' | 'diagonal';
|
|
111
|
+
distance: UnitizedNumber<Length>;
|
|
112
|
+
horizontalDistance?: UnitizedNumber<Length>;
|
|
113
|
+
verticalDistance?: UnitizedNumber<Length>;
|
|
114
|
+
frontsightAzimuth?: UnitizedNumber<Angle>;
|
|
115
|
+
frontsightInclination?: UnitizedNumber<Angle>;
|
|
116
|
+
backsightAzimuth?: UnitizedNumber<Angle>;
|
|
117
|
+
backsightInclination?: UnitizedNumber<Angle>;
|
|
118
|
+
/**
|
|
119
|
+
* LRUDs at from station
|
|
120
|
+
*/
|
|
121
|
+
fromLruds?: {
|
|
122
|
+
left?: UnitizedNumber<Length>;
|
|
123
|
+
right?: UnitizedNumber<Length>;
|
|
124
|
+
up?: UnitizedNumber<Length>;
|
|
125
|
+
down?: UnitizedNumber<Length>;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* LRUDs at to station
|
|
129
|
+
*/
|
|
130
|
+
toLruds?: {
|
|
131
|
+
left?: UnitizedNumber<Length>;
|
|
132
|
+
right?: UnitizedNumber<Length>;
|
|
133
|
+
up?: UnitizedNumber<Length>;
|
|
134
|
+
down?: UnitizedNumber<Length>;
|
|
135
|
+
};
|
|
136
|
+
excludeDistance?: boolean;
|
|
137
|
+
isSplay?: boolean;
|
|
138
|
+
comment?: string;
|
|
139
|
+
loc?: SourceLoc;
|
|
140
|
+
locs?: {
|
|
141
|
+
comment?: SourceLoc;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
export type FrcsShot = FrcsShotBase & {
|
|
145
|
+
/**
|
|
146
|
+
* In the edge case that the surveyors changed measurement units or
|
|
147
|
+
* corrected/uncorrected backsights in the middle of a trip, the measurements
|
|
148
|
+
* will be normalized to the initial trip settings, and this field will contain
|
|
149
|
+
* the actual values recorded, verbatim. The first shot of the group with
|
|
150
|
+
* changed units will include the changed units.
|
|
151
|
+
*/
|
|
152
|
+
recorded?: FrcsShotBase & {
|
|
153
|
+
units?: FrcsUnits;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export type InvalidFrcsShot = Invalid<Partial<Replace<FrcsShot, {
|
|
157
|
+
recorded?: FrcsShot['recorded'] | Invalid<Partial<FrcsShotBase> & {
|
|
158
|
+
units?: InvalidFrcsUnits;
|
|
159
|
+
}>;
|
|
160
|
+
}>>>;
|
|
161
|
+
export declare const defaultFrcsShotColumnConfig: FrcsShotColumnConfig;
|
|
162
|
+
export type ParseFrcsSurveyFileOptions = {
|
|
163
|
+
columns?: FrcsShotColumnConfig;
|
|
164
|
+
outputColumns?: boolean;
|
|
165
|
+
normalizeNames?: boolean;
|
|
166
|
+
suppressWarnings?: boolean | {
|
|
167
|
+
missingTripTeam?: boolean;
|
|
168
|
+
missingTripDate?: boolean;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
export {};
|
|
172
|
+
//# sourceMappingURL=FrcsSurveyFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsSurveyFile.d.ts","sourceRoot":"","sources":["../../src/survey/FrcsSurveyFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,S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,CACL,QAAQ,EACR;IACE,QAAQ,CAAC,EACL,QAAQ,CAAC,UAAU,CAAC,GACpB,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,CAAA;CAClE,CACF,CACF,CACF,CAAA;AAED,eAAO,MAAM,2BAA2B,EAAE,oBAgBzC,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,CAAC,EAAE,oBAAoB,CAAA;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gBAAgB,CAAC,EACb,OAAO,GACP;QACE,eAAe,CAAC,EAAE,OAAO,CAAA;QACzB,eAAe,CAAC,EAAE,OAAO,CAAA;KAC1B,CAAA;CACN,CAAA"}
|
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.defaultFrcsShotColumnConfig = void 0;
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
8
|
+
|
|
7
9
|
var defaultFrcsShotColumnConfig = exports.defaultFrcsShotColumnConfig = {
|
|
8
10
|
toStation: 5,
|
|
9
11
|
fromStation: 5,
|
|
@@ -20,4 +22,5 @@ var defaultFrcsShotColumnConfig = exports.defaultFrcsShotColumnConfig = {
|
|
|
20
22
|
right: 3,
|
|
21
23
|
up: 3,
|
|
22
24
|
down: 3
|
|
23
|
-
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=FrcsSurveyFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsSurveyFile.js","names":["defaultFrcsShotColumnConfig","exports","toStation","fromStation","distance","distanceFeet","distanceInches","kind","exclude","frontsightAzimuth","backsightAzimuth","frontsightInclination","backsightInclination","left","right","up","down"],"sources":["../../src/survey/FrcsSurveyFile.ts"],"sourcesContent":["import { ParseIssue } from '../ParseIssue'\nimport { SourceLoc } from '../SourceLoc'\nimport { Unit, Length, Angle, UnitizedNumber } from '@speleotica/unitized'\n\ntype Invalid<T> = {\n INVALID: T\n /**\n * An array of indexes of issues in {@link InvalidFrcsSurveyFile['issues']} within the\n * `INVALID` node\n */\n issues?: number[]\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\ntype Prettify<T> = { [K in keyof T]: T[K] } & {}\n\ntype Replace<T, U> = Prettify<Omit<T, keyof U> & U>\n\nexport type FrcsSurveyFile = {\n cave?: string\n columns?: FrcsShotColumnConfig\n location?: string\n comment?: string\n trips: FrcsTrip[]\n locs?: {\n cave?: SourceLoc\n location?: SourceLoc\n comment?: SourceLoc\n }\n issues?: ParseIssue[]\n}\n\nexport type FrcsShotColumnConfig = {\n toStation: number\n fromStation: number\n distance: number\n distanceFeet: number\n distanceInches: number\n kind: number\n exclude: number\n frontsightAzimuth: number\n backsightAzimuth: number\n frontsightInclination: number\n backsightInclination: number\n left: number\n right: number\n up: number\n down: number\n}\n\nexport type InvalidFrcsSurveyFile = {\n INVALID: Replace<\n FrcsSurveyFile,\n {\n trips: (FrcsTrip | InvalidFrcsTrip)[]\n }\n >\n issues: ParseIssue[]\n}\n\nexport type FrcsUnits = {\n distanceUnit: Unit<Length>\n azimuthUnit: Unit<Angle>\n inclinationUnit: Unit<Angle>\n backsightAzimuthCorrected?: boolean\n backsightInclinationCorrected?: boolean\n hasBacksightAzimuth?: boolean\n hasBacksightInclination?: boolean\n loc?: SourceLoc\n locs?: {\n distanceUnit?: SourceLoc\n azimuthUnit?: SourceLoc\n inclinationUnit?: SourceLoc\n backsightAzimuthCorrected?: SourceLoc\n backsightInclinationCorrected?: SourceLoc\n hasBacksightAzimuth?: SourceLoc\n hasBacksightInclination?: SourceLoc\n }\n}\n\nexport type InvalidFrcsUnits = Invalid<Partial<FrcsUnits>>\n\nexport type FrcsTripHeader = {\n name: string\n comment?: string\n section?: string\n date?: Date\n team?: string[]\n loc?: SourceLoc\n locs?: {\n name: SourceLoc\n comment?: SourceLoc\n section?: SourceLoc\n date?: SourceLoc\n team?: SourceLoc[]\n }\n}\n\nexport type InvalidFrcsTripHeader = Invalid<Partial<FrcsTripHeader>>\n\nexport type FrcsTrip = {\n tripNumber: number\n header: FrcsTripHeader\n units: FrcsUnits\n shots: FrcsShot[]\n loc?: SourceLoc\n}\n\nexport type InvalidFrcsTrip = Invalid<\n Replace<\n FrcsTrip,\n {\n tripNumber?: number\n header: FrcsTripHeader | InvalidFrcsTripHeader\n units: FrcsUnits | InvalidFrcsUnits\n shots: (FrcsShot | InvalidFrcsShot)[]\n }\n >\n>\n\nexport type FrcsShotBase = {\n /**\n * Name of from station\n */\n from: string\n /**\n * Name of to station\n */\n to?: string\n specialKind?: 'horizontal' | 'diagonal'\n distance: UnitizedNumber<Length>\n horizontalDistance?: UnitizedNumber<Length>\n verticalDistance?: UnitizedNumber<Length>\n frontsightAzimuth?: UnitizedNumber<Angle>\n frontsightInclination?: UnitizedNumber<Angle>\n backsightAzimuth?: UnitizedNumber<Angle>\n backsightInclination?: UnitizedNumber<Angle>\n /**\n * LRUDs at from station\n */\n fromLruds?: {\n left?: UnitizedNumber<Length>\n right?: UnitizedNumber<Length>\n up?: UnitizedNumber<Length>\n down?: UnitizedNumber<Length>\n }\n /**\n * LRUDs at to station\n */\n toLruds?: {\n left?: UnitizedNumber<Length>\n right?: UnitizedNumber<Length>\n up?: UnitizedNumber<Length>\n down?: UnitizedNumber<Length>\n }\n excludeDistance?: boolean\n isSplay?: boolean\n comment?: string\n loc?: SourceLoc\n locs?: {\n comment?: SourceLoc\n }\n}\n\nexport type FrcsShot = FrcsShotBase & {\n /**\n * In the edge case that the surveyors changed measurement units or\n * corrected/uncorrected backsights in the middle of a trip, the measurements\n * will be normalized to the initial trip settings, and this field will contain\n * the actual values recorded, verbatim. The first shot of the group with\n * changed units will include the changed units.\n */\n recorded?: FrcsShotBase & { units?: FrcsUnits }\n}\n\nexport type InvalidFrcsShot = Invalid<\n Partial<\n Replace<\n FrcsShot,\n {\n recorded?:\n | FrcsShot['recorded']\n | Invalid<Partial<FrcsShotBase> & { units?: InvalidFrcsUnits }>\n }\n >\n >\n>\n\nexport const defaultFrcsShotColumnConfig: FrcsShotColumnConfig = {\n toStation: 5,\n fromStation: 5,\n distance: 6,\n distanceFeet: 4,\n distanceInches: 3,\n kind: 1,\n exclude: 1,\n frontsightAzimuth: 6,\n backsightAzimuth: 6,\n frontsightInclination: 5,\n backsightInclination: 5,\n left: 3,\n right: 3,\n up: 3,\n down: 3,\n}\n\nexport type ParseFrcsSurveyFileOptions = {\n columns?: FrcsShotColumnConfig\n outputColumns?: boolean\n normalizeNames?: boolean\n suppressWarnings?:\n | boolean\n | {\n missingTripTeam?: boolean\n missingTripDate?: boolean\n }\n}\n"],"mappings":";;;;;;AAaA;;AA+KO,IAAMA,2BAAiD,GAAAC,OAAA,CAAAD,2BAAA,GAAG;EAC/DE,SAAS,EAAE,CAAC;EACZC,WAAW,EAAE,CAAC;EACdC,QAAQ,EAAE,CAAC;EACXC,YAAY,EAAE,CAAC;EACfC,cAAc,EAAE,CAAC;EACjBC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,CAAC;EACVC,iBAAiB,EAAE,CAAC;EACpBC,gBAAgB,EAAE,CAAC;EACnBC,qBAAqB,EAAE,CAAC;EACxBC,oBAAoB,EAAE,CAAC;EACvBC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,EAAE,EAAE,CAAC;EACLC,IAAI,EAAE;AACR,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FrcsSurveyFile, InvalidFrcsSurveyFile, ParseFrcsSurveyFileOptions } from './FrcsSurveyFile';
|
|
2
|
+
import { Unit, Length, Angle, UnitizedNumber } from '@speleotica/unitized';
|
|
3
|
+
import { ParseIssue } from '../ParseIssue';
|
|
4
|
+
import { SourceLoc } from '../SourceLoc';
|
|
5
|
+
export type JsonLengthUnit = 'm' | 'km' | 'cm' | 'ft' | 'mi' | 'yd' | 'in';
|
|
6
|
+
export type JsonAngleUnit = 'rad' | 'deg' | 'grad' | 'mil' | '%';
|
|
7
|
+
export type JsonLength = [number, JsonLengthUnit];
|
|
8
|
+
export type JsonAngle = [number, JsonAngleUnit];
|
|
9
|
+
export type DeepMapJson<T> = T extends string | number | boolean | undefined | ParseIssue | SourceLoc ? T : T extends Date ? string : T extends readonly (infer E)[] ? DeepMapJson<E>[] : T extends Unit<Length> ? JsonLengthUnit : T extends Unit<Angle> ? JsonAngleUnit : T extends UnitizedNumber<Length> ? JsonLength : T extends UnitizedNumber<Angle> ? JsonAngle : {
|
|
10
|
+
[K in keyof T]: DeepMapJson<T[K]>;
|
|
11
|
+
};
|
|
12
|
+
export type FrcsSurveyFileJson = DeepMapJson<FrcsSurveyFile>;
|
|
13
|
+
export type InvalidFrcsSurveyFileJson = DeepMapJson<InvalidFrcsSurveyFile>;
|
|
14
|
+
export type ParseFrcsSurveyFileOptionsJson = DeepMapJson<ParseFrcsSurveyFileOptions>;
|
|
15
|
+
//# sourceMappingURL=FrcsSurveyFileJson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsSurveyFileJson.d.ts","sourceRoot":"","sources":["../../src/survey/FrcsSurveyFileJson.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAC1E,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,GAAG,CAAA;AAEhE,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AACjD,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAE/C,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAC1B,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,GACT,UAAU,GACV,SAAS,GACT,CAAC,GACD,CAAC,SAAS,IAAI,GACd,MAAM,GACN,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC9B,WAAW,CAAC,CAAC,CAAC,EAAE,GAChB,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,GACtB,cAAc,GACd,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,GACrB,aAAa,GACb,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,GAChC,UAAU,GACV,CAAC,SAAS,cAAc,CAAC,KAAK,CAAC,GAC/B,SAAS,GACT;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAA;AAEL,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAE5D,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAA;AAE1E,MAAM,MAAM,8BAA8B,GACxC,WAAW,CAAC,0BAA0B,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsSurveyFileJson.js","names":[],"sources":["../../src/survey/FrcsSurveyFileJson.ts"],"sourcesContent":["import {\n FrcsSurveyFile,\n InvalidFrcsSurveyFile,\n ParseFrcsSurveyFileOptions,\n} from './FrcsSurveyFile'\n\nimport { Unit, Length, Angle, UnitizedNumber } from '@speleotica/unitized'\nimport { ParseIssue } from '../ParseIssue'\nimport { SourceLoc } from '../SourceLoc'\n\nexport type JsonLengthUnit = 'm' | 'km' | 'cm' | 'ft' | 'mi' | 'yd' | 'in'\nexport type JsonAngleUnit = 'rad' | 'deg' | 'grad' | 'mil' | '%'\n\nexport type JsonLength = [number, JsonLengthUnit]\nexport type JsonAngle = [number, JsonAngleUnit]\n\nexport type DeepMapJson<T> = T extends\n | string\n | number\n | boolean\n | undefined\n | ParseIssue\n | SourceLoc\n ? T\n : T extends Date\n ? string\n : T extends readonly (infer E)[]\n ? DeepMapJson<E>[]\n : T extends Unit<Length>\n ? JsonLengthUnit\n : T extends Unit<Angle>\n ? JsonAngleUnit\n : T extends UnitizedNumber<Length>\n ? JsonLength\n : T extends UnitizedNumber<Angle>\n ? JsonAngle\n : {\n [K in keyof T]: DeepMapJson<T[K]>\n }\n\nexport type FrcsSurveyFileJson = DeepMapJson<FrcsSurveyFile>\n\nexport type InvalidFrcsSurveyFileJson = DeepMapJson<InvalidFrcsSurveyFile>\n\nexport type ParseFrcsSurveyFileOptionsJson =\n DeepMapJson<ParseFrcsSurveyFileOptions>\n"],"mappings":"","ignoreList":[]}
|