@speleotica/frcsdata 5.0.0-beta.3 → 5.0.0-beta.5
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/cli/{check-survey-correspondence.d.ts → check-correspondence.d.ts} +1 -1
- package/cli/check-correspondence.d.ts.map +1 -0
- package/cli/{check-survey-correspondence.js → check-correspondence.js} +4 -5
- package/cli/check-correspondence.js.map +1 -0
- package/cli/{check-survey.d.ts → check.d.ts} +1 -1
- package/cli/check.d.ts.map +1 -0
- package/cli/{check-survey.js → check.js} +3 -3
- package/cli/check.js.map +1 -0
- package/cli/compareNames.d.ts +2 -0
- package/cli/compareNames.d.ts.map +1 -0
- package/cli/compareNames.js +15 -0
- package/cli/compareNames.js.map +1 -0
- package/cli/formatNamesFile.d.ts +4 -0
- package/cli/formatNamesFile.d.ts.map +1 -0
- package/cli/formatNamesFile.js +13 -0
- package/cli/formatNamesFile.js.map +1 -0
- package/cli/list-names.d.ts +5 -0
- package/cli/list-names.d.ts.map +1 -0
- package/cli/list-names.js +74 -0
- package/cli/list-names.js.map +1 -0
- package/cli/merge-names-files.d.ts +2 -0
- package/cli/merge-names-files.d.ts.map +1 -0
- package/cli/merge-names-files.js +25 -0
- package/cli/merge-names-files.js.map +1 -0
- package/cli/parse-survey.d.ts.map +1 -1
- package/cli/parse-survey.js +3 -2
- package/cli/parse-survey.js.map +1 -1
- package/cli/parseNamesFile.d.ts +4 -0
- package/cli/parseNamesFile.d.ts.map +1 -0
- package/cli/parseNamesFile.js +19 -0
- package/cli/parseNamesFile.js.map +1 -0
- package/cli/readFile.d.ts +2 -0
- package/cli/readFile.d.ts.map +1 -0
- package/cli/readFile.js +13 -0
- package/cli/readFile.js.map +1 -0
- package/cli/replace-names.d.ts +2 -0
- package/cli/replace-names.d.ts.map +1 -0
- package/cli/replace-names.js +45 -0
- package/cli/replace-names.js.map +1 -0
- package/cli/{summarize-survey.d.ts → summarize.d.ts} +1 -1
- package/cli/summarize.d.ts.map +1 -0
- package/cli/{summarize-survey.js → summarize.js} +3 -3
- package/cli/summarize.js.map +1 -0
- package/cli.js +72 -7
- package/cli.js.map +1 -1
- package/index.d.ts +8 -6
- package/index.d.ts.map +1 -1
- package/index.js +7 -28
- package/index.js.map +1 -1
- package/node/index.d.ts +1 -1
- package/node/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/replaceRanges.d.ts +6 -0
- package/replaceRanges.d.ts.map +1 -0
- package/replaceRanges.js +23 -0
- package/replaceRanges.js.map +1 -0
- package/src/cli/{check-survey-correspondence.ts → check-correspondence.ts} +6 -5
- package/src/cli/{check-survey.ts → check.ts} +2 -2
- package/src/cli/compareNames.ts +13 -0
- package/src/cli/formatNamesFile.ts +13 -0
- package/src/cli/list-names.ts +94 -0
- package/src/cli/merge-names-files.ts +18 -0
- package/src/cli/parse-survey.ts +3 -2
- package/src/cli/parseNamesFile.ts +10 -0
- package/src/cli/readFile.ts +6 -0
- package/src/cli/replace-names.ts +41 -0
- package/src/cli/{summarize-survey.ts → summarize.ts} +2 -2
- package/src/cli.ts +67 -7
- package/src/index.ts +22 -7
- package/src/replaceRanges.ts +21 -0
- package/src/survey/FrcsSurveyFile.ts +1 -0
- package/src/survey/ZodFrcsSurveyFileJson.ts +1 -0
- package/src/survey/normalizeTeamMemberName.ts +15 -3
- package/src/survey/parseFrcsSurveyFile.ts +210 -9
- package/string/index.d.ts +1 -1
- package/string/index.d.ts.map +1 -1
- package/survey/FrcsSurveyFile.d.ts +1 -0
- package/survey/FrcsSurveyFile.d.ts.map +1 -1
- package/survey/FrcsSurveyFile.js.map +1 -1
- package/survey/ZodFrcsSurveyFileJson.d.ts +283 -280
- package/survey/ZodFrcsSurveyFileJson.d.ts.map +1 -1
- package/survey/ZodFrcsSurveyFileJson.js +2 -1
- package/survey/ZodFrcsSurveyFileJson.js.map +1 -1
- package/survey/ZodFrcsSurveyFileToJson.d.ts +280 -280
- package/survey/normalizeTeamMemberName.d.ts +1 -0
- package/survey/normalizeTeamMemberName.d.ts.map +1 -1
- package/survey/normalizeTeamMemberName.js +11 -1
- package/survey/normalizeTeamMemberName.js.map +1 -1
- package/survey/parseFrcsSurveyFile.d.ts +1 -1
- package/survey/parseFrcsSurveyFile.d.ts.map +1 -1
- package/survey/parseFrcsSurveyFile.js +140 -13
- package/survey/parseFrcsSurveyFile.js.map +1 -1
- package/cli/check-survey-correspondence.d.ts.map +0 -1
- package/cli/check-survey-correspondence.js.map +0 -1
- package/cli/check-survey.d.ts.map +0 -1
- package/cli/check-survey.js.map +0 -1
- package/cli/summarize-survey.d.ts.map +0 -1
- package/cli/summarize-survey.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-survey-correspondence.js","names":["_chalk","_interopRequireDefault","require","_index","_promises","_summarizeSurvey","_index2","_formatFrcsTripSummaryFile","_util","checkSurveyCorrespondence","surveyFile","summaryFile","source","fs","readFile","parsedSurvey","parseFrcsSurveyFile","parsedSummaries","parseFrcsTripSummaryFile","indexBy","tripSummaries","sort","a","b","tripNumber","convertedSummaries","summarizeSurvey","ignoreVerticalOfHShots","errored","i","Math","max","length","parsed","converted","parsedLines","formatFrcsTripSummaryFile","slice","convertedLines","isDeepStrictEqual","console","log","map","line","chalk","green","join","red","process","exit"],"sources":["../../src/cli/check-survey-correspondence.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport chalk from 'chalk'\nimport { parseFrcsSurveyFile } from '../string/index'\nimport fs from 'fs/promises'\nimport { summarizeSurvey } from '../survey/summarizeSurvey'\nimport { parseFrcsTripSummaryFile } from '../node/index.js'\nimport { formatFrcsTripSummaryFile } from '../formatFrcsTripSummaryFile.js'\nimport { isDeepStrictEqual } from 'util'\n\nexport async function checkSurveyCorrespondence(\n surveyFile: string,\n summaryFile: string\n) {\n const source = await fs.readFile(surveyFile, 'utf8')\n const parsedSurvey = await parseFrcsSurveyFile(surveyFile, source)\n const parsedSummaries = (\n await parseFrcsTripSummaryFile(summaryFile, { indexBy: 'occurrence' })\n ).tripSummaries.sort((a, b) => (a?.tripNumber ?? 0) - (b?.tripNumber ?? 0))\n const convertedSummaries = summarizeSurvey(parsedSurvey, {\n ignoreVerticalOfHShots: true,\n }).tripSummaries.sort((a, b) => (a?.tripNumber ?? 0) - (b?.tripNumber ?? 0))\n\n let errored = false\n\n for (\n let i = 0;\n i < Math.max(parsedSummaries.length, convertedSummaries.length);\n i++\n ) {\n const parsed = parsedSummaries[i]\n const converted = convertedSummaries[i]\n\n const parsedLines = [\n ...formatFrcsTripSummaryFile({ tripSummaries: [parsed] }),\n ].slice(0, 2)\n const convertedLines = [\n ...formatFrcsTripSummaryFile({ tripSummaries: [converted] }),\n ].slice(0, 2)\n\n if (!isDeepStrictEqual(parsedLines, convertedLines)) {\n errored = true\n console.log(\n convertedLines.map((line) => chalk.green('+' + line)).join('\\n')\n )\n console.log(parsedLines.map((line) => chalk.red('-' + line)).join('\\n'))\n }\n }\n process.exit(errored ? 1 : 0)\n}\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,0BAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAPA;;AASO,eAAeO,yBAAyBA,CAC7CC,UAAkB,EAClBC,WAAmB,EACnB;EACA,MAAMC,MAAM,GAAG,MAAMC,iBAAE,CAACC,QAAQ,CAACJ,UAAU,EAAE,MAAM,CAAC;EACpD,MAAMK,YAAY,GAAG,MAAM,IAAAC,0BAAmB,EAACN,UAAU,EAAEE,MAAM,CAAC;EAClE,MAAMK,eAAe,GAAG,CACtB,MAAM,IAAAC,gCAAwB,EAACP,WAAW,EAAE;IAAEQ,OAAO,EAAE;EAAa,CAAC,CAAC,EACtEC,aAAa,CAACC,IAA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I,CACjE,CAAC;MACDN,OAAO,CAACC,GAAG,CAACN,WAAW,CAACO,GAAG,CAAEC,IAAI,IAAKC,cAAK,CAACG,GAAG,CAAC,GAAG,GAAGJ,IAAI,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1E;EACF;EACAE,OAAO,CAACC,IAAI,CAACrB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAC/B","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-survey.d.ts","sourceRoot":"","sources":["../../src/cli/check-survey.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,iBAgB7C"}
|
package/cli/check-survey.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-survey.js","names":["_promises","_interopRequireDefault","require","_parseFrcsSurveyFile","_chalk","_formatIssues","checkSurvey","file","source","fs","readFile","parsed","parseFrcsSurveyFile","issues","console","log","formatIssues","errorStyle","chalk","red","warningStyle","yellow","process","exit","some","i","type"],"sources":["../../src/cli/check-survey.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport fs from 'fs/promises'\nimport parseFrcsSurveyFile from '../survey/parseFrcsSurveyFile'\nimport chalk from 'chalk'\nimport { formatIssues } from '../formatIssues.js'\n\nexport async function checkSurvey(file: string) {\n const source = await fs.readFile(file, 'utf8')\n const parsed = await parseFrcsSurveyFile(file, [source])\n\n const issues = parsed.issues || []\n console.log(\n formatIssues({\n file,\n source,\n parsed,\n errorStyle: chalk.red,\n warningStyle: chalk.yellow,\n })\n )\n\n process.exit(issues.some((i) => i.type === 'error') ? 1 : 0)\n}\n"],"mappings":";;;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAJA;;AAMO,eAAeI,WAAWA,CAACC,IAAY,EAAE;EAC9C,MAAMC,MAAM,GAAG,MAAMC,iBAAE,CAACC,QAAQ,CAACH,IAAI,EAAE,MAAM,CAAC;EAC9C,MAAMI,MAAM,GAAG,MAAM,IAAAC,4BAAmB,EAACL,IAAI,EAAE,CAACC,MAAM,CAAC,CAAC;EAExD,MAAMK,MAAM,GAAGF,MAAM,CAACE,MAAM,IAAI,EAAE;EAClCC,OAAO,CAACC,GAAG,CACT,IAAAC,0BAAY,EAAC;IACXT,IAAI;IACJC,MAAM;IACNG,MAAM;IACNM,UAAU,EAAEC,cAAK,CAACC,GAAG;IACrBC,YAAY,EAAEF,cAAK,CAACG;EACtB,CAAC,CACH,CAAC;EAEDC,OAAO,CAACC,IAAI,CAACV,MAAM,CAACW,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC9D","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"summarize-survey.d.ts","sourceRoot":"","sources":["../../src/cli/summarize-survey.ts"],"names":[],"mappings":"AAQA,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,iBAmBjD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"summarize-survey.js","names":["_chalk","_interopRequireDefault","require","_formatIssues","_index","_promises","_formatFrcsTripSummaryFile","_summarizeSurvey","summarizeSurvey","file","source","fs","readFile","parsed","parseFrcsSurveyFile","console","log","formatIssues","errorStyle","chalk","red","warningStyle","yellow","process","exit","line","formatFrcsTripSummaryFile","baseSummarizeSurvey"],"sources":["../../src/cli/summarize-survey.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport chalk from 'chalk'\nimport { formatIssues } from '../formatIssues'\nimport { parseFrcsSurveyFile } from '../string/index'\nimport fs from 'fs/promises'\nimport { formatFrcsTripSummaryFile } from '../formatFrcsTripSummaryFile'\nimport { summarizeSurvey as baseSummarizeSurvey } from '../survey/summarizeSurvey'\n\nexport async function summarizeSurvey(file: string) {\n const source = await fs.readFile(file, 'utf8')\n const parsed = await parseFrcsSurveyFile(file, source)\n if ('INVALID' in parsed) {\n console.log(\n formatIssues({\n file,\n source,\n parsed,\n errorStyle: chalk.red,\n warningStyle: chalk.yellow,\n })\n )\n process.exit(1)\n }\n\n for (const line of formatFrcsTripSummaryFile(baseSummarizeSurvey(parsed))) {\n console.log(line)\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AANA;;AAQO,eAAeM,eAAeA,CAACC,IAAY,EAAE;EAClD,MAAMC,MAAM,GAAG,MAAMC,iBAAE,CAACC,QAAQ,CAACH,IAAI,EAAE,MAAM,CAAC;EAC9C,MAAMI,MAAM,GAAG,MAAM,IAAAC,0BAAmB,EAACL,IAAI,EAAEC,MAAM,CAAC;EACtD,IAAI,SAAS,IAAIG,MAAM,EAAE;IACvBE,OAAO,CAACC,GAAG,CACT,IAAAC,0BAAY,EAAC;MACXR,IAAI;MACJC,MAAM;MACNG,MAAM;MACNK,UAAU,EAAEC,cAAK,CAACC,GAAG;MACrBC,YAAY,EAAEF,cAAK,CAACG;IACtB,CAAC,CACH,CAAC;IACDC,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;EACjB;EAEA,KAAK,MAAMC,IAAI,IAAI,IAAAC,oDAAyB,EAAC,IAAAC,gCAAmB,EAACd,MAAM,CAAC,CAAC,EAAE;IACzEE,OAAO,CAACC,GAAG,CAACS,IAAI,CAAC;EACnB;AACF","ignoreList":[]}
|