@pubid/pubid 0.1.16 → 0.1.18

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.
@@ -111,7 +111,10 @@ export function runFlavor(flavor, payloads, impl, pending) {
111
111
  }
112
112
  continue;
113
113
  }
114
- if (isQuarantined(testCase)) {
114
+ if (isQuarantined(testCase) || testCase.render_unreparseable === true) {
115
+ // render_unreparseable: the rendered human does not re-parse in the
116
+ // reference itself (the exporter's canonical-nil class) — no
117
+ // implementation can satisfy it; the row documents the raw fact.
115
118
  report.quarantined += 1;
116
119
  continue;
117
120
  }
@@ -34,6 +34,10 @@ export interface CorpusCase {
34
34
  nonNormalizedAliases?: Spelling[];
35
35
  /** Present only on exception (a documented round-trip failure). */
36
36
  roundtrip?: boolean;
37
+ /** The rendered human does not re-parse in the reference (canonical-nil):
38
+ * no implementation can satisfy parse(human) == identity — exempt like a
39
+ * quarantine (the corpus documents the raw-parse fact). */
40
+ render_unreparseable?: boolean;
37
41
  expect?: Expectation;
38
42
  /** Debt/negative rows carry the raw input instead of representations. */
39
43
  input?: string;
@@ -306,8 +306,27 @@ function normalizeRevisionNotation(input) {
306
306
  // strip rewrite here dropped the letters and is gone.
307
307
  return cleaned;
308
308
  }
309
+ const STAGE_MONTH_NUMBERS = {
310
+ January: "01", February: "02", March: "03", April: "04", May: "05",
311
+ June: "06", July: "07", August: "08", September: "09", Sept: "09",
312
+ October: "10", November: "11", December: "12", Jan: "01", Feb: "02",
313
+ Mar: "03", Apr: "04", Jun: "06", Jul: "07", Aug: "08", Sep: "09",
314
+ Oct: "10", Nov: "11", Dec: "12",
315
+ };
309
316
  function normalizeJointStageSpellings(input) {
310
317
  let cleaned = input;
318
+ // The IEEE-led joint list's dash/underscore stage tail carries a
319
+ // month-name date ("IEEE/ISO/IEC P29119-2-DIS, December 2011"): the
320
+ // generic route answers with a slashed copublisher, so re-spell the
321
+ // stage as the D= designator the joint route reads (Ruby:
322
+ // Parser.normalize_input). Scoped to the IEEE-led list - the
323
+ // ISO/IEC- and IEC/IEEE-led forms already render the face.
324
+ cleaned = cleaned.replace(/^(IEEE(?:\/(?:IEEE|ISO|IEC)){2,})\s+(P[A-Z0-9][A-Z0-9.-]*?)[-_](FDIS|FCD|CDV|DIS|CD|WD|PWI|NP)(\d*),\s+([A-Za-z]+)\s+(\d{4})$/, (_m, pubs, num, stage, iter, mon, year) => {
325
+ const month = STAGE_MONTH_NUMBERS[mon.charAt(0).toUpperCase() + mon.slice(1).toLowerCase()];
326
+ return month === undefined
327
+ ? _m
328
+ : `${pubs} ${num}/D=${stage}${iter}-${year}${month}`;
329
+ });
311
330
  const pubs = "((?:ISO/IEC/IEEE|IEEE/ISO/IEC|IEEE/IEC/ISO|ISO/IEEE|IEC/IEEE|IEEE/IEC|ISO/IEC)(?:/ ?| ))";
312
331
  const stage = "(FDIS|FCD|CDV|DIS\\d?|CD\\d?|WD|PWI|NP)";
313
332
  const num = "(P?\\d+(?:[.-]\\d+)?)";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pubid/pubid",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "TypeScript PubID identifiers: resolution, normalization and canonical hashes for every identifier in the pubid-testsuite corpus (41 standards bodies), with a conformance runner mirroring the Ruby reference",
5
5
  "type": "module",
6
6
  "license": "MIT",