@speleotica/frcsdata 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FrcsPlotFile.d.ts +1 -0
- package/FrcsPlotFile.d.ts.map +1 -0
- package/FrcsPlotFile.js +2 -1
- package/FrcsPlotFile.js.map +1 -0
- package/FrcsPlotShot.d.ts +1 -0
- package/FrcsPlotShot.d.ts.map +1 -0
- package/FrcsPlotShot.js +2 -1
- package/FrcsPlotShot.js.map +1 -0
- package/FrcsShot.d.ts +1 -0
- package/FrcsShot.d.ts.map +1 -0
- package/FrcsShot.js +2 -1
- package/FrcsShot.js.map +1 -0
- package/FrcsSurveyFile.d.ts +1 -0
- package/FrcsSurveyFile.d.ts.map +1 -0
- package/FrcsSurveyFile.js +2 -1
- package/FrcsSurveyFile.js.map +1 -0
- package/FrcsTrip.d.ts +1 -0
- package/FrcsTrip.d.ts.map +1 -0
- package/FrcsTrip.js +2 -1
- package/FrcsTrip.js.map +1 -0
- package/FrcsTripSummary.d.ts +1 -0
- package/FrcsTripSummary.d.ts.map +1 -0
- package/FrcsTripSummary.js +2 -1
- package/FrcsTripSummary.js.map +1 -0
- package/FrcsTripSummaryFile.d.ts +1 -0
- package/FrcsTripSummaryFile.d.ts.map +1 -0
- package/FrcsTripSummaryFile.js +2 -1
- package/FrcsTripSummaryFile.js.map +1 -0
- package/formatFrcsShot.d.ts +1 -0
- package/formatFrcsShot.d.ts.map +1 -0
- package/formatFrcsShot.js +5 -5
- package/formatFrcsShot.js.map +1 -0
- package/formatFrcsSurveyFile.d.ts +1 -0
- package/formatFrcsSurveyFile.d.ts.map +1 -0
- package/formatFrcsSurveyFile.js +2 -1
- package/formatFrcsSurveyFile.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -0
- package/index.js +2 -1
- package/index.js.map +1 -0
- package/node/index.d.ts +1 -0
- package/node/index.d.ts.map +1 -0
- package/node/index.js +2 -1
- package/node/index.js.map +1 -0
- package/package.json +5 -2
- package/parseFrcsPlotFile.d.ts +1 -0
- package/parseFrcsPlotFile.d.ts.map +1 -0
- package/parseFrcsPlotFile.js +2 -1
- package/parseFrcsPlotFile.js.map +1 -0
- package/parseFrcsSurveyFile.d.ts +1 -0
- package/parseFrcsSurveyFile.d.ts.map +1 -0
- package/parseFrcsSurveyFile.js +5 -4
- package/parseFrcsSurveyFile.js.map +1 -0
- package/parseFrcsTripSummaryFile.d.ts +1 -0
- package/parseFrcsTripSummaryFile.d.ts.map +1 -0
- package/parseFrcsTripSummaryFile.js +2 -1
- package/parseFrcsTripSummaryFile.js.map +1 -0
- package/src/FrcsPlotFile.ts +9 -0
- package/src/FrcsPlotShot.ts +18 -0
- package/src/FrcsShot.ts +56 -0
- package/src/FrcsSurveyFile.ts +47 -0
- package/src/FrcsTrip.ts +25 -0
- package/src/FrcsTripSummary.ts +14 -0
- package/src/FrcsTripSummaryFile.ts +7 -0
- package/src/formatFrcsShot.ts +168 -0
- package/src/formatFrcsSurveyFile.ts +97 -0
- package/src/index.ts +29 -0
- package/src/node/index.ts +20 -0
- package/src/parseFrcsPlotFile.ts +168 -0
- package/src/parseFrcsSurveyFile.ts +788 -0
- package/src/parseFrcsTripSummaryFile.ts +76 -0
- package/src/string/index.ts +21 -0
- package/src/web/index.ts +119 -0
- package/string/index.d.ts +1 -0
- package/string/index.d.ts.map +1 -0
- package/string/index.js +2 -1
- package/string/index.js.map +1 -0
- package/web/index.d.ts +1 -0
- package/web/index.d.ts.map +1 -0
- package/web/index.js +5 -4
- package/web/index.js.map +1 -0
package/FrcsPlotFile.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsPlotFile.d.ts","sourceRoot":"","sources":["src/FrcsPlotFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEjD,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IACnC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAA;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;CACzC,CAAA"}
|
package/FrcsPlotFile.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsPlotFile.js","names":[],"sources":["src/FrcsPlotFile.ts"],"sourcesContent":["import { UnitizedNumber, Length } from '@speleotica/unitized'\nimport { FrcsPlotShot } from './FrcsPlotShot'\nimport { SegmentParseError } from 'parse-segment'\n\nexport type FrcsPlotFile = {\n totalLength: UnitizedNumber<Length>\n shots: Array<FrcsPlotShot>\n errors?: Array<SegmentParseError> | null\n}\n"],"mappings":"","ignoreList":[]}
|
package/FrcsPlotShot.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsPlotShot.d.ts","sourceRoot":"","sources":["src/FrcsPlotShot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7D,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAC/B,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAChC,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IACjC,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IACnC,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IACpC,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IACpC,aAAa,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IACrC,EAAE,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAC1B,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B,CAAA"}
|
package/FrcsPlotShot.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsPlotShot.js","names":[],"sources":["src/FrcsPlotShot.ts"],"sourcesContent":["import { UnitizedNumber, Length } from '@speleotica/unitized'\n\nexport type FrcsPlotShot = {\n toName: string\n isSurface?: boolean | null\n fromNumber: number\n toNumber: number\n easting: UnitizedNumber<Length>\n northing: UnitizedNumber<Length>\n elevation: UnitizedNumber<Length>\n leftEasting: UnitizedNumber<Length>\n leftNorthing: UnitizedNumber<Length>\n rightEasting: UnitizedNumber<Length>\n rightNorthing: UnitizedNumber<Length>\n up: UnitizedNumber<Length>\n down: UnitizedNumber<Length>\n tripNumber?: number | null\n}\n"],"mappings":"","ignoreList":[]}
|
package/FrcsShot.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsShot.d.ts","sourceRoot":"","sources":["src/FrcsShot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,oBAAY,YAAY;IACtB,MAAM,MAAM;IACZ,UAAU,MAAM;IAChB,QAAQ,MAAM;CACf;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,c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AQ,CAAC,EAAE,QAAQ,GAAG;QAAE,KAAK,CAAC,EAAE,SAAS,CAAA;KAAE,CAAA;CAC5C,CAAA"}
|
package/FrcsShot.js
CHANGED
package/FrcsShot.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsShot.js","names":["FrcsShotKind","exports"],"sources":["src/FrcsShot.ts"],"sourcesContent":["import { UnitizedNumber, Length, Angle } from '@speleotica/unitized'\nimport { FrcsUnits } from './FrcsTrip'\n\nexport enum FrcsShotKind {\n Normal = ' ',\n Horizontal = 'H',\n Diagonal = 'D',\n}\n\nexport type FrcsShot = {\n /**\n * Name of from station\n */\n from: string\n /**\n * Name of to station\n */\n to?: string | null\n kind: FrcsShotKind\n distance: UnitizedNumber<Length>\n horizontalDistance?: UnitizedNumber<Length> | null\n verticalDistance?: UnitizedNumber<Length> | null\n frontsightAzimuth?: UnitizedNumber<Angle> | null\n frontsightInclination?: UnitizedNumber<Angle> | null\n backsightAzimuth?: UnitizedNumber<Angle> | null\n backsightInclination?: UnitizedNumber<Angle> | null\n /**\n * LRUDs at from station\n */\n fromLruds?: {\n left?: UnitizedNumber<Length> | null\n right?: UnitizedNumber<Length> | null\n up?: UnitizedNumber<Length> | null\n down?: UnitizedNumber<Length> | null\n }\n /**\n * LRUDs at to station\n */\n toLruds?: {\n left?: UnitizedNumber<Length> | null\n right?: UnitizedNumber<Length> | null\n up?: UnitizedNumber<Length> | null\n down?: UnitizedNumber<Length> | null\n }\n excludeDistance?: boolean | null\n isSplay?: boolean | null\n comment?: string | null\n /**\n * In the edge case that the surveyors changed measurement units or\n * corrected/uncorrected backsights in the middle of a trip, the measurements\n * will be normalized to the initial trip settings, and this field will contain\n * the actual values recorded, verbatim. The first shot of the group with\n * changed units will include the changed units.\n */\n recorded?: FrcsShot & { units?: FrcsUnits }\n}\n"],"mappings":";;;;;;IAGYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAA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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsSurveyFile.js","names":["defaultFrcsShotColumnConfig","exports","toStation","fromStation","distance","distanceFeet","distanceInches","kind","exclude","frontsightAzimuth","backsightAzimuth","frontsightInclination","backsightInclination","left","right","up","down"],"sources":["src/FrcsSurveyFile.ts"],"sourcesContent":["import { FrcsTrip } from './FrcsTrip'\nimport { SegmentParseError } from 'parse-segment'\n\nexport type FrcsSurveyFile = {\n cave?: string | null\n columns?: FrcsShotColumnConfig\n location?: string | null\n comment?: string | null\n trips: Array<FrcsTrip>\n errors?: Array<SegmentParseError> | null\n}\n\nexport type FrcsShotColumnConfig = {\n toStation: number\n fromStation: number\n distance: number\n distanceFeet: number\n distanceInches: number\n kind: number\n exclude: number\n frontsightAzimuth: number\n backsightAzimuth: number\n frontsightInclination: number\n backsightInclination: number\n left: number\n right: number\n up: number\n down: number\n}\n\nexport const defaultFrcsShotColumnConfig: FrcsShotColumnConfig = {\n toStation: 5,\n fromStation: 5,\n distance: 6,\n distanceFeet: 4,\n distanceInches: 3,\n kind: 1,\n exclude: 1,\n frontsightAzimuth: 6,\n backsightAzimuth: 6,\n frontsightInclination: 5,\n backsightInclination: 5,\n left: 3,\n right: 3,\n up: 3,\n down: 3,\n}\n"],"mappings":";;;;;;AA8BO,IAAMA,2BAAiD,GAAAC,OAAA,CAAAD,2BAAA,GAAG;EAC/DE,SAAS,EAAE,CAAC;EACZC,WAAW,EAAE,CAAC;EACdC,QAAQ,EAAE,CAAC;EACXC,YAAY,EAAE,CAAC;EACfC,cAAc,EAAE,CAAC;EACjBC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,CAAC;EACVC,iBAAiB,EAAE,CAAC;EACpBC,gBAAgB,EAAE,CAAC;EACnBC,qBAAqB,EAAE,CAAC;EACxBC,oBAAoB,EAAE,CAAC;EACvBC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,EAAE,EAAE,CAAC;EACLC,IAAI,EAAE;AACR,CAAC","ignoreList":[]}
|
package/FrcsTrip.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsTrip.d.ts","sourceRoot":"","sources":["src/FrcsTrip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACxB,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IAC5B,yBAAyB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAC1C,6BAA6B,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAC9C,mBAAmB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACpC,uBAAuB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,cAAc,CAAA;IACtB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;CACvB,CAAA"}
|
package/FrcsTrip.js
CHANGED
package/FrcsTrip.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsTrip.js","names":[],"sources":["src/FrcsTrip.ts"],"sourcesContent":["import { Unit, Length, Angle } from '@speleotica/unitized'\nimport { FrcsShot } from './FrcsShot'\n\nexport type FrcsUnits = {\n distanceUnit: Unit<Length>\n azimuthUnit: Unit<Angle>\n inclinationUnit: Unit<Angle>\n backsightAzimuthCorrected?: boolean | null\n backsightInclinationCorrected?: boolean | null\n hasBacksightAzimuth?: boolean | null\n hasBacksightInclination?: boolean | null\n}\n\nexport type FrcsTripHeader = FrcsUnits & {\n name: string\n comment?: string | null\n section?: string | null\n date?: Date | null\n team?: Array<string> | null\n}\n\nexport type FrcsTrip = {\n header: FrcsTripHeader\n shots: Array<FrcsShot>\n}\n"],"mappings":"","ignoreList":[]}
|
package/FrcsTripSummary.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsTripSummary.d.ts","sourceRoot":"","sources":["src/FrcsTripSummary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,IAAI,CAAA;IACV,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IACtC,gBAAgB,EAAE,MAAM,CAAA;IACxB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CACrB,CAAA"}
|
package/FrcsTripSummary.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsTripSummary.js","names":[],"sources":["src/FrcsTripSummary.ts"],"sourcesContent":["import { UnitizedNumber, Length } from '@speleotica/unitized'\n\nexport type FrcsTripSummary = {\n tripNumber: number\n tripIndex: number\n date: Date\n totalLength: UnitizedNumber<Length>\n numShots: number\n name: string\n excludedLength: UnitizedNumber<Length>\n numExcludedShots: number\n team: Array<string>\n shots: Array<string>\n}\n"],"mappings":"","ignoreList":[]}
|
package/FrcsTripSummaryFile.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsTripSummaryFile.d.ts","sourceRoot":"","sources":["src/FrcsTripSummaryFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEjD,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IACxC,aAAa,EAAE,KAAK,CAAC,eAAe,GAAG,SAAS,CAAC,CAAA;CAClD,CAAA"}
|
package/FrcsTripSummaryFile.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrcsTripSummaryFile.js","names":[],"sources":["src/FrcsTripSummaryFile.ts"],"sourcesContent":["import { FrcsTripSummary } from './FrcsTripSummary'\nimport { SegmentParseError } from 'parse-segment'\n\nexport type FrcsTripSummaryFile = {\n errors?: Array<SegmentParseError> | null\n tripSummaries: Array<FrcsTripSummary | undefined>\n}\n"],"mappings":"","ignoreList":[]}
|
package/formatFrcsShot.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatFrcsShot.d.ts","sourceRoot":"","sources":["src/formatFrcsShot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAA;AAEnD,OAAO,EACL,oBAAoB,EAErB,MAAM,kBAAkB,CAAA;AAEzB,wBAAgB,kBAAkB,CAAC,EACjC,OAAqC,GACtC,GAAE;IAAE,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAAO,UAuFH,QAAQ,UAAU,SAAS,KAAG,MAAM,CAoE1E;;AAED,wBAAmC"}
|
package/formatFrcsShot.js
CHANGED
|
@@ -36,10 +36,9 @@ function makeFormatFrcsShot() {
|
|
|
36
36
|
return formatNum(num.get(verbatim ? num.unit : unit || num.unit));
|
|
37
37
|
}
|
|
38
38
|
if (num == null || !Number.isFinite(num)) return ' '.repeat(width);
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return trimZeroes(num.toFixed(2 - formatted.length + width)).padStart(width, ' ');
|
|
39
|
+
var precision = Math.max(0, width - String(Math.trunc(num)).length - 1);
|
|
40
|
+
var formatted = trimZeroes(num.toFixed(precision));
|
|
41
|
+
return formatted.length <= width ? formatted.padStart(width, ' ') : formatted.substring(0, width);
|
|
43
42
|
}
|
|
44
43
|
return formatNum;
|
|
45
44
|
};
|
|
@@ -93,4 +92,5 @@ function makeFormatFrcsShot() {
|
|
|
93
92
|
return [formatToStation(shot.to), formatFromStation(shot.from), inches ? formatFeet(distColumnValue) : formatDistance(distColumnValue, distanceUnit, isRecorded), inches ? formatInches(distColumnValue) : shot.kind, inches ? shot.kind : shot.excludeDistance ? '*' : ' ', formatFsAzimuth(shot.frontsightAzimuth, azimuthUnit, isRecorded), formatBsAzimuth(shot.backsightAzimuth, azimuthUnit, isRecorded), shot.kind === _FrcsShot.FrcsShotKind.Normal ? formatFsInclination(shot.frontsightInclination, inclinationUnit, isRecorded) : formatVerticalDistance(shot.verticalDistance, distanceUnit, isRecorded), shot.kind === _FrcsShot.FrcsShotKind.Normal ? formatBsInclination(shot.backsightInclination, inclinationUnit, isRecorded) : EMPTY_BS_INCLINATION, formatLeft((_shot$toLruds = shot.toLruds) === null || _shot$toLruds === void 0 ? void 0 : _shot$toLruds.left, distanceUnit, isRecorded), formatRight((_shot$toLruds2 = shot.toLruds) === null || _shot$toLruds2 === void 0 ? void 0 : _shot$toLruds2.right, distanceUnit, isRecorded), formatUp((_shot$toLruds3 = shot.toLruds) === null || _shot$toLruds3 === void 0 ? void 0 : _shot$toLruds3.up, distanceUnit, isRecorded), formatDown((_shot$toLruds4 = shot.toLruds) === null || _shot$toLruds4 === void 0 ? void 0 : _shot$toLruds4.down, distanceUnit, isRecorded)].join('');
|
|
94
93
|
};
|
|
95
94
|
}
|
|
96
|
-
var _default = exports["default"] = makeFormatFrcsShot();
|
|
95
|
+
var _default = exports["default"] = makeFormatFrcsShot();
|
|
96
|
+
//# sourceMappingURL=formatFrcsShot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatFrcsShot.js","names":["_FrcsShot","require","_unitized","_FrcsSurveyFile","makeFormatFrcsShot","_ref","arguments","length","undefined","_ref$columns","columns","defaultFrcsShotColumnConfig","EMPTY_TO_STATION","repeat","toStation","formatFromStation","station","fromStation","Error","concat","padStart","formatToStation","trimZeroes","str","match","exec","formatNumber","width","formatNum","num","unit","verbatim","UnitizedNumber","get","Number","isFinite","precision","Math","max","String","trunc","formatted","toFixed","substring","formatLeft","left","formatRight","right","formatUp","up","formatDown","down","EMPTY_DISTANCE","distance","formatDistance","EMPTY_FS_AZIMUTH","frontsightAzimuth","formatFsAzimuth","EMPTY_BS_AZIMUTH","backsightAzimuth","formatBsAzimuth","EMPTY_FS_INCLINATION","frontsightInclination","formatFsInclination","EMPTY_BS_INCLINATION","backsightInclination","formatBsInclination","formatVerticalDistance","EMPTY_FEET","distanceFeet","formatFeet","Length","feet","EMPTY_INCHES","distanceInches","formatInches","round","inches","formatFrcsShot","shot","header","_shot$toLruds","_shot$toLruds2","_shot$toLruds3","_shot$toLruds4","azimuthUnit","inclinationUnit","distanceUnit","isRecorded","recorded","to","_shot$recorded","_ref2","fromLruds","from","join","distColumnValue","kind","FrcsShotKind","Horizontal","horizontalDistance","excludeDistance","Normal","verticalDistance","toLruds","_default","exports"],"sources":["src/formatFrcsShot.ts"],"sourcesContent":["import { FrcsUnits } from './FrcsTrip'\nimport { FrcsShot, FrcsShotKind } from './FrcsShot'\nimport { Length, Unit, UnitType, UnitizedNumber } from '@speleotica/unitized'\nimport {\n FrcsShotColumnConfig,\n defaultFrcsShotColumnConfig,\n} from './FrcsSurveyFile'\n\nexport function makeFormatFrcsShot({\n columns = defaultFrcsShotColumnConfig,\n}: { columns?: FrcsShotColumnConfig } = {}) {\n const EMPTY_TO_STATION = ' '.repeat(columns.toStation)\n\n function formatFromStation(station: string): string {\n if (station.length > columns.fromStation) {\n throw new Error(`station is too long: ${station}`)\n }\n return station.padStart(columns.fromStation, ' ')\n }\n function formatToStation(station: string): string {\n if (station.length > columns.toStation) {\n throw new Error(`station is too long: ${station}`)\n }\n return station.padStart(columns.toStation, ' ')\n }\n\n function trimZeroes(str: string): string {\n const match = /(-?\\d+)(\\.[1-9]*)0+$/.exec(str)\n if (!match) return str\n return match[2].length > 1 ? match[1] + match[2] : match[1]\n }\n\n const formatNumber = (width: number) => {\n function formatNum(num: number | null | undefined): string\n function formatNum<T extends UnitType<T>>(\n num: UnitizedNumber<T> | null | undefined,\n unit: Unit<T>,\n verbatim?: boolean\n ): string\n function formatNum<T extends UnitType<T>>(\n num: number | UnitizedNumber<T> | null | undefined,\n unit?: Unit<T>,\n verbatim?: boolean\n ): string {\n if (num instanceof UnitizedNumber) {\n return formatNum(num.get(verbatim ? num.unit : unit || num.unit))\n }\n if (num == null || !Number.isFinite(num)) return ' '.repeat(width)\n const precision = Math.max(0, width - String(Math.trunc(num)).length - 1)\n const formatted = trimZeroes(num.toFixed(precision))\n return formatted.length <= width\n ? formatted.padStart(width, ' ')\n : formatted.substring(0, width)\n }\n return formatNum\n }\n\n const formatLeft = formatNumber(columns.left)\n const formatRight = formatNumber(columns.right)\n const formatUp = formatNumber(columns.up)\n const formatDown = formatNumber(columns.down)\n\n const EMPTY_DISTANCE = ' '.repeat(columns.distance)\n const formatDistance = formatNumber(columns.distance)\n\n const EMPTY_FS_AZIMUTH = ' '.repeat(columns.frontsightAzimuth)\n const formatFsAzimuth = formatNumber(columns.frontsightAzimuth)\n const EMPTY_BS_AZIMUTH = ' '.repeat(columns.backsightAzimuth)\n const formatBsAzimuth = formatNumber(columns.backsightAzimuth)\n\n const EMPTY_FS_INCLINATION = ' '.repeat(columns.frontsightInclination)\n const formatFsInclination = formatNumber(columns.frontsightInclination)\n const EMPTY_BS_INCLINATION = ' '.repeat(columns.backsightInclination)\n const formatBsInclination = formatNumber(columns.backsightInclination)\n\n const formatVerticalDistance = formatNumber(columns.frontsightInclination)\n\n const EMPTY_FEET = ' '.repeat(columns.distanceFeet)\n\n function formatFeet(distance: UnitizedNumber<Length> | null | void): string {\n if (!distance) return EMPTY_FEET\n return formatNumber(columns.distanceFeet)(\n Math.trunc(distance.get(Length.feet))\n )\n }\n\n const EMPTY_INCHES = ' '.repeat(columns.distanceInches)\n\n function formatInches(\n distance: UnitizedNumber<Length> | null | void\n ): string {\n if (!distance) return EMPTY_INCHES\n return formatNumber(columns.distanceInches)(\n Math.round(distance.get(Length.inches) % 12)\n )\n }\n\n return function formatFrcsShot(shot: FrcsShot, header: FrcsUnits): string {\n const { azimuthUnit, inclinationUnit } = header\n let { distanceUnit } = header\n\n const inches = distanceUnit === Length.inches\n if (inches) distanceUnit = Length.feet\n\n const isRecorded = shot.recorded !== null\n\n if (!shot.to) {\n const { left, right, up, down } =\n shot.recorded?.fromLruds || shot.fromLruds || {}\n return [\n EMPTY_TO_STATION,\n formatFromStation(shot.from),\n EMPTY_DISTANCE,\n ' ', // kind\n ' ', // exclude\n EMPTY_FS_AZIMUTH,\n EMPTY_BS_AZIMUTH,\n EMPTY_FS_INCLINATION,\n EMPTY_BS_INCLINATION,\n formatLeft(left, distanceUnit, isRecorded),\n formatRight(right, distanceUnit, isRecorded),\n formatUp(up, distanceUnit, isRecorded),\n formatDown(down, distanceUnit, isRecorded),\n ].join('')\n }\n\n const distColumnValue =\n shot.kind === FrcsShotKind.Horizontal\n ? shot.horizontalDistance\n : shot.distance\n\n return [\n formatToStation(shot.to),\n formatFromStation(shot.from),\n inches\n ? formatFeet(distColumnValue)\n : formatDistance(distColumnValue, distanceUnit, isRecorded),\n inches ? formatInches(distColumnValue) : shot.kind,\n inches ? shot.kind : shot.excludeDistance ? '*' : ' ',\n formatFsAzimuth(shot.frontsightAzimuth, azimuthUnit, isRecorded),\n formatBsAzimuth(shot.backsightAzimuth, azimuthUnit, isRecorded),\n shot.kind === FrcsShotKind.Normal\n ? formatFsInclination(\n shot.frontsightInclination,\n inclinationUnit,\n isRecorded\n )\n : formatVerticalDistance(\n shot.verticalDistance,\n distanceUnit,\n isRecorded\n ),\n shot.kind === FrcsShotKind.Normal\n ? formatBsInclination(\n shot.backsightInclination,\n inclinationUnit,\n isRecorded\n )\n : EMPTY_BS_INCLINATION,\n formatLeft(shot.toLruds?.left, distanceUnit, isRecorded),\n formatRight(shot.toLruds?.right, distanceUnit, isRecorded),\n formatUp(shot.toLruds?.up, distanceUnit, isRecorded),\n formatDown(shot.toLruds?.down, distanceUnit, isRecorded),\n ].join('')\n }\n}\n\nexport default makeFormatFrcsShot()\n"],"mappings":";;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAKO,SAASG,kBAAkBA,CAAA,EAEU;EAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAJ,CAAC,CAAC;IAAAG,YAAA,GAAAJ,IAAA,CADxCK,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAGE,2CAA2B,GAAAF,YAAA;EAErC,IAAMG,gBAAgB,GAAG,GAAG,CAACC,MAAM,CAACH,OAAO,CAACI,SAAS,CAAC;EAEtD,SAASC,iBAAiBA,CAACC,OAAe,EAAU;IAClD,IAAIA,OAAO,CAACT,MAAM,GAAGG,OAAO,CAACO,WAAW,EAAE;MACxC,MAAM,IAAIC,KAAK,yBAAAC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AI,CAAC,EAAE,CAAC;EACZ,CAAC;AACH;AAAC,IAAAU,QAAA,GAAAC,OAAA,cAEctG,kBAAkB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatFrcsSurveyFile.d.ts","sourceRoot":"","sources":["src/formatFrcsSurveyFile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIjD,wBAAuB,oBAAoB,CACzC,IAAI,EAAE,cAAc,GACnB,aAAa,CAAC,MAAM,CAAC,CA2CvB"}
|
package/formatFrcsSurveyFile.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatFrcsSurveyFile.js","names":["_unitized","require","_formatFrcsShot","formatFrcsSurveyFile","_x","_formatFrcsSurveyFile","apply","arguments","_wrapAsyncGenerator2","_regenerator","mark","_callee","file","formatFrcsShot","tripIndex","trip","shots","header","name","team","date","comment","line2","alternateUnits","i","_shot$recorded","shot","lines","_i","wrap","_callee$","_context","prev","next","makeFormatFrcsShot","cave","concat","location","trips","length","replace","_toConsumableArray2","join","formatDate","formatUnits","split","recorded","units","stop","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/formatFrcsSurveyFile.ts"],"sourcesContent":["import { Angle, Length, Unit } from '@speleotica/unitized'\nimport { FrcsSurveyFile } from './FrcsSurveyFile'\nimport { FrcsUnits } from './FrcsTrip'\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 } = 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(header)\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 || header\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;AAGA,IAAAC,eAAA,GAAAD,OAAA;AAAqD,SAE9BE,oBAAoBA,CAAAC,EAAA;EAAA,OAAAC,qBAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAF,sBAAA;EAAAA,qBAAA,OAAAG,oBAAA,2BAAAC,YAAA,YAAAC,IAAA,CAApC,SAAAC,QACLC,IAAoB;IAAA,IAAAC,cAAA,EAAAC,SAAA,EAAAC,IAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,IAAA,EAAAC,IAAA,EAAAC,IAAA,EAAAC,OAAA,EAAAC,KAAA,EAAAC,cAAA,EAAAC,CAAA,EAAAC,cAAA,EAAAC,IAAA,EAAAC,KAAA,EAAAC,EAAA;IAAA,OAAAnB,YAAA,YAAAoB,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAEdpB,cAAc,GAAG,IAAAqB,kCAAkB,EAACtB,IAAI,CAAC;UAAA,KAC3CA,IAAI,CAACuB,IAAI;YAAAJ,QAAA,CAAAE,IAAA;YAAA;UAAA;UAAAF,QAAA,CAAAE,IAAA;UACX,gBAAAG,MAAA,CAAexB,IAAI,CAACuB,IAAI,EAAAC,MAAA,CAAGxB,IAAI,CAACyB,QAAQ,QAAAD,MAAA,CAAQxB,IAAI,CAACyB,QAAQ,IAAK,EAAE;QAAI;UAEjEvB,SAAS,GAAG,CAAC;QAAA;UAAA,MAAEA,SAAS,GAAGF,IAAI,CAAC0B,KAAK,CAACC,MAAM;YAAAR,QAAA,CAAAE,IAAA;YAAA;UAAA;UAC7ClB,IAAI,GAAGH,IAAI,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,IAAI;IACb,KAAKD,gBAAM,CAACE,IAAI;MACd,OAAO,IAAI;IACb,KAAKF,gBAAM,CAACG,MAAM;MAChB,OAAO,IAAI;IACb;MACE,MAAM,IAAIC,KAAK,yBAAAnC,MAAA,CAAyB8B,IAAI,CAAE,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,wBAAAnC,MAAA,CAAwB8B,IAAI,CAAE,CAAC;EAClD;AACF","ignoreList":[]}
|
package/index.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ import parseFrcsTripSummaryFile from './parseFrcsTripSummaryFile';
|
|
|
11
11
|
import formatFrcsShot from './formatFrcsShot';
|
|
12
12
|
import { formatFrcsSurveyFile } from './formatFrcsSurveyFile';
|
|
13
13
|
export { FrcsShot, FrcsShotKind, FrcsSurveyFile, FrcsTrip, FrcsTripHeader, parseFrcsSurveyFile, FrcsPlotShot, FrcsPlotFile, parseFrcsPlotFile, FrcsTripSummary, FrcsTripSummaryFile, parseFrcsTripSummaryFile, formatFrcsShot, formatFrcsSurveyFile, };
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AACvD,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,kBAAkB,CAAA;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,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
|
@@ -99,4 +99,5 @@ var _FrcsTripSummary = require("./FrcsTripSummary.js");
|
|
|
99
99
|
var _FrcsTripSummaryFile = require("./FrcsTripSummaryFile.js");
|
|
100
100
|
var _parseFrcsTripSummaryFile = _interopRequireDefault(require("./parseFrcsTripSummaryFile.js"));
|
|
101
101
|
var _formatFrcsShot = _interopRequireDefault(require("./formatFrcsShot.js"));
|
|
102
|
-
var _formatFrcsSurveyFile = require("./formatFrcsSurveyFile.js");
|
|
102
|
+
var _formatFrcsSurveyFile = require("./formatFrcsSurveyFile.js");
|
|
103
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_FrcsTrip","require","_FrcsShot","_FrcsSurveyFile","_parseFrcsSurveyFile","_interopRequireDefault","_FrcsPlotShot","_FrcsPlotFile","_parseFrcsPlotFile","_FrcsTripSummary","_FrcsTripSummaryFile","_parseFrcsTripSummaryFile","_formatFrcsShot","_formatFrcsSurveyFile"],"sources":["src/index.ts"],"sourcesContent":["import { FrcsTrip, FrcsTripHeader } from './FrcsTrip'\nimport { FrcsShot, FrcsShotKind } from './FrcsShot'\nimport { FrcsSurveyFile } from './FrcsSurveyFile'\nimport parseFrcsSurveyFile from './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 './formatFrcsShot'\nimport { formatFrcsSurveyFile } from './formatFrcsSurveyFile'\n\nexport {\n FrcsShot,\n FrcsShotKind,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,gBAAA,GAAAR,OAAA;AACA,IAAAS,oBAAA,GAAAT,OAAA;AACA,IAAAU,yBAAA,GAAAN,sBAAA,CAAAJ,OAAA;AACA,IAAAW,eAAA,GAAAP,sBAAA,CAAAJ,OAAA;AACA,IAAAY,qBAAA,GAAAZ,OAAA","ignoreList":[]}
|
package/node/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const parseFrcsSurveyFile: (file: string, rest_0?: import("../parseFrcsSurveyFile").ParseFrcsSurveyFileOptions | undefined) => Promise<import("..").FrcsSurveyFile>;
|
|
2
2
|
export declare const parseFrcsPlotFile: (file: string) => Promise<import("..").FrcsPlotFile>;
|
|
3
3
|
export declare const parseFrcsTripSummaryFile: (file: string) => Promise<import("..").FrcsTripSummaryFile>;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,mBAAmB,SAHvB,MAAM,2HAGiD,CAAA;AAChE,eAAO,MAAM,iBAAiB,SAJrB,MAAM,uCAI6C,CAAA;AAC5D,eAAO,MAAM,wBAAwB,SAL5B,MAAM,8CAK2D,CAAA"}
|
package/node/index.js
CHANGED
|
@@ -20,4 +20,5 @@ var convert = function convert(fn) {
|
|
|
20
20
|
};
|
|
21
21
|
var parseFrcsSurveyFile = exports.parseFrcsSurveyFile = convert(_parseFrcsSurveyFile2["default"]);
|
|
22
22
|
var parseFrcsPlotFile = exports.parseFrcsPlotFile = convert(_parseFrcsPlotFile2["default"]);
|
|
23
|
-
var parseFrcsTripSummaryFile = exports.parseFrcsTripSummaryFile = convert(_parseFrcsTripSummaryFile2["default"]);
|
|
23
|
+
var parseFrcsTripSummaryFile = exports.parseFrcsTripSummaryFile = convert(_parseFrcsTripSummaryFile2["default"]);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_fs","_interopRequireDefault","require","_readline","_parseFrcsSurveyFile2","_parseFrcsPlotFile2","_parseFrcsTripSummaryFile2","convert","fn","file","_len","arguments","length","rest","Array","_key","apply","readline","createInterface","fs","createReadStream","concat","parseFrcsSurveyFile","exports","_parseFrcsSurveyFile","parseFrcsPlotFile","_parseFrcsPlotFile","parseFrcsTripSummaryFile","_parseFrcsTripSummaryFile"],"sources":["../../src/node/index.ts"],"sourcesContent":["import fs from 'fs'\nimport readline from 'readline'\nimport _parseFrcsSurveyFile from '../parseFrcsSurveyFile'\nimport _parseFrcsPlotFile from '../parseFrcsPlotFile'\nimport _parseFrcsTripSummaryFile from '../parseFrcsTripSummaryFile'\n\nconst convert =\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\nexport const parseFrcsSurveyFile = convert(_parseFrcsSurveyFile)\nexport const parseFrcsPlotFile = convert(_parseFrcsPlotFile)\nexport const parseFrcsTripSummaryFile = convert(_parseFrcsTripSummaryFile)\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,IAAMK,OAAO,GACX,SADIA,OAAOA,CAETC,EAIe;EAAA,OAEjB,UAACC,IAAY;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAKC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAJF,IAAI,CAAAE,IAAA,QAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAA,OACpBP,EAAE,CAAAQ,KAAA,UAACP,IAAI,EAAEQ,oBAAQ,CAACC,eAAe,CAACC,cAAE,CAACC,gBAAgB,CAACX,IAAI,CAAC,CAAC,EAAAY,MAAA,CAAKR,IAAI,EAAC;EAAA;AAAA;AAEnE,IAAMS,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGf,OAAO,CAACiB,gCAAoB,CAAC;AACzD,IAAMC,iBAAiB,GAAAF,OAAA,CAAAE,iBAAA,GAAGlB,OAAO,CAACmB,8BAAkB,CAAC;AACrD,IAAMC,wBAAwB,GAAAJ,OAAA,CAAAI,wBAAA,GAAGpB,OAAO,CAACqB,qCAAyB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speleotica/frcsdata",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"description": "parser for Chip Hopper's survey data format used in Fisher Ridge Cave System",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -52,5 +52,8 @@
|
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=16"
|
|
54
54
|
},
|
|
55
|
-
"packageManager": "pnpm@8.11.0"
|
|
55
|
+
"packageManager": "pnpm@8.11.0",
|
|
56
|
+
"@jcoreio/toolchain": {
|
|
57
|
+
"migratedVersion": "4.9.0"
|
|
58
|
+
}
|
|
56
59
|
}
|
package/parseFrcsPlotFile.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ import { FrcsPlotFile } from './FrcsPlotFile';
|
|
|
14
14
|
AE11 9 10 -1516 1289 -3919 -348 195 610 -342 50 10 1</pre>
|
|
15
15
|
*/
|
|
16
16
|
export default function parseFrcsPlotFile(file: string, lines: AsyncIterable<string>): Promise<FrcsPlotFile>;
|
|
17
|
+
//# sourceMappingURL=parseFrcsPlotFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseFrcsPlotFile.d.ts","sourceRoot":"","sources":["src/parseFrcsPlotFile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAI7C;;;;;;;;;;;;;GAaG;AACH,wBAA8B,iBAAiB,CAC7C,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,GAC3B,OAAO,CAAC,YAAY,CAAC,CAiJvB"}
|
package/parseFrcsPlotFile.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseFrcsPlotFile.js","names":["_unitized","require","_parseSegment","_asyncIterator","r","n","t","o","e","Symbol","asyncIterator","iterator","call","AsyncFromSyncIterator","TypeError","AsyncFromSyncIteratorContinuation","Object","Promise","reject","done","resolve","value","then","s","next","prototype","apply","arguments","_return","_throw","parseFrcsPlotFile","_x","_x2","_parseFrcsPlotFile","_asyncToGenerator2","_regenerator","mark","_callee","file","lines","totalLength","shots","errors","lineNumber","error","parseUint","parseOptionalUint","parseLength","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_step","line","toName","isSurface","fromNumber","toNumber","easting","northing","elevation","leftEasting","leftNorthing","rightEasting","rightNorthing","up","down","tripNumber","wrap","_callee$","_context","prev","_parseLength","startColumn","endColumn","fieldName","divisor","str","substring","test","concat","parseFloat","isNaN","Unitize","feet","_parseOptionalUint","parseInt","_parseUint","NaN","message","push","SegmentParseError","Segment","source","startLine","startCol","sent","abrupt","trim","t0","finish","stop","module","exports","default"],"sources":["src/parseFrcsPlotFile.ts"],"sourcesContent":["import { FrcsPlotShot } from './FrcsPlotShot'\nimport { FrcsPlotFile } from './FrcsPlotFile'\nimport { Length, UnitizedNumber, Unitize } from '@speleotica/unitized'\nimport { Segment, SegmentParseError } from 'parse-segment'\n\n/**\n * Parses data from a calculated survey file. These look like so:\n<pre> 123.182259\n AE20 1 1 0 0 0 153 -257 -51 85 0 20 1\n AE19 1 2 653 402 -548 1046 -587 -174 97 0 200 1\n AE18 2 3 669 449 -3002 995 94 -597 -56 250 0 1\n AE17 3 4 539 1217 -2770 497 47 -298 -28 0 0 1\n AE16 4 5 544 1230 -3441 411 -284 -246 170 60 10 1\n AE15 5 6 1679 1663 -3833 0 0 -282 283 20 10 1\n AE14 6 7 2026 2617 -3730 446 225 -446 -225 0 30 1\n AE13 7 8 391 3152 -5788 -111 691 0 0 200 50 1\n AE12 8 9 -1019 2175 -4630 -369 336 221 -201 40 40 1\n AE11 9 10 -1516 1289 -3919 -348 195 610 -342 50 10 1</pre>\n */\nexport default async function parseFrcsPlotFile(\n file: string,\n lines: AsyncIterable<string>\n): Promise<FrcsPlotFile> {\n let totalLength: UnitizedNumber<Length> = Unitize.feet(NaN)\n const shots: Array<FrcsPlotShot> = []\n const errors: Array<SegmentParseError> = []\n\n let lineNumber = 0\n\n const error = (\n message: string,\n line: string,\n startColumn: number,\n endColumn: number\n ): void => {\n errors.push(\n new SegmentParseError(\n message,\n new Segment({\n value: line,\n source: file,\n startLine: lineNumber - 1,\n startCol: 0,\n }).substring(startColumn, endColumn)\n )\n )\n }\n\n function parseUint(\n line: string,\n startColumn: number,\n endColumn: number,\n fieldName: string\n ): number | null {\n const str = line.substring(startColumn, endColumn)\n if (!/\\S/.test(str)) {\n error(`Missing ${fieldName}`, line, startColumn, endColumn)\n return null\n }\n if (!/^\\s*\\d+\\s*$/.test(str)) {\n error(`Invalid ${fieldName}`, line, startColumn, endColumn)\n return null\n }\n return parseInt(str)\n }\n\n function parseOptionalUint(\n line: string,\n startColumn: number,\n endColumn: number,\n fieldName: string\n ): number | null {\n const str = line.substring(startColumn, endColumn)\n if (!/\\S/.test(str)) {\n return null\n }\n if (!/^\\s*\\d+\\s*$/.test(str)) {\n error(`Invalid ${fieldName}`, line, startColumn, endColumn)\n return null\n }\n return parseInt(str)\n }\n\n function parseLength(\n line: string,\n startColumn: number,\n endColumn: number,\n fieldName: string,\n divisor: number\n ): UnitizedNumber<Length> | null {\n const str = line.substring(startColumn, endColumn)\n if (!/^\\s*-?\\d+\\s*$/.test(str)) {\n error(`Invalid ${fieldName}`, line, startColumn, endColumn)\n return null\n }\n const value = parseFloat(str)\n if (isNaN(value)) {\n error(`Missing ${fieldName}`, line, startColumn, endColumn)\n return null\n }\n return Unitize.feet(value / divisor)\n }\n\n for await (const line of lines) {\n lineNumber++\n if (lineNumber === 1) {\n totalLength = Unitize.feet(parseFloat(line))\n continue\n }\n if (!/\\S/.test(line)) continue\n const toName = line.substring(0, 6).trim()\n if (!toName) {\n error('Invalid to station name', line, 0, 6)\n continue\n }\n if (/[^ S]/.test(line[6])) {\n error('Invalid flag', line, 6, 7)\n continue\n }\n const isSurface = line[6] === 'S'\n const fromNumber = parseUint(line, 7, 12, 'from station number')\n if (fromNumber == null) continue\n const toNumber = parseUint(line, 12, 17, 'to station number')\n if (toNumber == null) continue\n const easting = parseLength(line, 17, 25, 'easting', 100)\n if (!easting) continue\n const northing = parseLength(line, 25, 33, 'northing', 100)\n if (!northing) continue\n const elevation = parseLength(line, 33, 40, 'elevation', 100)\n if (!elevation) continue\n const leftEasting = parseLength(line, 40, 46, 'left wall easting', 100)\n if (!leftEasting) continue\n const leftNorthing = parseLength(line, 46, 52, 'left wall northing', 100)\n if (!leftNorthing) continue\n const rightEasting = parseLength(line, 52, 58, 'right wall easting', 100)\n if (!rightEasting) continue\n const rightNorthing = parseLength(line, 58, 64, 'right wall northing', 100)\n if (!rightNorthing) continue\n const up = parseLength(line, 64, 68, 'up', 10)\n if (!up) continue\n const down = parseLength(line, 68, 72, 'down', 10)\n if (!down) continue\n const tripNumber = parseOptionalUint(line, 72, 78, 'trip number')\n\n shots.push({\n toName,\n isSurface,\n fromNumber,\n toNumber,\n easting,\n northing,\n elevation,\n leftEasting,\n leftNorthing,\n rightEasting,\n rightNorthing,\n up,\n down,\n tripNumber,\n })\n }\n\n return {\n totalLength,\n shots,\n errors,\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAA0D,SAAAE,eAAAC,CAAA,QAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,iCAAAC,MAAA,KAAAH,C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AC,IAAA;UAAA,KAAAtB,iBAAA;YAAAqB,QAAA,CAAA9C,IAAA;YAAA;UAAA;UAAA,MAAA0B,cAAA;QAAA;UAAA,OAAAoB,QAAA,CAAA8B,MAAA;QAAA;UAAA,OAAA9B,QAAA,CAAA8B,MAAA;QAAA;UAAA,OAAA9B,QAAA,CAAA2B,MAAA,WAGG;YACLzD,WAAW,EAAXA,WAAW;YACXC,KAAK,EAALA,KAAK;YACLC,MAAM,EAANA;UACF,CAAC;QAAA;QAAA;UAAA,OAAA4B,QAAA,CAAA+B,IAAA;MAAA;IAAA,GAAAhE,OAAA;EAAA,CACF;EAAA,OAAAJ,kBAAA,CAAAP,KAAA,OAAAC,SAAA;AAAA;AAAA2E,MAAA,CAAAC,OAAA,GAAAA,OAAA,CAAAC,OAAA","ignoreList":[]}
|
package/parseFrcsSurveyFile.d.ts
CHANGED
|
@@ -49,3 +49,4 @@ export type ParseFrcsSurveyFileOptions = {
|
|
|
49
49
|
*/
|
|
50
50
|
export default function parseFrcsSurveyFile(file: any, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
51
51
|
lines: AsyncIterable<string>, { columns }?: ParseFrcsSurveyFileOptions): Promise<FrcsSurveyFile>;
|
|
52
|
+
//# sourceMappingURL=parseFrcsSurveyFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseFrcsSurveyFile.d.ts","sourceRoot":"","sources":["src/parseFrcsSurveyFile.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,cAAc,EAEf,MAAM,kBAAkB,CAAA;AA8LzB,MAAM,MAAM,0BAA0B,GAAG;IAAE,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAAE,CAAA;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4CI;AACJ,wBAA8B,mBAAmB,CAC/C,IAAI,EAAE,GAAG,EAAE,yDAAyD;AACpE,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,EAAE,OAAqC,EAAE,GAAE,0BAA+B,GACzE,OAAO,CAAC,cAAc,CAAC,CA8hBzB"}
|
package/parseFrcsSurveyFile.js
CHANGED
|
@@ -142,11 +142,11 @@ function getColumnRanges(config) {
|
|
|
142
142
|
for (var _i = 0, _arr = Object.entries(config); _i < _arr.length; _i++) {
|
|
143
143
|
var _arr$_i = (0, _slicedToArray2["default"])(_arr[_i], 2),
|
|
144
144
|
key = _arr$_i[0],
|
|
145
|
-
|
|
145
|
+
value = _arr$_i[1];
|
|
146
146
|
if (key === 'distanceFeet' || key === 'distanceInches') continue;
|
|
147
147
|
result[key][0] = c;
|
|
148
|
-
result[key][1] = c +
|
|
149
|
-
c +=
|
|
148
|
+
result[key][1] = c + value;
|
|
149
|
+
c += value;
|
|
150
150
|
}
|
|
151
151
|
if (config.distanceFeet) {
|
|
152
152
|
result.distanceFeet[0] = result.distance[0];
|
|
@@ -808,4 +808,5 @@ function _parseFrcsSurveyFile() {
|
|
|
808
808
|
}));
|
|
809
809
|
return _parseFrcsSurveyFile.apply(this, arguments);
|
|
810
810
|
}
|
|
811
|
-
module.exports = exports.default;
|
|
811
|
+
module.exports = exports.default;
|
|
812
|
+
//# sourceMappingURL=parseFrcsSurveyFile.js.map
|