@speleotica/frcsdata 4.3.1 → 5.0.0-beta.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/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 +37 -0
- package/chunksToLines.js.map +1 -0
- package/cli/check-survey-correspondence.d.ts +2 -0
- package/cli/check-survey-correspondence.d.ts.map +1 -0
- package/cli/check-survey-correspondence.js +44 -0
- package/cli/check-survey-correspondence.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 +27 -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 +15 -0
- package/cli/parse-survey.js.map +1 -0
- package/cli/summarize-survey.d.ts +2 -0
- package/cli/summarize-survey.d.ts.map +1 -0
- package/cli/summarize-survey.js +33 -0
- package/cli/summarize-survey.js.map +1 -0
- package/cli.d.ts +2 -0
- package/cli.d.ts.map +1 -0
- package/cli.js +72 -0
- package/cli.js.map +1 -0
- package/formatFrcsTripSummaryFile.d.ts +3 -0
- package/formatFrcsTripSummaryFile.d.ts.map +1 -0
- package/formatFrcsTripSummaryFile.js +33 -0
- package/formatFrcsTripSummaryFile.js.map +1 -0
- package/formatIssues.d.ts +10 -0
- package/formatIssues.d.ts.map +1 -0
- package/formatIssues.js +52 -0
- package/formatIssues.js.map +1 -0
- package/index.d.ts +5 -7
- package/index.d.ts.map +1 -1
- package/index.js +16 -49
- package/index.js.map +1 -1
- package/node/index.d.ts +4 -2
- package/node/index.d.ts.map +1 -1
- package/node/index.js +6 -12
- package/node/index.js.map +1 -1
- package/package.json +8 -6
- package/parseFrcsPlotFile.js +112 -245
- package/parseFrcsPlotFile.js.map +1 -1
- package/parseFrcsTripSummaryFile.d.ts +3 -1
- package/parseFrcsTripSummaryFile.d.ts.map +1 -1
- package/parseFrcsTripSummaryFile.js +53 -119
- package/parseFrcsTripSummaryFile.js.map +1 -1
- package/src/ParseIssue.ts +19 -0
- package/src/SourceLoc.ts +13 -0
- package/src/chunksToLines.ts +26 -0
- package/src/cli/check-survey-correspondence.ts +49 -0
- package/src/cli/check-survey.ts +23 -0
- package/src/cli/parse-survey.ts +10 -0
- package/src/cli/summarize-survey.ts +28 -0
- package/src/cli.ts +63 -0
- package/src/formatFrcsTripSummaryFile.ts +45 -0
- package/src/formatIssues.ts +97 -0
- package/src/index.ts +9 -7
- package/src/node/index.ts +18 -5
- package/src/parseFrcsTripSummaryFile.ts +8 -2
- package/src/string/index.ts +18 -5
- 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/{formatFrcsShot.ts → survey/formatFrcsShot.ts} +39 -22
- package/src/{formatFrcsSurveyFile.ts → survey/formatFrcsSurveyFile.ts} +4 -5
- package/src/survey/getColumnRanges.ts +82 -0
- package/src/survey/normalizeTeamMemberName.ts +7 -0
- package/src/survey/parseFrcsSurveyFile.ts +848 -0
- package/src/survey/parsers.ts +128 -0
- package/src/survey/summarizeSurvey.ts +51 -0
- package/src/survey/validators.ts +24 -0
- package/src/underlineSource.ts +34 -0
- package/src/unwrapInvalid.ts +3 -0
- package/src/web/index.ts +27 -21
- package/string/index.d.ts +4 -2
- package/string/index.d.ts.map +1 -1
- package/string/index.js +8 -34
- package/string/index.js.map +1 -1
- package/survey/FrcsSurveyFile.d.ts +172 -0
- package/survey/FrcsSurveyFile.d.ts.map +1 -0
- package/{FrcsSurveyFile.js → survey/FrcsSurveyFile.js} +3 -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} +1 -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 +186 -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 +209 -0
- package/survey/ZodFrcsSurveyFileToJson.js.map +1 -0
- package/{formatFrcsShot.d.ts → survey/formatFrcsShot.d.ts} +2 -3
- package/survey/formatFrcsShot.d.ts.map +1 -0
- package/survey/formatFrcsShot.js +107 -0
- package/survey/formatFrcsShot.js.map +1 -0
- package/survey/formatFrcsSurveyFile.d.ts +3 -0
- package/survey/formatFrcsSurveyFile.d.ts.map +1 -0
- package/survey/formatFrcsSurveyFile.js +87 -0
- 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 +62 -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 +12 -0
- package/survey/normalizeTeamMemberName.js.map +1 -0
- package/{parseFrcsSurveyFile.d.ts → survey/parseFrcsSurveyFile.d.ts} +2 -5
- package/survey/parseFrcsSurveyFile.d.ts.map +1 -0
- package/survey/parseFrcsSurveyFile.js +626 -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/summarizeSurvey.d.ts +6 -0
- package/survey/summarizeSurvey.d.ts.map +1 -0
- package/survey/summarizeSurvey.js +58 -0
- package/survey/summarizeSurvey.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 +22 -0
- package/underlineSource.js.map +1 -0
- package/unwrapInvalid.d.ts +4 -0
- package/unwrapInvalid.d.ts.map +1 -0
- package/unwrapInvalid.js +10 -0
- package/unwrapInvalid.js.map +1 -0
- package/web/index.d.ts +6 -6
- package/web/index.d.ts.map +1 -1
- package/web/index.js +60 -118
- package/web/index.js.map +1 -1
- package/FrcsShot.d.ts +0 -57
- package/FrcsShot.d.ts.map +0 -1
- package/FrcsShot.js +0 -13
- package/FrcsShot.js.map +0 -1
- package/FrcsSurveyFile.d.ts +0 -29
- package/FrcsSurveyFile.d.ts.map +0 -1
- package/FrcsSurveyFile.js.map +0 -1
- package/FrcsTrip.d.ts +0 -23
- package/FrcsTrip.d.ts.map +0 -1
- package/FrcsTrip.js.map +0 -1
- package/formatFrcsShot.d.ts.map +0 -1
- package/formatFrcsShot.js +0 -96
- package/formatFrcsShot.js.map +0 -1
- package/formatFrcsSurveyFile.d.ts +0 -3
- package/formatFrcsSurveyFile.d.ts.map +0 -1
- package/formatFrcsSurveyFile.js +0 -165
- package/formatFrcsSurveyFile.js.map +0 -1
- package/parseFrcsSurveyFile.d.ts.map +0 -1
- package/parseFrcsSurveyFile.js +0 -812
- package/parseFrcsSurveyFile.js.map +0 -1
- package/src/FrcsShot.ts +0 -56
- package/src/FrcsSurveyFile.ts +0 -47
- package/src/FrcsTrip.ts +0 -25
- package/src/parseFrcsSurveyFile.ts +0 -788
package/ParseIssue.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { SourceLoc } from './SourceLoc';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
export declare const ParseIssueSeverity: z.ZodEnum<["error", "warning"]>;
|
|
4
|
+
export type ParseIssueSeverity = z.output<typeof ParseIssueSeverity>;
|
|
5
|
+
export declare const ParseIssue: z.ZodObject<{
|
|
6
|
+
type: z.ZodEnum<["error", "warning"]>;
|
|
7
|
+
code: z.ZodString;
|
|
8
|
+
message: z.ZodOptional<z.ZodString>;
|
|
9
|
+
loc: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
start: z.ZodObject<{
|
|
11
|
+
line: z.ZodNumber;
|
|
12
|
+
column: z.ZodNumber;
|
|
13
|
+
index: z.ZodNumber;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
line: number;
|
|
16
|
+
column: number;
|
|
17
|
+
index: number;
|
|
18
|
+
}, {
|
|
19
|
+
line: number;
|
|
20
|
+
column: number;
|
|
21
|
+
index: number;
|
|
22
|
+
}>;
|
|
23
|
+
end: z.ZodObject<{
|
|
24
|
+
line: z.ZodNumber;
|
|
25
|
+
column: z.ZodNumber;
|
|
26
|
+
index: z.ZodNumber;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
line: number;
|
|
29
|
+
column: number;
|
|
30
|
+
index: number;
|
|
31
|
+
}, {
|
|
32
|
+
line: number;
|
|
33
|
+
column: number;
|
|
34
|
+
index: number;
|
|
35
|
+
}>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
start: {
|
|
38
|
+
line: number;
|
|
39
|
+
column: number;
|
|
40
|
+
index: number;
|
|
41
|
+
};
|
|
42
|
+
end: {
|
|
43
|
+
line: number;
|
|
44
|
+
column: number;
|
|
45
|
+
index: number;
|
|
46
|
+
};
|
|
47
|
+
}, {
|
|
48
|
+
start: {
|
|
49
|
+
line: number;
|
|
50
|
+
column: number;
|
|
51
|
+
index: number;
|
|
52
|
+
};
|
|
53
|
+
end: {
|
|
54
|
+
line: number;
|
|
55
|
+
column: number;
|
|
56
|
+
index: number;
|
|
57
|
+
};
|
|
58
|
+
}>>;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
code: string;
|
|
61
|
+
type: "error" | "warning";
|
|
62
|
+
message?: string | undefined;
|
|
63
|
+
loc?: {
|
|
64
|
+
start: {
|
|
65
|
+
line: number;
|
|
66
|
+
column: number;
|
|
67
|
+
index: number;
|
|
68
|
+
};
|
|
69
|
+
end: {
|
|
70
|
+
line: number;
|
|
71
|
+
column: number;
|
|
72
|
+
index: number;
|
|
73
|
+
};
|
|
74
|
+
} | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
code: string;
|
|
77
|
+
type: "error" | "warning";
|
|
78
|
+
message?: string | undefined;
|
|
79
|
+
loc?: {
|
|
80
|
+
start: {
|
|
81
|
+
line: number;
|
|
82
|
+
column: number;
|
|
83
|
+
index: number;
|
|
84
|
+
};
|
|
85
|
+
end: {
|
|
86
|
+
line: number;
|
|
87
|
+
column: number;
|
|
88
|
+
index: number;
|
|
89
|
+
};
|
|
90
|
+
} | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
export type ParseIssue = {
|
|
93
|
+
type: ParseIssueSeverity;
|
|
94
|
+
code: string;
|
|
95
|
+
message?: string;
|
|
96
|
+
loc?: SourceLoc;
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=ParseIssue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParseIssue.d.ts","sourceRoot":"","sources":["src/ParseIssue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,eAAO,MAAM,kBAAkB,iCAA+B,CAAA;AAC9D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEpE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKrB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,kBAAkB,CAAA;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,SAAS,CAAA;CAChB,CAAA"}
|
package/ParseIssue.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ParseIssueSeverity = exports.ParseIssue = void 0;
|
|
8
|
+
var _SourceLoc = require("./SourceLoc.js");
|
|
9
|
+
var _zod = _interopRequireDefault(require("zod"));
|
|
10
|
+
const ParseIssueSeverity = exports.ParseIssueSeverity = _zod.default.enum(['error', 'warning']);
|
|
11
|
+
const ParseIssue = exports.ParseIssue = _zod.default.strictObject({
|
|
12
|
+
type: ParseIssueSeverity,
|
|
13
|
+
code: _zod.default.string().nonempty(),
|
|
14
|
+
message: _zod.default.string().optional(),
|
|
15
|
+
loc: _SourceLoc.SourceLoc.optional()
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=ParseIssue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParseIssue.js","names":["_SourceLoc","require","_zod","_interopRequireDefault","ParseIssueSeverity","exports","z","enum","ParseIssue","strictObject","type","code","string","nonempty","message","optional","loc","SourceLoc"],"sources":["src/ParseIssue.ts"],"sourcesContent":["import { SourceLoc } from './SourceLoc'\nimport z from 'zod'\n\nexport const ParseIssueSeverity = z.enum(['error', 'warning'])\nexport type ParseIssueSeverity = z.output<typeof ParseIssueSeverity>\n\nexport const ParseIssue = z.strictObject({\n type: ParseIssueSeverity,\n code: z.string().nonempty(),\n message: z.string().optional(),\n loc: SourceLoc.optional(),\n})\n\nexport type ParseIssue = {\n type: ParseIssueSeverity\n code: string\n message?: string\n loc?: SourceLoc\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEO,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,YAAC,CAACC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAGvD,MAAMC,UAAU,GAAAH,OAAA,CAAAG,UAAA,GAAGF,YAAC,CAACG,YAAY,CAAC;EACvCC,IAAI,EAAEN,kBAAkB;EACxBO,IAAI,EAAEL,YAAC,CAACM,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC3BC,OAAO,EAAER,YAAC,CAACM,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAC9BC,GAAG,EAAEC,oBAAS,CAACF,QAAQ,CAAC;AAC1B,CAAC,CAAC","ignoreList":[]}
|
package/SourceLoc.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const SourcePos: z.ZodObject<{
|
|
3
|
+
line: z.ZodNumber;
|
|
4
|
+
column: z.ZodNumber;
|
|
5
|
+
index: z.ZodNumber;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
line: number;
|
|
8
|
+
column: number;
|
|
9
|
+
index: number;
|
|
10
|
+
}, {
|
|
11
|
+
line: number;
|
|
12
|
+
column: number;
|
|
13
|
+
index: number;
|
|
14
|
+
}>;
|
|
15
|
+
export type SourcePos = z.output<typeof SourcePos>;
|
|
16
|
+
export declare const SourceLoc: z.ZodObject<{
|
|
17
|
+
start: z.ZodObject<{
|
|
18
|
+
line: z.ZodNumber;
|
|
19
|
+
column: z.ZodNumber;
|
|
20
|
+
index: z.ZodNumber;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
line: number;
|
|
23
|
+
column: number;
|
|
24
|
+
index: number;
|
|
25
|
+
}, {
|
|
26
|
+
line: number;
|
|
27
|
+
column: number;
|
|
28
|
+
index: number;
|
|
29
|
+
}>;
|
|
30
|
+
end: z.ZodObject<{
|
|
31
|
+
line: z.ZodNumber;
|
|
32
|
+
column: z.ZodNumber;
|
|
33
|
+
index: z.ZodNumber;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
line: number;
|
|
36
|
+
column: number;
|
|
37
|
+
index: number;
|
|
38
|
+
}, {
|
|
39
|
+
line: number;
|
|
40
|
+
column: number;
|
|
41
|
+
index: number;
|
|
42
|
+
}>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
start: {
|
|
45
|
+
line: number;
|
|
46
|
+
column: number;
|
|
47
|
+
index: number;
|
|
48
|
+
};
|
|
49
|
+
end: {
|
|
50
|
+
line: number;
|
|
51
|
+
column: number;
|
|
52
|
+
index: number;
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
start: {
|
|
56
|
+
line: number;
|
|
57
|
+
column: number;
|
|
58
|
+
index: number;
|
|
59
|
+
};
|
|
60
|
+
end: {
|
|
61
|
+
line: number;
|
|
62
|
+
column: number;
|
|
63
|
+
index: number;
|
|
64
|
+
};
|
|
65
|
+
}>;
|
|
66
|
+
export type SourceLoc = z.output<typeof SourceLoc>;
|
|
67
|
+
//# sourceMappingURL=SourceLoc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SourceLoc.d.ts","sourceRoot":"","sources":["src/SourceLoc.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,eAAO,MAAM,SAAS;;;;;;;;;;;;EAIpB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,SAAS,CAAC,CAAA;AAElD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiD,CAAA;AAEvE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
package/SourceLoc.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.SourcePos = exports.SourceLoc = void 0;
|
|
8
|
+
var _zod = _interopRequireDefault(require("zod"));
|
|
9
|
+
const SourcePos = exports.SourcePos = _zod.default.object({
|
|
10
|
+
line: _zod.default.number().int().nonnegative(),
|
|
11
|
+
column: _zod.default.number().int().nonnegative(),
|
|
12
|
+
index: _zod.default.number().int().nonnegative()
|
|
13
|
+
});
|
|
14
|
+
const SourceLoc = exports.SourceLoc = _zod.default.object({
|
|
15
|
+
start: SourcePos,
|
|
16
|
+
end: SourcePos
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=SourceLoc.js.map
|
package/SourceLoc.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SourceLoc.js","names":["_zod","_interopRequireDefault","require","SourcePos","exports","z","object","line","number","int","nonnegative","column","index","SourceLoc","start","end"],"sources":["src/SourceLoc.ts"],"sourcesContent":["import z from 'zod'\n\nexport const SourcePos = z.object({\n line: z.number().int().nonnegative(),\n column: z.number().int().nonnegative(),\n index: z.number().int().nonnegative(),\n})\n\nexport type SourcePos = z.output<typeof SourcePos>\n\nexport const SourceLoc = z.object({ start: SourcePos, end: SourcePos })\n\nexport type SourceLoc = z.output<typeof SourceLoc>\n"],"mappings":";;;;;;;AAAA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEO,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,YAAC,CAACC,MAAM,CAAC;EAChCC,IAAI,EAAEF,YAAC,CAACG,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC;EACpCC,MAAM,EAAEN,YAAC,CAACG,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC;EACtCE,KAAK,EAAEP,YAAC,CAACG,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,WAAW,CAAC;AACtC,CAAC,CAAC;AAIK,MAAMG,SAAS,GAAAT,OAAA,CAAAS,SAAA,GAAGR,YAAC,CAACC,MAAM,CAAC;EAAEQ,KAAK,EAAEX,SAAS;EAAEY,GAAG,EAAEZ;AAAU,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunksToLines.d.ts","sourceRoot":"","sources":["src/chunksToLines.ts"],"names":[],"mappings":"AAAA,wBAAuB,aAAa,CAClC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC;;;kBAwBjD"}
|
package/chunksToLines.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.chunksToLines = chunksToLines;
|
|
7
|
+
async function* chunksToLines(chunks) {
|
|
8
|
+
let chunkStartIndex = 0;
|
|
9
|
+
let remainder = '';
|
|
10
|
+
let prevChunkEndedWithCarriageReturn = false;
|
|
11
|
+
for await (let chunk of chunks) {
|
|
12
|
+
if (!chunk.length) continue;
|
|
13
|
+
if (remainder) {
|
|
14
|
+
chunk = remainder + chunk;
|
|
15
|
+
remainder = '';
|
|
16
|
+
}
|
|
17
|
+
let end = prevChunkEndedWithCarriageReturn && chunk[0] === '\n' ? 1 : 0;
|
|
18
|
+
const rx = /\r\n?|\n/gm;
|
|
19
|
+
rx.lastIndex = end;
|
|
20
|
+
for (const match of chunk.matchAll(rx)) {
|
|
21
|
+
const line = chunk.substring(end, match.index);
|
|
22
|
+
yield {
|
|
23
|
+
line,
|
|
24
|
+
startIndex: chunkStartIndex + end
|
|
25
|
+
};
|
|
26
|
+
end = match.index + match[0].length;
|
|
27
|
+
}
|
|
28
|
+
if (end < chunk.length) remainder = chunk.substring(end);
|
|
29
|
+
chunkStartIndex += end;
|
|
30
|
+
prevChunkEndedWithCarriageReturn = chunk[chunk.length - 1] === '\r';
|
|
31
|
+
}
|
|
32
|
+
if (remainder) yield {
|
|
33
|
+
line: remainder,
|
|
34
|
+
startIndex: chunkStartIndex
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=chunksToLines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunksToLines.js","names":["chunksToLines","chunks","chunkStartIndex","remainder","prevChunkEndedWithCarriageReturn","chunk","length","end","rx","lastIndex","match","matchAll","line","substring","index","startIndex"],"sources":["src/chunksToLines.ts"],"sourcesContent":["export async function* chunksToLines(\n chunks: Iterable<string> | AsyncIterable<string>\n) {\n let chunkStartIndex = 0\n let remainder = ''\n let prevChunkEndedWithCarriageReturn = false\n for await (let chunk of chunks) {\n if (!chunk.length) continue\n if (remainder) {\n chunk = remainder + chunk\n remainder = ''\n }\n let end = prevChunkEndedWithCarriageReturn && chunk[0] === '\\n' ? 1 : 0\n const rx = /\\r\\n?|\\n/gm\n rx.lastIndex = end\n for (const match of chunk.matchAll(rx)) {\n const line = chunk.substring(end, match.index)\n yield { line, startIndex: chunkStartIndex + end }\n end = match.index + match[0].length\n }\n if (end < chunk.length) remainder = chunk.substring(end)\n chunkStartIndex += end\n prevChunkEndedWithCarriageReturn = chunk[chunk.length - 1] === '\\r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
|
1
|
+
{"version":3,"file":"check-survey-correspondence.d.ts","sourceRoot":"","sources":["../../src/cli/check-survey-correspondence.ts"],"names":[],"mappings":"AASA,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,iBAqCpB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.checkSurveyCorrespondence = checkSurveyCorrespondence;
|
|
8
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
+
var _index = require("../string/index.js");
|
|
10
|
+
var _promises = _interopRequireDefault(require("fs/promises"));
|
|
11
|
+
var _summarizeSurvey = require("../survey/summarizeSurvey.js");
|
|
12
|
+
var _index2 = require("../node/index.js");
|
|
13
|
+
var _formatFrcsTripSummaryFile = require("../formatFrcsTripSummaryFile.js");
|
|
14
|
+
var _util = require("util");
|
|
15
|
+
/* eslint-disable no-console */
|
|
16
|
+
|
|
17
|
+
async function checkSurveyCorrespondence(surveyFile, summaryFile) {
|
|
18
|
+
const source = await _promises.default.readFile(surveyFile, 'utf8');
|
|
19
|
+
const parsedSurvey = await (0, _index.parseFrcsSurveyFile)(surveyFile, source);
|
|
20
|
+
const parsedSummaries = (await (0, _index2.parseFrcsTripSummaryFile)(summaryFile, {
|
|
21
|
+
indexBy: 'occurrence'
|
|
22
|
+
})).tripSummaries.sort((a, b) => (a?.tripNumber ?? 0) - (b?.tripNumber ?? 0));
|
|
23
|
+
const convertedSummaries = (0, _summarizeSurvey.summarizeSurvey)(parsedSurvey, {
|
|
24
|
+
ignoreVerticalOfHShots: true
|
|
25
|
+
}).tripSummaries.sort((a, b) => (a?.tripNumber ?? 0) - (b?.tripNumber ?? 0));
|
|
26
|
+
let errored = false;
|
|
27
|
+
for (let i = 0; i < Math.max(parsedSummaries.length, convertedSummaries.length); i++) {
|
|
28
|
+
const parsed = parsedSummaries[i];
|
|
29
|
+
const converted = convertedSummaries[i];
|
|
30
|
+
const parsedLines = [...(0, _formatFrcsTripSummaryFile.formatFrcsTripSummaryFile)({
|
|
31
|
+
tripSummaries: [parsed]
|
|
32
|
+
})].slice(0, 2);
|
|
33
|
+
const convertedLines = [...(0, _formatFrcsTripSummaryFile.formatFrcsTripSummaryFile)({
|
|
34
|
+
tripSummaries: [converted]
|
|
35
|
+
})].slice(0, 2);
|
|
36
|
+
if (!(0, _util.isDeepStrictEqual)(parsedLines, convertedLines)) {
|
|
37
|
+
errored = true;
|
|
38
|
+
console.log(convertedLines.map(line => _chalk.default.green('+' + line)).join('\n'));
|
|
39
|
+
console.log(parsedLines.map(line => _chalk.default.red('-' + line)).join('\n'));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
process.exit(errored ? 1 : 0);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=check-survey-correspondence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-survey-correspondence.js","names":["_chalk","_interopRequireDefault","require","_index","_promises","_summarizeSurvey","_index2","_formatFrcsTripSummaryFile","_util","checkSurveyCorrespondence","surveyFile","summaryFile","source","fs","readFile","parsedSurvey","parseFrcsSurveyFile","parsedSummaries","parseFrcsTripSummaryFile","indexBy","tripSummaries","sort","a","b","tripNumber","convertedSummaries","summarizeSurvey","ignoreVerticalOfHShots","errored","i","Math","max","length","parsed","converted","parsedLines","formatFrcsTripSummaryFile","slice","convertedLines","isDeepStrictEqual","console","log","map","line","chalk","green","join","red","process","exit"],"sources":["../../src/cli/check-survey-correspondence.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport chalk from 'chalk'\nimport { parseFrcsSurveyFile } from '../string/index'\nimport fs from 'fs/promises'\nimport { summarizeSurvey } from '../survey/summarizeSurvey'\nimport { parseFrcsTripSummaryFile } from '../node/index.js'\nimport { formatFrcsTripSummaryFile } from '../formatFrcsTripSummaryFile.js'\nimport { isDeepStrictEqual } from 'util'\n\nexport async function checkSurveyCorrespondence(\n surveyFile: string,\n summaryFile: string\n) {\n const source = await fs.readFile(surveyFile, 'utf8')\n const parsedSurvey = await parseFrcsSurveyFile(surveyFile, source)\n const parsedSummaries = (\n await parseFrcsTripSummaryFile(summaryFile, { indexBy: 'occurrence' })\n ).tripSummaries.sort((a, b) => (a?.tripNumber ?? 0) - (b?.tripNumber ?? 0))\n const convertedSummaries = summarizeSurvey(parsedSurvey, {\n ignoreVerticalOfHShots: true,\n }).tripSummaries.sort((a, b) => (a?.tripNumber ?? 0) - (b?.tripNumber ?? 0))\n\n let errored = false\n\n for (\n let i = 0;\n i < Math.max(parsedSummaries.length, convertedSummaries.length);\n i++\n ) {\n const parsed = parsedSummaries[i]\n const converted = convertedSummaries[i]\n\n const parsedLines = [\n ...formatFrcsTripSummaryFile({ tripSummaries: [parsed] }),\n ].slice(0, 2)\n const convertedLines = [\n ...formatFrcsTripSummaryFile({ tripSummaries: [converted] }),\n ].slice(0, 2)\n\n if (!isDeepStrictEqual(parsedLines, convertedLines)) {\n errored = true\n console.log(\n convertedLines.map((line) => chalk.green('+' + line)).join('\\n')\n )\n console.log(parsedLines.map((line) => chalk.red('-' + line)).join('\\n'))\n }\n }\n process.exit(errored ? 1 : 0)\n}\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,0BAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAPA;;AASO,eAAeO,yBAAyBA,CAC7CC,UAAkB,EAClBC,WAAmB,EACnB;EACA,MAAMC,MAAM,GAAG,MAAMC,iBAAE,CAACC,Q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AAC;IAEb,IAAI,CAAC,IAAAE,uBAAiB,EAACJ,WAAW,EAAEG,cAAc,CAAC,EAAE;MACnDV,OAAO,GAAG,IAAI;MACdY,OAAO,CAACC,GAAG,CACTH,cAAc,CAACI,GAAG,CAAEC,IAAI,IAAKC,cAAK,CAACC,KAAK,CAAC,GAAG,GAAGF,IAAI,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CACjE,CAAC;MACDN,OAAO,CAACC,GAAG,CAACN,WAAW,CAACO,GAAG,CAAEC,IAAI,IAAKC,cAAK,CAACG,GAAG,CAAC,GAAG,GAAGJ,IAAI,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1E;EACF;EACAE,OAAO,CAACC,IAAI,CAACrB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAC/B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-survey.d.ts","sourceRoot":"","sources":["../../src/cli/check-survey.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,iBAgB7C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.checkSurvey = checkSurvey;
|
|
8
|
+
var _promises = _interopRequireDefault(require("fs/promises"));
|
|
9
|
+
var _parseFrcsSurveyFile = _interopRequireDefault(require("../survey/parseFrcsSurveyFile.js"));
|
|
10
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
11
|
+
var _formatIssues = require("../formatIssues.js");
|
|
12
|
+
/* eslint-disable no-console */
|
|
13
|
+
|
|
14
|
+
async function checkSurvey(file) {
|
|
15
|
+
const source = await _promises.default.readFile(file, 'utf8');
|
|
16
|
+
const parsed = await (0, _parseFrcsSurveyFile.default)(file, [source]);
|
|
17
|
+
const issues = parsed.issues || [];
|
|
18
|
+
console.log((0, _formatIssues.formatIssues)({
|
|
19
|
+
file,
|
|
20
|
+
source,
|
|
21
|
+
parsed,
|
|
22
|
+
errorStyle: _chalk.default.red,
|
|
23
|
+
warningStyle: _chalk.default.yellow
|
|
24
|
+
}));
|
|
25
|
+
process.exit(issues.some(i => i.type === 'error') ? 1 : 0);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=check-survey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-survey.js","names":["_promises","_interopRequireDefault","require","_parseFrcsSurveyFile","_chalk","_formatIssues","checkSurvey","file","source","fs","readFile","parsed","parseFrcsSurveyFile","issues","console","log","formatIssues","errorStyle","chalk","red","warningStyle","yellow","process","exit","some","i","type"],"sources":["../../src/cli/check-survey.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport fs from 'fs/promises'\nimport parseFrcsSurveyFile from '../survey/parseFrcsSurveyFile'\nimport chalk from 'chalk'\nimport { formatIssues } from '../formatIssues.js'\n\nexport async function checkSurvey(file: string) {\n const source = await fs.readFile(file, 'utf8')\n const parsed = await parseFrcsSurveyFile(file, [source])\n\n const issues = parsed.issues || []\n console.log(\n formatIssues({\n file,\n source,\n parsed,\n errorStyle: chalk.red,\n warningStyle: chalk.yellow,\n })\n )\n\n process.exit(issues.some((i) => i.type === 'error') ? 1 : 0)\n}\n"],"mappings":";;;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAJA;;AAMO,eAAeI,WAAWA,CAACC,IAAY,EAAE;EAC9C,MAAMC,MAAM,GAAG,MAAMC,iBAAE,CAACC,QAAQ,CAACH,IAAI,EAAE,MAAM,CAAC;EAC9C,MAAMI,MAAM,GAAG,MAAM,IAAAC,4BAAmB,EAACL,IAAI,EAAE,CAACC,MAAM,CAAC,CAAC;EAExD,MAAMK,MAAM,GAAGF,MAAM,CAACE,MAAM,IAAI,EAAE;EAClCC,OAAO,CAACC,GAAG,CACT,IAAAC,0BAAY,EAAC;IACXT,IAAI;IACJC,MAAM;IACNG,MAAM;IACNM,UAAU,EAAEC,cAAK,CAACC,GAAG;IACrBC,YAAY,EAAEF,cAAK,CAACG;EACtB,CAAC,CACH,CAAC;EAEDC,OAAO,CAACC,IAAI,CAACV,MAAM,CAACW,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC9D","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-survey.d.ts","sourceRoot":"","sources":["../../src/cli/parse-survey.ts"],"names":[],"mappings":"AAIA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,iBAK7C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseSurvey = parseSurvey;
|
|
7
|
+
var _index = require("../node/index.js");
|
|
8
|
+
var _ZodFrcsSurveyFileToJson = require("../survey/ZodFrcsSurveyFileToJson.js");
|
|
9
|
+
/* eslint-disable no-console */
|
|
10
|
+
|
|
11
|
+
async function parseSurvey(file) {
|
|
12
|
+
const parsed = _ZodFrcsSurveyFileToJson.ZodValidOrInvalidFrcsSurveyFileToJson.parse(await (0, _index.parseFrcsSurveyFile)(file));
|
|
13
|
+
console.log(JSON.stringify(parsed));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=parse-survey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-survey.js","names":["_index","require","_ZodFrcsSurveyFileToJson","parseSurvey","file","parsed","ZodValidOrInvalidFrcsSurveyFileToJson","parse","parseFrcsSurveyFile","console","log","JSON","stringify"],"sources":["../../src/cli/parse-survey.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { parseFrcsSurveyFile } from '../node/index'\nimport { ZodValidOrInvalidFrcsSurveyFileToJson } from '../survey/ZodFrcsSurveyFileToJson'\n\nexport async function parseSurvey(file: string) {\n const parsed = ZodValidOrInvalidFrcsSurveyFileToJson.parse(\n await parseFrcsSurveyFile(file)\n )\n console.log(JSON.stringify(parsed))\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAFA;;AAIO,eAAeE,WAAWA,CAACC,IAAY,EAAE;EAC9C,MAAMC,MAAM,GAAGC,8DAAqC,CAACC,KAAK,CACxD,MAAM,IAAAC,0BAAmB,EAACJ,IAAI,CAChC,CAAC;EACDK,OAAO,CAACC,GAAG,CAACC,IAAI,CAACC,SAAS,CAACP,MAAM,CAAC,CAAC;AACrC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summarize-survey.d.ts","sourceRoot":"","sources":["../../src/cli/summarize-survey.ts"],"names":[],"mappings":"AAQA,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,iBAmBjD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.summarizeSurvey = summarizeSurvey;
|
|
8
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
+
var _formatIssues = require("../formatIssues.js");
|
|
10
|
+
var _index = require("../string/index.js");
|
|
11
|
+
var _promises = _interopRequireDefault(require("fs/promises"));
|
|
12
|
+
var _formatFrcsTripSummaryFile = require("../formatFrcsTripSummaryFile.js");
|
|
13
|
+
var _summarizeSurvey = require("../survey/summarizeSurvey.js");
|
|
14
|
+
/* eslint-disable no-console */
|
|
15
|
+
|
|
16
|
+
async function summarizeSurvey(file) {
|
|
17
|
+
const source = await _promises.default.readFile(file, 'utf8');
|
|
18
|
+
const parsed = await (0, _index.parseFrcsSurveyFile)(file, source);
|
|
19
|
+
if ('INVALID' in parsed) {
|
|
20
|
+
console.log((0, _formatIssues.formatIssues)({
|
|
21
|
+
file,
|
|
22
|
+
source,
|
|
23
|
+
parsed,
|
|
24
|
+
errorStyle: _chalk.default.red,
|
|
25
|
+
warningStyle: _chalk.default.yellow
|
|
26
|
+
}));
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
for (const line of (0, _formatFrcsTripSummaryFile.formatFrcsTripSummaryFile)((0, _summarizeSurvey.summarizeSurvey)(parsed))) {
|
|
30
|
+
console.log(line);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=summarize-survey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summarize-survey.js","names":["_chalk","_interopRequireDefault","require","_formatIssues","_index","_promises","_formatFrcsTripSummaryFile","_summarizeSurvey","summarizeSurvey","file","source","fs","readFile","parsed","parseFrcsSurveyFile","console","log","formatIssues","errorStyle","chalk","red","warningStyle","yellow","process","exit","line","formatFrcsTripSummaryFile","baseSummarizeSurvey"],"sources":["../../src/cli/summarize-survey.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport chalk from 'chalk'\nimport { formatIssues } from '../formatIssues'\nimport { parseFrcsSurveyFile } from '../string/index'\nimport fs from 'fs/promises'\nimport { formatFrcsTripSummaryFile } from '../formatFrcsTripSummaryFile'\nimport { summarizeSurvey as baseSummarizeSurvey } from '../survey/summarizeSurvey'\n\nexport async function summarizeSurvey(file: string) {\n const source = await fs.readFile(file, 'utf8')\n const parsed = await parseFrcsSurveyFile(file, source)\n if ('INVALID' in parsed) {\n console.log(\n formatIssues({\n file,\n source,\n parsed,\n errorStyle: chalk.red,\n warningStyle: chalk.yellow,\n })\n )\n process.exit(1)\n }\n\n for (const line of formatFrcsTripSummaryFile(baseSummarizeSurvey(parsed))) {\n console.log(line)\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AANA;;AAQO,eAAeM,eAAeA,CAACC,IAAY,EAAE;EAClD,MAAMC,MAAM,GAAG,MAAMC,iBAAE,CAACC,QAAQ,CAACH,IAAI,EAAE,MAAM,CAAC;EAC9C,MAAMI,MAAM,GAAG,MAAM,IAAAC,0BAAmB,EAACL,IAAI,EAAEC,MAAM,CAAC;EACtD,IAAI,SAAS,IAAIG,MAAM,EAAE;IACvBE,OAAO,CAACC,GAAG,CACT,IAAAC,0BAAY,EAAC;MACXR,IAAI;MACJC,MAAM;MACNG,MAAM;MACNK,UAAU,EAAEC,cAAK,CAACC,GAAG;MACrBC,YAAY,EAAEF,cAAK,CAACG;IACtB,CAAC,CACH,CAAC;IACDC,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;EACjB;EAEA,KAAK,MAAMC,IAAI,IAAI,IAAAC,oDAAyB,EAAC,IAAAC,gCAAmB,EAACd,MAAM,CAAC,CAAC,EAAE;IACzEE,OAAO,CAACC,GAAG,CAACS,IAAI,CAAC;EACnB;AACF","ignoreList":[]}
|
package/cli.d.ts
ADDED
package/cli.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["src/cli.ts"],"names":[],"mappings":""}
|
package/cli.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _yargs = _interopRequireDefault(require("yargs/yargs"));
|
|
5
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
6
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
7
|
+
void (0, _yargs.default)(process.argv.slice(2)).command({
|
|
8
|
+
command: 'check-survey <file>',
|
|
9
|
+
describe: 'check survey file for errors or warnings',
|
|
10
|
+
builder: yargs => yargs.positional('file', {
|
|
11
|
+
type: 'string',
|
|
12
|
+
demandOption: true
|
|
13
|
+
}),
|
|
14
|
+
handler: async ({
|
|
15
|
+
file
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
checkSurvey
|
|
19
|
+
} = await Promise.resolve().then(() => _interopRequireWildcard(require("./cli/check-survey.js")));
|
|
20
|
+
await checkSurvey(file);
|
|
21
|
+
}
|
|
22
|
+
}).command({
|
|
23
|
+
command: 'parse-survey <file>',
|
|
24
|
+
describe: 'parse survey file and output JSON parse tree',
|
|
25
|
+
builder: yargs => yargs.positional('file', {
|
|
26
|
+
type: 'string',
|
|
27
|
+
demandOption: true
|
|
28
|
+
}),
|
|
29
|
+
handler: async ({
|
|
30
|
+
file
|
|
31
|
+
}) => {
|
|
32
|
+
const {
|
|
33
|
+
parseSurvey
|
|
34
|
+
} = await Promise.resolve().then(() => _interopRequireWildcard(require("./cli/parse-survey.js")));
|
|
35
|
+
await parseSurvey(file);
|
|
36
|
+
}
|
|
37
|
+
}).command({
|
|
38
|
+
command: 'summarize-survey <file>',
|
|
39
|
+
describe: 'parse survey file and output trip summaries',
|
|
40
|
+
builder: yargs => yargs.positional('file', {
|
|
41
|
+
type: 'string',
|
|
42
|
+
demandOption: true
|
|
43
|
+
}),
|
|
44
|
+
handler: async ({
|
|
45
|
+
file
|
|
46
|
+
}) => {
|
|
47
|
+
const {
|
|
48
|
+
summarizeSurvey
|
|
49
|
+
} = await Promise.resolve().then(() => _interopRequireWildcard(require("./cli/summarize-survey.js")));
|
|
50
|
+
await summarizeSurvey(file);
|
|
51
|
+
}
|
|
52
|
+
}).command({
|
|
53
|
+
command: 'check-survey-correspondence <surveyFile> <summaryFile>',
|
|
54
|
+
describe: 'parse survey file and output trip summaries',
|
|
55
|
+
builder: yargs => yargs.positional('surveyFile', {
|
|
56
|
+
type: 'string',
|
|
57
|
+
demandOption: true
|
|
58
|
+
}).positional('summaryFile', {
|
|
59
|
+
type: 'string',
|
|
60
|
+
demandOption: true
|
|
61
|
+
}),
|
|
62
|
+
handler: async ({
|
|
63
|
+
surveyFile,
|
|
64
|
+
summaryFile
|
|
65
|
+
}) => {
|
|
66
|
+
const {
|
|
67
|
+
checkSurveyCorrespondence
|
|
68
|
+
} = await Promise.resolve().then(() => _interopRequireWildcard(require("./cli/check-survey-correspondence.js")));
|
|
69
|
+
await checkSurveyCorrespondence(surveyFile, summaryFile);
|
|
70
|
+
}
|
|
71
|
+
}).demandCommand().argv;
|
|
72
|
+
//# sourceMappingURL=cli.js.map
|
package/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","names":["_yargs","_interopRequireDefault","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","yargs","process","argv","slice","command","describe","builder","positional","type","demandOption","handler","file","checkSurvey","Promise","resolve","then","parseSurvey","summarizeSurvey","surveyFile","summaryFile","checkSurveyCorrespondence","demandCommand"],"sources":["src/cli.ts"],"sourcesContent":["import yargs from 'yargs/yargs'\n\nvoid yargs(process.argv.slice(2))\n .command({\n command: 'check-survey <file>',\n describe: 'check survey file for errors or warnings',\n builder: (yargs) =>\n yargs.positional('file', {\n type: 'string',\n demandOption: true,\n }),\n handler: async ({ file }) => {\n const { checkSurvey } = await import('./cli/check-survey')\n await checkSurvey(file)\n },\n })\n .command({\n command: 'parse-survey <file>',\n describe: 'parse survey file and output JSON parse tree',\n builder: (yargs) =>\n yargs.positional('file', {\n type: 'string',\n demandOption: true,\n }),\n handler: async ({ file }) => {\n const { parseSurvey } = await import('./cli/parse-survey')\n await parseSurvey(file)\n },\n })\n .command({\n command: 'summarize-survey <file>',\n describe: 'parse survey file and output trip summaries',\n builder: (yargs) =>\n yargs.positional('file', {\n type: 'string',\n demandOption: true,\n }),\n handler: async ({ file }) => {\n const { summarizeSurvey } = await import('./cli/summarize-survey')\n await summarizeSurvey(file)\n },\n })\n .command({\n command: 'check-survey-correspondence <surveyFile> <summaryFile>',\n describe: 'parse survey file and output trip summaries',\n builder: (yargs) =>\n yargs\n .positional('surveyFile', {\n type: 'string',\n demandOption: true,\n })\n .positional('summaryFile', {\n type: 'string',\n demandOption: true,\n }),\n handler: async ({ surveyFile, summaryFile }) => {\n const { checkSurveyCorrespondence } = await import(\n './cli/check-survey-correspondence'\n )\n await checkSurveyCorrespondence(surveyFile, summaryFile)\n },\n })\n .demandCommand().argv\n"],"mappings":";;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+B,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,G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AE;IACxBC,IAAI,EAAE,QAAQ;IACdC,YAAY,EAAE;EAChB,CAAC,CAAC,CACDF,UAAU,CAAC,aAAa,EAAE;IACzBC,IAAI,EAAE,QAAQ;IACdC,YAAY,EAAE;EAChB,CAAC,CAAC;EACNC,OAAO,EAAE,MAAAA,CAAO;IAAEQ,UAAU;IAAEC;EAAY,CAAC,KAAK;IAC9C,MAAM;MAAEC;IAA0B,CAAC,GAAG,MAAAP,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAA/B,uBAAA,CAAAN,OAAA,0CAErC;IACD,MAAM0C,yBAAyB,CAACF,UAAU,EAAEC,WAAW,CAAC;EAC1D;AACF,CAAC,CAAC,CACDE,aAAa,CAAC,CAAC,CAACnB,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatFrcsTripSummaryFile.d.ts","sourceRoot":"","sources":["src/formatFrcsTripSummaryFile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAI9D,wBAAiB,yBAAyB,CACxC,IAAI,EAAE,mBAAmB,GACxB,QAAQ,CAAC,MAAM,CAAC,CAqClB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatFrcsTripSummaryFile = formatFrcsTripSummaryFile;
|
|
7
|
+
var _unitized = require("@speleotica/unitized");
|
|
8
|
+
const nameLength = 78;
|
|
9
|
+
function* formatFrcsTripSummaryFile(file) {
|
|
10
|
+
for (const summary of file.tripSummaries) {
|
|
11
|
+
if (!summary) continue;
|
|
12
|
+
const {
|
|
13
|
+
tripNumber,
|
|
14
|
+
date,
|
|
15
|
+
totalLength,
|
|
16
|
+
numShots,
|
|
17
|
+
name,
|
|
18
|
+
excludedLength,
|
|
19
|
+
numExcludedShots,
|
|
20
|
+
team,
|
|
21
|
+
shots
|
|
22
|
+
} = summary;
|
|
23
|
+
const month = (date.getMonth() + 1).toFixed();
|
|
24
|
+
const day = date.getDate().toFixed();
|
|
25
|
+
const year = date.getFullYear().toFixed();
|
|
26
|
+
yield `${tripNumber.toFixed().padStart(3)} ${month.padStart(2)}/${day.padStart(2)}/${year.padStart(4)}${totalLength.get(_unitized.Length.feet).toFixed(2).padStart(10)}${numShots.toFixed().padStart(5)} ${name.slice(0, nameLength).padEnd(nameLength)} EXCLUDED:${excludedLength.get(_unitized.Length.feet).toFixed(2).padStart(7)}${numExcludedShots.toFixed().padStart(3)}`;
|
|
27
|
+
yield ' '.repeat(tripNumber >= 1000 ? 34 : 33) + team.join(' ');
|
|
28
|
+
for (let i = 0; i < shots.length; i += 4) {
|
|
29
|
+
yield ' '.repeat(tripNumber >= 1000 ? 36 : 35) + shots.slice(i, i + 4).map(s => s.padEnd(14)).join('');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=formatFrcsTripSummaryFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatFrcsTripSummaryFile.js","names":["_unitized","require","nameLength","formatFrcsTripSummaryFile","file","summary","tripSummaries","tripNumber","date","totalLength","numShots","name","excludedLength","numExcludedShots","team","shots","month","getMonth","toFixed","day","getDate","year","getFullYear","padStart","get","Length","feet","slice","padEnd","repeat","join","i","length","map","s"],"sources":["src/formatFrcsTripSummaryFile.ts"],"sourcesContent":["import { Length } from '@speleotica/unitized'\nimport { FrcsTripSummaryFile } from './FrcsTripSummaryFile.js'\n\nconst nameLength = 78\n\nexport function* formatFrcsTripSummaryFile(\n file: FrcsTripSummaryFile\n): Iterable<string> {\n for (const summary of file.tripSummaries) {\n if (!summary) continue\n const {\n tripNumber,\n date,\n totalLength,\n numShots,\n name,\n excludedLength,\n numExcludedShots,\n team,\n shots,\n } = summary\n const month = (date.getMonth() + 1).toFixed()\n const day = date.getDate().toFixed()\n const year = date.getFullYear().toFixed()\n yield `${tripNumber.toFixed().padStart(3)} ${month.padStart(\n 2\n )}/${day.padStart(2)}/${year.padStart(4)}${totalLength\n .get(Length.feet)\n .toFixed(2)\n .padStart(10)}${numShots.toFixed().padStart(5)} ${name\n .slice(0, nameLength)\n .padEnd(nameLength)} EXCLUDED:${excludedLength\n .get(Length.feet)\n .toFixed(2)\n .padStart(7)}${numExcludedShots.toFixed().padStart(3)}`\n yield ' '.repeat(tripNumber >= 1000 ? 34 : 33) + team.join(' ')\n for (let i = 0; i < shots.length; i += 4) {\n yield ' '.repeat(tripNumber >= 1000 ? 36 : 35) +\n shots\n .slice(i, i + 4)\n .map((s) => s.padEnd(14))\n .join('')\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAGA,MAAMC,UAAU,GAAG,EAAE;AAEd,UAAUC,yBAAyBA,CACxCC,IAAyB,EACP;EAClB,KAAK,MAAMC,OAAO,IAAID,IAAI,CAACE,aAAa,EAAE;IACxC,IAAI,CAACD,OAAO,EAAE;IACd,MAAM;MACJE,UAAU;MACVC,IAAI;MACJC,WAAW;MACXC,QAAQ;MACRC,IAAI;MACJC,cAAc;MACdC,gBAAgB;MAChBC,IAAI;MACJC;IACF,CAAC,GAAGV,OAAO;IACX,MAAMW,KAAK,GAAG,CAACR,IAAI,CAACS,QAAQ,CAAC,CAAC,GAAG,CAAC,EAAEC,OAAO,CAAC,CAAC;IAC7C,MAAMC,GAAG,GAAGX,IAAI,CAACY,OAAO,CAAC,CAAC,CAACF,OAAO,CAAC,CAAC;IACpC,MAAMG,IAAI,GAAGb,IAAI,CAACc,WAAW,CAAC,CAAC,CAACJ,OAAO,CAAC,CAAC;IACzC,MAAM,GAAGX,UAAU,CAACW,OAAO,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC,CAAC,KAAKP,KAAK,CAACO,QAAQ,CAC1D,CACF,CAAC,IAAIJ,GAAG,CAACI,QAAQ,CAAC,CAAC,CAAC,IAAIF,IAAI,CAACE,QAAQ,CAAC,CAAC,CAAC,GAAGd,WAAW,CACnDe,GAAG,CAACC,gBAAM,CAACC,IAAI,CAAC,CAChBR,OAAO,CAAC,CAAC,CAAC,CACVK,QAAQ,CAAC,EAAE,CAAC,GAAGb,QAAQ,CAACQ,OAAO,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC,CAAC,MAAMZ,IAAI,CACvDgB,KAAK,CAAC,CAAC,EAAEzB,UAAU,CAAC,CACpB0B,MAAM,CAAC1B,UAAU,CAAC,cAAcU,cAAc,CAC9CY,GAAG,CAACC,gBAAM,CAACC,IAAI,CAAC,CAChBR,OAAO,CAAC,CAAC,CAAC,CACVK,QAAQ,CAAC,CAAC,CAAC,GAAGV,gBAAgB,CAACK,OAAO,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC,CAAC,EAAE;IACzD,MAAM,GAAG,CAACM,MAAM,CAACtB,UAAU,IAAI,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,GAAGO,IAAI,CAACgB,IAAI,CAAC,IAAI,CAAC;IAChE,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGhB,KAAK,CAACiB,MAAM,EAAED,CAAC,IAAI,CAAC,EAAE;MACxC,MAAM,GAAG,CAACF,MAAM,CAACtB,UAAU,IAAI,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,GAC5CQ,KAAK,CACFY,KAAK,CAACI,CAAC,EAAEA,CAAC,GAAG,CAAC,CAAC,CACfE,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACN,MAAM,CAAC,EAAE,CAAC,CAAC,CACxBE,IAAI,CAAC,EAAE,CAAC;IACf;EACF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FrcsSurveyFile, InvalidFrcsSurveyFile } from './survey/FrcsSurveyFile';
|
|
2
|
+
import { FrcsSurveyFileJson, InvalidFrcsSurveyFileJson } from './survey/FrcsSurveyFileJson.js';
|
|
3
|
+
export declare function formatIssues({ parsed, source, file, errorStyle, warningStyle, }: {
|
|
4
|
+
parsed: FrcsSurveyFile | InvalidFrcsSurveyFile | FrcsSurveyFileJson | InvalidFrcsSurveyFileJson;
|
|
5
|
+
source: string;
|
|
6
|
+
file: string;
|
|
7
|
+
errorStyle?: (s: string) => string;
|
|
8
|
+
warningStyle?: (s: string) => string;
|
|
9
|
+
}): string;
|
|
10
|
+
//# sourceMappingURL=formatIssues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatIssues.d.ts","sourceRoot":"","sources":["src/formatIssues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/E,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AAIvC,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,MAAM,EACN,IAAI,EACJ,UAAqB,EACrB,YAAuB,GACxB,EAAE;IACD,MAAM,EACF,cAAc,GACd,qBAAqB,GACrB,kBAAkB,GAClB,yBAAyB,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAClC,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CACrC,UAwEA"}
|