@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/formatIssues.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatIssues = formatIssues;
|
|
7
|
+
var _underlineSource = require("./underlineSource.js");
|
|
8
|
+
var _unwrapInvalid = require("./unwrapInvalid.js");
|
|
9
|
+
function formatIssues({
|
|
10
|
+
parsed,
|
|
11
|
+
source,
|
|
12
|
+
file,
|
|
13
|
+
errorStyle = s => s,
|
|
14
|
+
warningStyle = s => s
|
|
15
|
+
}) {
|
|
16
|
+
const issues = parsed.issues || [];
|
|
17
|
+
const lines = [];
|
|
18
|
+
for (const issue of issues) {
|
|
19
|
+
const {
|
|
20
|
+
type,
|
|
21
|
+
loc,
|
|
22
|
+
message
|
|
23
|
+
} = issue;
|
|
24
|
+
const style = type === 'error' ? errorStyle : warningStyle;
|
|
25
|
+
lines.push(`${style(`${type === 'error' ? errorStyle('✘') : warningStyle('⚠')} ${`${type[0].toUpperCase()}${type.substring(1)}:`.padEnd(8)} ${message?.padEnd(40)}`)} (${file}:${loc?.start?.line}:${loc?.start?.column})`);
|
|
26
|
+
if (loc) {
|
|
27
|
+
lines.push((0, _underlineSource.underlineSource)(source, loc, {
|
|
28
|
+
underlineStyle: style
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const errorCount = issues.reduce((count, i) => i.type === 'error' ? count + 1 : count, 0);
|
|
33
|
+
const warningCount = issues.reduce((count, i) => i.type === 'warning' ? count + 1 : count, 0);
|
|
34
|
+
const trips = (0, _unwrapInvalid.unwrapInvalid)(parsed).trips;
|
|
35
|
+
const tripCount = trips.length;
|
|
36
|
+
const shotCount = trips.reduce((count, trip) => count + (0, _unwrapInvalid.unwrapInvalid)(trip).shots.length, 0);
|
|
37
|
+
const fmtErrorCount = `✘ ${errorCount}`;
|
|
38
|
+
const fmtWarningCount = `⚠ ${warningCount}`;
|
|
39
|
+
const fmtTripCount = `${tripCount}`;
|
|
40
|
+
const fmtShotCount = `${shotCount}`;
|
|
41
|
+
const countWidth = Math.max(fmtErrorCount.length, fmtWarningCount.length, fmtTripCount.length, fmtShotCount.length);
|
|
42
|
+
if (errorCount) {
|
|
43
|
+
lines.push(errorStyle(`${fmtErrorCount.padStart(countWidth)} error${errorCount === 1 ? '' : 's'}`));
|
|
44
|
+
}
|
|
45
|
+
if (warningCount) {
|
|
46
|
+
lines.push(warningStyle(`${fmtWarningCount.padStart(countWidth)} warning${warningCount === 1 ? '' : 's'}`));
|
|
47
|
+
}
|
|
48
|
+
lines.push(`${fmtTripCount.padStart(countWidth)} trip${tripCount === 1 ? '' : 's'}`);
|
|
49
|
+
lines.push(`${fmtShotCount.padStart(countWidth)} shot${shotCount === 1 ? '' : 's'}`);
|
|
50
|
+
return lines.join('\n');
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=formatIssues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatIssues.js","names":["_underlineSource","require","_unwrapInvalid","formatIssues","parsed","source","file","errorStyle","s","warningStyle","issues","lines","issue","type","loc","message","style","push","toUpperCase","substring","padEnd","start","line","column","underlineSource","underlineStyle","errorCount","reduce","count","i","warningCount","trips","unwrapInvalid","tripCount","length","shotCount","trip","shots","fmtErrorCount","fmtWarningCount","fmtTripCount","fmtShotCount","countWidth","Math","max","padStart","join"],"sources":["src/formatIssues.ts"],"sourcesContent":["import { FrcsSurveyFile, InvalidFrcsSurveyFile } from './survey/FrcsSurveyFile'\nimport {\n FrcsSurveyFileJson,\n InvalidFrcsSurveyFileJson,\n} from './survey/FrcsSurveyFileJson.js'\nimport { underlineSource } from './underlineSource'\nimport { unwrapInvalid } from './unwrapInvalid.js'\n\nexport function formatIssues({\n parsed,\n source,\n file,\n errorStyle = (s) => s,\n warningStyle = (s) => s,\n}: {\n parsed:\n | FrcsSurveyFile\n | InvalidFrcsSurveyFile\n | FrcsSurveyFileJson\n | InvalidFrcsSurveyFileJson\n source: string\n file: string\n errorStyle?: (s: string) => string\n warningStyle?: (s: string) => string\n}) {\n const issues = parsed.issues || []\n const lines: string[] = []\n for (const issue of issues) {\n const { type, loc, message } = issue\n const style = type === 'error' ? errorStyle : warningStyle\n lines.push(\n `${style(\n `${\n type === 'error' ? errorStyle('✘') : warningStyle('⚠')\n } ${`${type[0].toUpperCase()}${type.substring(1)}:`.padEnd(\n 8\n )} ${message?.padEnd(40)}`\n )} (${file}:${loc?.start?.line}:${loc?.start?.column})`\n )\n if (loc) {\n lines.push(underlineSource(source, loc, { underlineStyle: style }))\n }\n }\n\n const errorCount = issues.reduce(\n (count, i) => (i.type === 'error' ? count + 1 : count),\n 0\n )\n const warningCount = issues.reduce(\n (count, i) => (i.type === 'warning' ? count + 1 : count),\n 0\n )\n const trips = unwrapInvalid(parsed).trips\n const tripCount = trips.length\n const shotCount = trips.reduce(\n (count, trip) => count + unwrapInvalid(trip).shots.length,\n 0\n )\n\n const fmtErrorCount = `✘ ${errorCount}`\n const fmtWarningCount = `⚠ ${warningCount}`\n const fmtTripCount = `${tripCount}`\n const fmtShotCount = `${shotCount}`\n\n const countWidth = Math.max(\n fmtErrorCount.length,\n fmtWarningCount.length,\n fmtTripCount.length,\n fmtShotCount.length\n )\n\n if (errorCount) {\n lines.push(\n errorStyle(\n `${fmtErrorCount.padStart(countWidth)} error${\n errorCount === 1 ? '' : 's'\n }`\n )\n )\n }\n if (warningCount) {\n lines.push(\n warningStyle(\n `${fmtWarningCount.padStart(countWidth)} warning${\n warningCount === 1 ? '' : 's'\n }`\n )\n )\n }\n lines.push(\n `${fmtTripCount.padStart(countWidth)} trip${tripCount === 1 ? '' : 's'}`\n )\n lines.push(\n `${fmtShotCount.padStart(countWidth)} shot${shotCount === 1 ? '' : 's'}`\n )\n return lines.join('\\n')\n}\n"],"mappings":";;;;;;AAKA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GA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CAAC,GAAG,EAAE,GAAG,GAAG,EACxE,CAAC;EACDtB,KAAK,CAACM,IAAI,CACR,GAAGwB,YAAY,CAACI,QAAQ,CAACH,UAAU,CAAC,QAAQP,SAAS,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,EACxE,CAAC;EACD,OAAOxB,KAAK,CAACmC,IAAI,CAAC,IAAI,CAAC;AACzB","ignoreList":[]}
|
package/index.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { FrcsTrip, FrcsTripHeader } from './
|
|
2
|
-
import
|
|
3
|
-
import { FrcsSurveyFile } from './FrcsSurveyFile';
|
|
4
|
-
import parseFrcsSurveyFile from './parseFrcsSurveyFile';
|
|
1
|
+
import type { FrcsShot, FrcsSurveyFile, FrcsTrip, FrcsTripHeader } from './survey/FrcsSurveyFile';
|
|
2
|
+
import parseFrcsSurveyFile from './survey/parseFrcsSurveyFile';
|
|
5
3
|
import { FrcsPlotShot } from './FrcsPlotShot';
|
|
6
4
|
import { FrcsPlotFile } from './FrcsPlotFile';
|
|
7
5
|
import parseFrcsPlotFile from './parseFrcsPlotFile';
|
|
8
6
|
import { FrcsTripSummary } from './FrcsTripSummary';
|
|
9
7
|
import { FrcsTripSummaryFile } from './FrcsTripSummaryFile';
|
|
10
8
|
import parseFrcsTripSummaryFile from './parseFrcsTripSummaryFile';
|
|
11
|
-
import formatFrcsShot from './formatFrcsShot';
|
|
12
|
-
import { formatFrcsSurveyFile } from './formatFrcsSurveyFile';
|
|
13
|
-
export { FrcsShot,
|
|
9
|
+
import formatFrcsShot from './survey/formatFrcsShot';
|
|
10
|
+
import { formatFrcsSurveyFile } from './survey/formatFrcsSurveyFile';
|
|
11
|
+
export { FrcsShot, FrcsSurveyFile, FrcsTrip, FrcsTripHeader, parseFrcsSurveyFile, FrcsPlotShot, FrcsPlotFile, parseFrcsPlotFile, FrcsTripSummary, FrcsTripSummaryFile, parseFrcsTripSummaryFile, formatFrcsShot, formatFrcsSurveyFile, };
|
|
14
12
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAc,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,mBAAmB,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,wBAAwB,MAAM,4BAA4B,CAAA;AACjE,OAAO,cAAc,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AAEpE,OAAO,EACL,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,oBAAoB,GACrB,CAAA"}
|
package/index.js
CHANGED
|
@@ -6,98 +6,65 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
Object.defineProperty(exports, "FrcsPlotFile", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function
|
|
9
|
+
get: function () {
|
|
10
10
|
return _FrcsPlotFile.FrcsPlotFile;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "FrcsPlotShot", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function
|
|
15
|
+
get: function () {
|
|
16
16
|
return _FrcsPlotShot.FrcsPlotShot;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
Object.defineProperty(exports, "FrcsShot", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _FrcsShot.FrcsShot;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "FrcsShotKind", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function get() {
|
|
28
|
-
return _FrcsShot.FrcsShotKind;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "FrcsSurveyFile", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function get() {
|
|
34
|
-
return _FrcsSurveyFile.FrcsSurveyFile;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(exports, "FrcsTrip", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function get() {
|
|
40
|
-
return _FrcsTrip.FrcsTrip;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(exports, "FrcsTripHeader", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function get() {
|
|
46
|
-
return _FrcsTrip.FrcsTripHeader;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
19
|
Object.defineProperty(exports, "FrcsTripSummary", {
|
|
50
20
|
enumerable: true,
|
|
51
|
-
get: function
|
|
21
|
+
get: function () {
|
|
52
22
|
return _FrcsTripSummary.FrcsTripSummary;
|
|
53
23
|
}
|
|
54
24
|
});
|
|
55
25
|
Object.defineProperty(exports, "FrcsTripSummaryFile", {
|
|
56
26
|
enumerable: true,
|
|
57
|
-
get: function
|
|
27
|
+
get: function () {
|
|
58
28
|
return _FrcsTripSummaryFile.FrcsTripSummaryFile;
|
|
59
29
|
}
|
|
60
30
|
});
|
|
61
31
|
Object.defineProperty(exports, "formatFrcsShot", {
|
|
62
32
|
enumerable: true,
|
|
63
|
-
get: function
|
|
64
|
-
return _formatFrcsShot
|
|
33
|
+
get: function () {
|
|
34
|
+
return _formatFrcsShot.default;
|
|
65
35
|
}
|
|
66
36
|
});
|
|
67
37
|
Object.defineProperty(exports, "formatFrcsSurveyFile", {
|
|
68
38
|
enumerable: true,
|
|
69
|
-
get: function
|
|
39
|
+
get: function () {
|
|
70
40
|
return _formatFrcsSurveyFile.formatFrcsSurveyFile;
|
|
71
41
|
}
|
|
72
42
|
});
|
|
73
43
|
Object.defineProperty(exports, "parseFrcsPlotFile", {
|
|
74
44
|
enumerable: true,
|
|
75
|
-
get: function
|
|
76
|
-
return _parseFrcsPlotFile
|
|
45
|
+
get: function () {
|
|
46
|
+
return _parseFrcsPlotFile.default;
|
|
77
47
|
}
|
|
78
48
|
});
|
|
79
49
|
Object.defineProperty(exports, "parseFrcsSurveyFile", {
|
|
80
50
|
enumerable: true,
|
|
81
|
-
get: function
|
|
82
|
-
return _parseFrcsSurveyFile
|
|
51
|
+
get: function () {
|
|
52
|
+
return _parseFrcsSurveyFile.default;
|
|
83
53
|
}
|
|
84
54
|
});
|
|
85
55
|
Object.defineProperty(exports, "parseFrcsTripSummaryFile", {
|
|
86
56
|
enumerable: true,
|
|
87
|
-
get: function
|
|
88
|
-
return _parseFrcsTripSummaryFile
|
|
57
|
+
get: function () {
|
|
58
|
+
return _parseFrcsTripSummaryFile.default;
|
|
89
59
|
}
|
|
90
60
|
});
|
|
91
|
-
var
|
|
92
|
-
var _FrcsShot = require("./FrcsShot.js");
|
|
93
|
-
var _FrcsSurveyFile = require("./FrcsSurveyFile.js");
|
|
94
|
-
var _parseFrcsSurveyFile = _interopRequireDefault(require("./parseFrcsSurveyFile.js"));
|
|
61
|
+
var _parseFrcsSurveyFile = _interopRequireDefault(require("./survey/parseFrcsSurveyFile.js"));
|
|
95
62
|
var _FrcsPlotShot = require("./FrcsPlotShot.js");
|
|
96
63
|
var _FrcsPlotFile = require("./FrcsPlotFile.js");
|
|
97
64
|
var _parseFrcsPlotFile = _interopRequireDefault(require("./parseFrcsPlotFile.js"));
|
|
98
65
|
var _FrcsTripSummary = require("./FrcsTripSummary.js");
|
|
99
66
|
var _FrcsTripSummaryFile = require("./FrcsTripSummaryFile.js");
|
|
100
67
|
var _parseFrcsTripSummaryFile = _interopRequireDefault(require("./parseFrcsTripSummaryFile.js"));
|
|
101
|
-
var _formatFrcsShot = _interopRequireDefault(require("./formatFrcsShot.js"));
|
|
102
|
-
var _formatFrcsSurveyFile = require("./formatFrcsSurveyFile.js");
|
|
68
|
+
var _formatFrcsShot = _interopRequireDefault(require("./survey/formatFrcsShot.js"));
|
|
69
|
+
var _formatFrcsSurveyFile = require("./survey/formatFrcsSurveyFile.js");
|
|
103
70
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_parseFrcsSurveyFile","_interopRequireDefault","require","_FrcsPlotShot","_FrcsPlotFile","_parseFrcsPlotFile","_FrcsTripSummary","_FrcsTripSummaryFile","_parseFrcsTripSummaryFile","_formatFrcsShot","_formatFrcsSurveyFile"],"sources":["src/index.ts"],"sourcesContent":["import type {\n FrcsShot,\n FrcsSurveyFile,\n FrcsTrip,\n FrcsTripHeader,\n} from './survey/FrcsSurveyFile'\nimport parseFrcsSurveyFile from './survey/parseFrcsSurveyFile'\nimport { FrcsPlotShot } from './FrcsPlotShot'\nimport { FrcsPlotFile } from './FrcsPlotFile'\nimport parseFrcsPlotFile from './parseFrcsPlotFile'\nimport { FrcsTripSummary } from './FrcsTripSummary'\nimport { FrcsTripSummaryFile } from './FrcsTripSummaryFile'\nimport parseFrcsTripSummaryFile from './parseFrcsTripSummaryFile'\nimport formatFrcsShot from './survey/formatFrcsShot'\nimport { formatFrcsSurveyFile } from './survey/formatFrcsSurveyFile'\n\nexport {\n FrcsShot,\n FrcsSurveyFile,\n FrcsTrip,\n FrcsTripHeader,\n parseFrcsSurveyFile,\n FrcsPlotShot,\n FrcsPlotFile,\n parseFrcsPlotFile,\n FrcsTripSummary,\n FrcsTripSummaryFile,\n parseFrcsTripSummaryFile,\n formatFrcsShot,\n formatFrcsSurveyFile,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,yBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,eAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA","ignoreList":[]}
|
package/node/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const parseFrcsSurveyFile: (file: string, rest_0?: import("../
|
|
1
|
+
export declare const parseFrcsSurveyFile: (file: string, rest_0?: import("../survey/FrcsSurveyFile").ParseFrcsSurveyFileOptions | undefined) => Promise<import("..").FrcsSurveyFile | import("../survey/FrcsSurveyFile").InvalidFrcsSurveyFile>;
|
|
2
2
|
export declare const parseFrcsPlotFile: (file: string) => Promise<import("..").FrcsPlotFile>;
|
|
3
|
-
export declare const parseFrcsTripSummaryFile: (file: string
|
|
3
|
+
export declare const parseFrcsTripSummaryFile: (file: string, rest_0?: {
|
|
4
|
+
indexBy?: "tripNumber" | "occurrence";
|
|
5
|
+
} | undefined) => Promise<import("..").FrcsTripSummaryFile>;
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
package/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,mBAAmB,SAHvB,MAAM,wLAG2D,CAAA;AAC1E,eAAO,MAAM,iBAAiB,SAfrB,MAAM,uCAesD,CAAA;AACrE,eAAO,MAAM,wBAAwB,SAhB5B,MAAM;;2DAkBd,CAAA"}
|
package/node/index.js
CHANGED
|
@@ -7,18 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.parseFrcsTripSummaryFile = exports.parseFrcsSurveyFile = exports.parseFrcsPlotFile = void 0;
|
|
8
8
|
var _fs = _interopRequireDefault(require("fs"));
|
|
9
9
|
var _readline = _interopRequireDefault(require("readline"));
|
|
10
|
-
var _parseFrcsSurveyFile2 = _interopRequireDefault(require("../parseFrcsSurveyFile.js"));
|
|
10
|
+
var _parseFrcsSurveyFile2 = _interopRequireDefault(require("../survey/parseFrcsSurveyFile.js"));
|
|
11
11
|
var _parseFrcsPlotFile2 = _interopRequireDefault(require("../parseFrcsPlotFile.js"));
|
|
12
12
|
var _parseFrcsTripSummaryFile2 = _interopRequireDefault(require("../parseFrcsTripSummaryFile.js"));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return fn.apply(void 0, [file, _readline["default"].createInterface(_fs["default"].createReadStream(file))].concat(rest));
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
var parseFrcsSurveyFile = exports.parseFrcsSurveyFile = convert(_parseFrcsSurveyFile2["default"]);
|
|
22
|
-
var parseFrcsPlotFile = exports.parseFrcsPlotFile = convert(_parseFrcsPlotFile2["default"]);
|
|
23
|
-
var parseFrcsTripSummaryFile = exports.parseFrcsTripSummaryFile = convert(_parseFrcsTripSummaryFile2["default"]);
|
|
13
|
+
const convertLineBased = fn => (file, ...rest) => fn(file, _readline.default.createInterface(_fs.default.createReadStream(file)), ...rest);
|
|
14
|
+
const convertChunkBased = fn => (file, ...rest) => fn(file, _fs.default.createReadStream(file, 'utf8'), ...rest);
|
|
15
|
+
const parseFrcsSurveyFile = exports.parseFrcsSurveyFile = convertChunkBased(_parseFrcsSurveyFile2.default);
|
|
16
|
+
const parseFrcsPlotFile = exports.parseFrcsPlotFile = convertLineBased(_parseFrcsPlotFile2.default);
|
|
17
|
+
const parseFrcsTripSummaryFile = exports.parseFrcsTripSummaryFile = convertLineBased(_parseFrcsTripSummaryFile2.default);
|
|
24
18
|
//# sourceMappingURL=index.js.map
|
package/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_fs","_interopRequireDefault","require","_readline","_parseFrcsSurveyFile2","_parseFrcsPlotFile2","_parseFrcsTripSummaryFile2","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_fs","_interopRequireDefault","require","_readline","_parseFrcsSurveyFile2","_parseFrcsPlotFile2","_parseFrcsTripSummaryFile2","convertLineBased","fn","file","rest","readline","createInterface","fs","createReadStream","convertChunkBased","parseFrcsSurveyFile","exports","_parseFrcsSurveyFile","parseFrcsPlotFile","_parseFrcsPlotFile","parseFrcsTripSummaryFile","_parseFrcsTripSummaryFile"],"sources":["../../src/node/index.ts"],"sourcesContent":["import fs from 'fs'\nimport readline from 'readline'\nimport _parseFrcsSurveyFile from '../survey/parseFrcsSurveyFile'\nimport _parseFrcsPlotFile from '../parseFrcsPlotFile'\nimport _parseFrcsTripSummaryFile from '../parseFrcsTripSummaryFile'\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, ...rest: Rest): Promise<T> =>\n fn(file, readline.createInterface(fs.createReadStream(file)), ...rest)\n\nconst convertChunkBased =\n <T, Rest extends any[]>(\n fn: (\n file: string,\n lines: AsyncIterable<string>,\n ...rest: Rest\n ) => Promise<T>\n ) =>\n (file: string, ...rest: Rest): Promise<T> =>\n fn(file, fs.createReadStream(file, 'utf8'), ...rest)\n\nexport const parseFrcsSurveyFile = convertChunkBased(_parseFrcsSurveyFile)\nexport const parseFrcsPlotFile = convertLineBased(_parseFrcsPlotFile)\nexport const parseFrcsTripSummaryFile = convertLineBased(\n _parseFrcsTripSummaryFile\n)\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,qBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,mBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,0BAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,MAAMK,gBAAgB,GAElBC,EAIe,IAEjB,CAACC,IAAY,EAAE,GAAGC,IAAU,KAC1BF,EAAE,CAACC,IAAI,EAAEE,iBAAQ,CAACC,eAAe,CAACC,WAAE,CAACC,gBAAgB,CAACL,IAAI,CAAC,CAAC,EAAE,GAAGC,IAAI,CAAC;AAE1E,MAAMK,iBAAiB,GAEnBP,EAIe,IAEjB,CAACC,IAAY,EAAE,GAAGC,IAAU,KAC1BF,EAAE,CAACC,IAAI,EAAEI,WAAE,CAACC,gBAAgB,CAACL,IAAI,EAAE,MAAM,CAAC,EAAE,GAAGC,IAAI,CAAC;AAEjD,MAAMM,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGD,iBAAiB,CAACG,6BAAoB,CAAC;AACnE,MAAMC,iBAAiB,GAAAF,OAAA,CAAAE,iBAAA,GAAGZ,gBAAgB,CAACa,2BAAkB,CAAC;AAC9D,MAAMC,wBAAwB,GAAAJ,OAAA,CAAAI,wBAAA,GAAGd,gBAAgB,CACtDe,kCACF,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speleotica/frcsdata",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-beta.2",
|
|
4
4
|
"description": "parser for Chip Hopper's survey data format used in Fisher Ridge Cave System",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -22,7 +22,13 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@babel/runtime": "^7.18.6",
|
|
24
24
|
"@speleotica/unitized": "^2.0.0",
|
|
25
|
-
"
|
|
25
|
+
"chalk": "^4",
|
|
26
|
+
"dedent-js": "^1.0.1",
|
|
27
|
+
"glob": "^13.0.6",
|
|
28
|
+
"parse-segment": "^1.5.4",
|
|
29
|
+
"yaml": "^2.8.2",
|
|
30
|
+
"yargs": "^17",
|
|
31
|
+
"zod": "^3"
|
|
26
32
|
},
|
|
27
33
|
"main": "index.js",
|
|
28
34
|
"types": "index.d.ts",
|
|
@@ -43,10 +49,6 @@
|
|
|
43
49
|
"./web": {
|
|
44
50
|
"types": "./web/index.d.ts",
|
|
45
51
|
"default": "./web/index.js"
|
|
46
|
-
},
|
|
47
|
-
"./*": {
|
|
48
|
-
"types": "./*.d.ts",
|
|
49
|
-
"default": "./*.js"
|
|
50
52
|
}
|
|
51
53
|
},
|
|
52
54
|
"engines": {
|