@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
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatFrcsSurveyFile = formatFrcsSurveyFile;
|
|
7
|
+
var _unitized = require("@speleotica/unitized");
|
|
8
|
+
var _formatFrcsShot = require("./formatFrcsShot.js");
|
|
9
|
+
async function* formatFrcsSurveyFile(file) {
|
|
10
|
+
const formatFrcsShot = (0, _formatFrcsShot.makeFormatFrcsShot)(file);
|
|
11
|
+
if (file.cave) {
|
|
12
|
+
yield ` ${file.cave}${file.location ? `, ${file.location}` : ''}\n`;
|
|
13
|
+
}
|
|
14
|
+
for (let tripIndex = 0; tripIndex < file.trips.length; tripIndex++) {
|
|
15
|
+
const trip = file.trips[tripIndex];
|
|
16
|
+
const {
|
|
17
|
+
shots,
|
|
18
|
+
header,
|
|
19
|
+
units
|
|
20
|
+
} = trip;
|
|
21
|
+
const {
|
|
22
|
+
name,
|
|
23
|
+
team,
|
|
24
|
+
date,
|
|
25
|
+
comment
|
|
26
|
+
} = header;
|
|
27
|
+
if (tripIndex > 0) yield ' *\n';
|
|
28
|
+
yield name.replace(/\n?$/, '\n');
|
|
29
|
+
const line2 = [...(team?.length ? [team.join(', ')] : []), ...(date ? [formatDate(date)] : [])].join('. ');
|
|
30
|
+
if (line2) yield `${line2}\n`;
|
|
31
|
+
if (comment) yield comment.replace(/\n?$/, '\n');
|
|
32
|
+
yield ' *\n';
|
|
33
|
+
yield formatUnits(units);
|
|
34
|
+
let alternateUnits;
|
|
35
|
+
for (let i = 0; i < shots.length; i++) {
|
|
36
|
+
const shot = shots[i];
|
|
37
|
+
if (shot.comment) {
|
|
38
|
+
const lines = shot.comment.split(/\n/gm);
|
|
39
|
+
yield '*\n';
|
|
40
|
+
for (let i = 0; i < lines.length - 1; i++) {
|
|
41
|
+
yield lines[i].replace(/\n?$/, '\n');
|
|
42
|
+
}
|
|
43
|
+
yield `* ${lines[lines.length - 1].replace(/\n?$/, '\n')}`;
|
|
44
|
+
}
|
|
45
|
+
if (shot.recorded?.units) {
|
|
46
|
+
alternateUnits = shot.recorded.units;
|
|
47
|
+
yield `* %NC\n`;
|
|
48
|
+
yield formatUnits(shot.recorded.units);
|
|
49
|
+
}
|
|
50
|
+
yield formatFrcsShot(shot.recorded || shot, alternateUnits || units).replace(/\n?$/, '\n');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function formatUnits(units) {
|
|
55
|
+
const distUnit = formatLengthUnit(units.distanceUnit);
|
|
56
|
+
const azmMode = units.hasBacksightAzimuth ? units.backsightAzimuthCorrected ? 'C' : 'B' : ' ';
|
|
57
|
+
const incMode = units.hasBacksightInclination ? units.backsightInclinationCorrected ? 'C' : 'B' : ' ';
|
|
58
|
+
const azmUnit = formatAngleUnit(units.azimuthUnit);
|
|
59
|
+
const incUnit = formatAngleUnit(units.inclinationUnit);
|
|
60
|
+
return `${distUnit} ${azmMode}${incMode} ${azmUnit}${incUnit}\n`;
|
|
61
|
+
}
|
|
62
|
+
function formatDate(date) {
|
|
63
|
+
return `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear() % 100}`;
|
|
64
|
+
}
|
|
65
|
+
function formatLengthUnit(unit) {
|
|
66
|
+
switch (unit) {
|
|
67
|
+
case _unitized.Length.meters:
|
|
68
|
+
return 'M ';
|
|
69
|
+
case _unitized.Length.feet:
|
|
70
|
+
return 'FT';
|
|
71
|
+
case _unitized.Length.inches:
|
|
72
|
+
return 'FI';
|
|
73
|
+
default:
|
|
74
|
+
throw new Error(`invalid length unit: ${unit}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function formatAngleUnit(unit) {
|
|
78
|
+
switch (unit) {
|
|
79
|
+
case _unitized.Angle.degrees:
|
|
80
|
+
return 'D';
|
|
81
|
+
case _unitized.Angle.gradians:
|
|
82
|
+
return 'G';
|
|
83
|
+
default:
|
|
84
|
+
throw new Error(`invalid angle unit: ${unit}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=formatFrcsSurveyFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatFrcsSurveyFile.js","names":["_unitized","require","_formatFrcsShot","formatFrcsSurveyFile","file","formatFrcsShot","makeFormatFrcsShot","cave","location","tripIndex","trips","length","trip","shots","header","units","name","team","date","comment","replace","line2","join","formatDate","formatUnits","alternateUnits","i","shot","lines","split","recorded","distUnit","formatLengthUnit","distanceUnit","azmMode","hasBacksightAzimuth","backsightAzimuthCorrected","incMode","hasBacksightInclination","backsightInclinationCorrected","azmUnit","formatAngleUnit","azimuthUnit","incUnit","inclinationUnit","getMonth","getDate","getFullYear","unit","Length","meters","feet","inches","Error","Angle","degrees","gradians"],"sources":["../../src/survey/formatFrcsSurveyFile.ts"],"sourcesContent":["import { Angle, Length, Unit } from '@speleotica/unitized'\nimport type { FrcsSurveyFile, FrcsUnits } from './FrcsSurveyFile'\nimport { makeFormatFrcsShot } from './formatFrcsShot'\n\nexport async function* formatFrcsSurveyFile(\n file: FrcsSurveyFile\n): AsyncIterable<string> {\n const formatFrcsShot = makeFormatFrcsShot(file)\n if (file.cave) {\n yield ` ${file.cave}${file.location ? `, ${file.location}` : ''}\\n`\n }\n for (let tripIndex = 0; tripIndex < file.trips.length; tripIndex++) {\n const trip = file.trips[tripIndex]\n const { shots, header, units } = trip\n const { name, team, date, comment } = header\n if (tripIndex > 0) yield ' *\\n'\n yield name.replace(/\\n?$/, '\\n')\n const line2 = [\n ...(team?.length ? [team.join(', ')] : []),\n ...(date ? [formatDate(date)] : []),\n ].join('. ')\n if (line2) yield `${line2}\\n`\n if (comment) yield comment.replace(/\\n?$/, '\\n')\n yield ' *\\n'\n yield formatUnits(units)\n\n let alternateUnits: FrcsUnits | undefined\n\n for (let i = 0; i < shots.length; i++) {\n const shot = shots[i]\n if (shot.comment) {\n const lines = shot.comment.split(/\\n/gm)\n yield '*\\n'\n for (let i = 0; i < lines.length - 1; i++) {\n yield lines[i].replace(/\\n?$/, '\\n')\n }\n yield `* ${lines[lines.length - 1].replace(/\\n?$/, '\\n')}`\n }\n if (shot.recorded?.units) {\n alternateUnits = shot.recorded.units\n yield `* %NC\\n`\n yield formatUnits(shot.recorded.units)\n }\n yield formatFrcsShot(\n shot.recorded || shot,\n alternateUnits || units\n ).replace(/\\n?$/, '\\n')\n }\n }\n}\n\nfunction formatUnits(units: FrcsUnits): string {\n const distUnit = formatLengthUnit(units.distanceUnit)\n const azmMode = units.hasBacksightAzimuth\n ? units.backsightAzimuthCorrected\n ? 'C'\n : 'B'\n : ' '\n const incMode = units.hasBacksightInclination\n ? units.backsightInclinationCorrected\n ? 'C'\n : 'B'\n : ' '\n const azmUnit = formatAngleUnit(units.azimuthUnit)\n const incUnit = formatAngleUnit(units.inclinationUnit)\n\n return `${distUnit} ${azmMode}${incMode} ${azmUnit}${incUnit}\\n`\n}\n\nfunction formatDate(date: Date): string {\n return `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear() % 100}`\n}\n\nfunction formatLengthUnit(unit: Unit<Length>): string {\n switch (unit) {\n case Length.meters:\n return 'M '\n case Length.feet:\n return 'FT'\n case Length.inches:\n return 'FI'\n default:\n throw new Error(`invalid length unit: ${unit}`)\n }\n}\n\nfunction formatAngleUnit(unit: Unit<Angle>): string {\n switch (unit) {\n case Angle.degrees:\n return 'D'\n case Angle.gradians:\n return 'G'\n default:\n throw new Error(`invalid angle unit: ${unit}`)\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AAEO,gBAAgBE,oBAAoBA,CACzCC,IAAoB,EACG;EACvB,MAAMC,cAAc,GAAG,IAAAC,kCAAkB,EAACF,IAAI,CAAC;EAC/C,IAAIA,IAAI,CAACG,IAAI,EAAE;IACb,MAAM,SAASH,IAAI,CAACG,IAAI,GAAGH,IAAI,C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AAO,IAAI;AAClE;AAEA,SAASpB,UAAUA,CAACL,IAAU,EAAU;EACtC,OAAO,GAAGA,IAAI,CAAC2B,QAAQ,CAAC,CAAC,GAAG,CAAC,IAAI3B,IAAI,CAAC4B,OAAO,CAAC,CAAC,IAAI5B,IAAI,CAAC6B,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE;AAC/E;AAEA,SAASf,gBAAgBA,CAACgB,IAAkB,EAAU;EACpD,QAAQA,IAAI;IACV,KAAKC,gBAAM,CAACC,MAAM;MAChB,OAAO,IAAI;IACb,KAAKD,gBAAM,CAACE,IAAI;MACd,OAAO,IAAI;IACb,KAAKF,gBAAM,CAACG,MAAM;MAChB,OAAO,IAAI;IACb;MACE,MAAM,IAAIC,KAAK,CAAC,wBAAwBL,IAAI,EAAE,CAAC;EACnD;AACF;AAEA,SAASP,eAAeA,CAACO,IAAiB,EAAU;EAClD,QAAQA,IAAI;IACV,KAAKM,eAAK,CAACC,OAAO;MAChB,OAAO,GAAG;IACZ,KAAKD,eAAK,CAACE,QAAQ;MACjB,OAAO,GAAG;IACZ;MACE,MAAM,IAAIH,KAAK,CAAC,uBAAuBL,IAAI,EAAE,CAAC;EAClD;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FrcsShotColumnConfig } from './FrcsSurveyFile';
|
|
2
|
+
type ColumnRanges = {
|
|
3
|
+
toStation: [number, number];
|
|
4
|
+
fromStation: [number, number];
|
|
5
|
+
distance: [number, number];
|
|
6
|
+
distanceFeet: [number, number];
|
|
7
|
+
distanceInches: [number, number];
|
|
8
|
+
kind: [number, number];
|
|
9
|
+
exclude: [number, number];
|
|
10
|
+
frontsightAzimuth: [number, number];
|
|
11
|
+
backsightAzimuth: [number, number];
|
|
12
|
+
frontsightInclination: [number, number];
|
|
13
|
+
backsightInclination: [number, number];
|
|
14
|
+
left: [number, number];
|
|
15
|
+
right: [number, number];
|
|
16
|
+
up: [number, number];
|
|
17
|
+
down: [number, number];
|
|
18
|
+
};
|
|
19
|
+
export declare function getColumnRanges(config: FrcsShotColumnConfig): {
|
|
20
|
+
decimal: ColumnRanges;
|
|
21
|
+
feetAndInches: ColumnRanges;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=getColumnRanges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getColumnRanges.d.ts","sourceRoot":"","sources":["../../src/survey/getColumnRanges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,KAAK,YAAY,GAAG;IAClB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3B,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzB,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvB,CAAA;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG;IAC7D,OAAO,EAAE,YAAY,CAAA;IACrB,aAAa,EAAE,YAAY,CAAA;CAC5B,CA0DA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getColumnRanges = getColumnRanges;
|
|
7
|
+
function getColumnRanges(config) {
|
|
8
|
+
const decimal = {
|
|
9
|
+
toStation: [0, 0],
|
|
10
|
+
fromStation: [0, 0],
|
|
11
|
+
distance: [0, 0],
|
|
12
|
+
distanceFeet: [0, 0],
|
|
13
|
+
distanceInches: [0, 0],
|
|
14
|
+
kind: [0, 0],
|
|
15
|
+
exclude: [0, 0],
|
|
16
|
+
frontsightAzimuth: [0, 0],
|
|
17
|
+
backsightAzimuth: [0, 0],
|
|
18
|
+
frontsightInclination: [0, 0],
|
|
19
|
+
backsightInclination: [0, 0],
|
|
20
|
+
left: [0, 0],
|
|
21
|
+
right: [0, 0],
|
|
22
|
+
up: [0, 0],
|
|
23
|
+
down: [0, 0]
|
|
24
|
+
};
|
|
25
|
+
const feetAndInches = {
|
|
26
|
+
toStation: [0, 0],
|
|
27
|
+
fromStation: [0, 0],
|
|
28
|
+
distance: [0, 0],
|
|
29
|
+
distanceFeet: [0, 0],
|
|
30
|
+
distanceInches: [0, 0],
|
|
31
|
+
kind: [0, 0],
|
|
32
|
+
exclude: [0, 0],
|
|
33
|
+
frontsightAzimuth: [0, 0],
|
|
34
|
+
backsightAzimuth: [0, 0],
|
|
35
|
+
frontsightInclination: [0, 0],
|
|
36
|
+
backsightInclination: [0, 0],
|
|
37
|
+
left: [0, 0],
|
|
38
|
+
right: [0, 0],
|
|
39
|
+
up: [0, 0],
|
|
40
|
+
down: [0, 0]
|
|
41
|
+
};
|
|
42
|
+
let c = 0;
|
|
43
|
+
for (const [key, value] of Object.entries(config)) {
|
|
44
|
+
if (key === 'distanceFeet' || key === 'distanceInches') continue;
|
|
45
|
+
decimal[key][0] = c;
|
|
46
|
+
decimal[key][1] = c + value;
|
|
47
|
+
c += value;
|
|
48
|
+
}
|
|
49
|
+
c = 0;
|
|
50
|
+
for (const [key, value] of Object.entries(config)) {
|
|
51
|
+
if (key === 'distance') continue;
|
|
52
|
+
const width = key === 'frontsightAzimuth' ? value - 1 : value;
|
|
53
|
+
feetAndInches[key][0] = c;
|
|
54
|
+
feetAndInches[key][1] = c + width;
|
|
55
|
+
c += width;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
decimal,
|
|
59
|
+
feetAndInches
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=getColumnRanges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getColumnRanges.js","names":["getColumnRanges","config","decimal","toStation","fromStation","distance","distanceFeet","distanceInches","kind","exclude","frontsightAzimuth","backsightAzimuth","frontsightInclination","backsightInclination","left","right","up","down","feetAndInches","c","key","value","Object","entries","width"],"sources":["../../src/survey/getColumnRanges.ts"],"sourcesContent":["import type { FrcsShotColumnConfig } from './FrcsSurveyFile'\n\ntype ColumnRanges = {\n toStation: [number, number]\n fromStation: [number, number]\n distance: [number, number]\n distanceFeet: [number, number]\n distanceInches: [number, number]\n kind: [number, number]\n exclude: [number, number]\n frontsightAzimuth: [number, number]\n backsightAzimuth: [number, number]\n frontsightInclination: [number, number]\n backsightInclination: [number, number]\n left: [number, number]\n right: [number, number]\n up: [number, number]\n down: [number, number]\n}\n\nexport function getColumnRanges(config: FrcsShotColumnConfig): {\n decimal: ColumnRanges\n feetAndInches: ColumnRanges\n} {\n const decimal: ColumnRanges = {\n toStation: [0, 0],\n fromStation: [0, 0],\n distance: [0, 0],\n distanceFeet: [0, 0],\n distanceInches: [0, 0],\n kind: [0, 0],\n exclude: [0, 0],\n frontsightAzimuth: [0, 0],\n backsightAzimuth: [0, 0],\n frontsightInclination: [0, 0],\n backsightInclination: [0, 0],\n left: [0, 0],\n right: [0, 0],\n up: [0, 0],\n down: [0, 0],\n }\n const feetAndInches: ColumnRanges = {\n toStation: [0, 0],\n fromStation: [0, 0],\n distance: [0, 0],\n distanceFeet: [0, 0],\n distanceInches: [0, 0],\n kind: [0, 0],\n exclude: [0, 0],\n frontsightAzimuth: [0, 0],\n backsightAzimuth: [0, 0],\n frontsightInclination: [0, 0],\n backsightInclination: [0, 0],\n left: [0, 0],\n right: [0, 0],\n up: [0, 0],\n down: [0, 0],\n }\n\n let c = 0\n for (const [key, value] of Object.entries(config) as [\n keyof FrcsShotColumnConfig,\n FrcsShotColumnConfig[keyof FrcsShotColumnConfig]\n ][]) {\n if (key === 'distanceFeet' || key === 'distanceInches') continue\n decimal[key][0] = c\n decimal[key][1] = c + value\n c += value\n }\n c = 0\n for (const [key, value] of Object.entries(config) as [\n keyof FrcsShotColumnConfig,\n FrcsShotColumnConfig[keyof FrcsShotColumnConfig]\n ][]) {\n if (key === 'distance') continue\n const width = key === 'frontsightAzimuth' ? value - 1 : value\n feetAndInches[key][0] = c\n feetAndInches[key][1] = c + width\n c += width\n }\n return { decimal, feetAndInches }\n}\n"],"mappings":";;;;;;AAoBO,SAASA,eAAeA,CAACC,MAA4B,EAG1D;EACA,MAAMC,OAAqB,GAAG;IAC5BC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACjBC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnBC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChBC,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACpBC,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACtBC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACZC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACfC,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC,CA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C,OAAO,CAACtB,MAAM,CAAC,EAG5C;IACH,IAAImB,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAK,gBAAgB,EAAE;IACxDlB,OAAO,CAACkB,GAAG,CAAC,CAAC,CAAC,CAAC,GAAGD,CAAC;IACnBjB,OAAO,CAACkB,GAAG,CAAC,CAAC,CAAC,CAAC,GAAGD,CAAC,GAAGE,KAAK;IAC3BF,CAAC,IAAIE,KAAK;EACZ;EACAF,CAAC,GAAG,CAAC;EACL,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACtB,MAAM,CAAC,EAG5C;IACH,IAAImB,GAAG,KAAK,UAAU,EAAE;IACxB,MAAMI,KAAK,GAAGJ,GAAG,KAAK,mBAAmB,GAAGC,KAAK,GAAG,CAAC,GAAGA,KAAK;IAC7DH,aAAa,CAACE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAGD,CAAC;IACzBD,aAAa,CAACE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAGD,CAAC,GAAGK,KAAK;IACjCL,CAAC,IAAIK,KAAK;EACZ;EACA,OAAO;IAAEtB,OAAO;IAAEgB;EAAc,CAAC;AACnC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeTeamMemberName.d.ts","sourceRoot":"","sources":["../../src/survey/normalizeTeamMemberName.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,UAMnD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.normalizeTeamMemberName = normalizeTeamMemberName;
|
|
7
|
+
function normalizeTeamMemberName(name) {
|
|
8
|
+
name = name.replace(/(\S)(\S*)/g, (match, head, tail) => match.toUpperCase() === match ? `${head}${tail.toLowerCase()}` : match);
|
|
9
|
+
name = name.replace(/_/g, ' ');
|
|
10
|
+
return name;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=normalizeTeamMemberName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeTeamMemberName.js","names":["normalizeTeamMemberName","name","replace","match","head","tail","toUpperCase","toLowerCase"],"sources":["../../src/survey/normalizeTeamMemberName.ts"],"sourcesContent":["export function normalizeTeamMemberName(name: string) {\n name = name.replace(/(\\S)(\\S*)/g, (match, head, tail) =>\n match.toUpperCase() === match ? `${head}${tail.toLowerCase()}` : match\n )\n name = name.replace(/_/g, ' ')\n return name\n}\n"],"mappings":";;;;;;AAAO,SAASA,uBAAuBA,CAACC,IAAY,EAAE;EACpDA,IAAI,GAAGA,IAAI,CAACC,OAAO,CAAC,YAAY,EAAE,CAACC,KAAK,EAAEC,IAAI,EAAEC,IAAI,KAClDF,KAAK,CAACG,WAAW,CAAC,CAAC,KAAKH,KAAK,GAAG,GAAGC,IAAI,GAAGC,IAAI,CAACE,WAAW,CAAC,CAAC,EAAE,GAAGJ,KACnE,CAAC;EACDF,IAAI,GAAGA,IAAI,CAACC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;EAC9B,OAAOD,IAAI;AACb","ignoreList":[]}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ParseFrcsSurveyFileOptions = {
|
|
3
|
-
columns?: FrcsShotColumnConfig;
|
|
4
|
-
};
|
|
1
|
+
import type { ParseFrcsSurveyFileOptions, FrcsSurveyFile, InvalidFrcsSurveyFile } from './FrcsSurveyFile';
|
|
5
2
|
/**
|
|
6
3
|
* Parses a raw cdata.fr survey file. These look like so:
|
|
7
4
|
*
|
|
@@ -48,5 +45,5 @@ export type ParseFrcsSurveyFileOptions = {
|
|
|
48
45
|
*
|
|
49
46
|
*/
|
|
50
47
|
export default function parseFrcsSurveyFile(file: any, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
51
|
-
|
|
48
|
+
chunks: Iterable<string> | AsyncIterable<string>, { columns, outputColumns, normalizeNames, suppressWarnings, }?: ParseFrcsSurveyFileOptions): Promise<FrcsSurveyFile | InvalidFrcsSurveyFile>;
|
|
52
49
|
//# sourceMappingURL=parseFrcsSurveyFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseFrcsSurveyFile.d.ts","sourceRoot":"","sources":["../../src/survey/parseFrcsSurveyFile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,0BAA0B,EAC1B,cAAc,EAId,qBAAqB,EAItB,MAAM,kBAAkB,CAAA;AA0BzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4CI;AACJ,wBAA8B,mBAAmB,CAC/C,IAAI,EAAE,GAAG,EAAE,yDAAyD;AACpE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,EAChD,EACE,OAAqC,EACrC,aAAqB,EACrB,cAAqB,EACrB,gBAAgB,GACjB,GAAE,0BAA+B,GACjC,OAAO,CAAC,cAAc,GAAG,qBAAqB,CAAC,CAovBjD"}
|