@pubid/pubid 0.1.17 → 0.1.19

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,40 @@ 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 three-way ISO-led list glues the language marker to the year
319
+ // ("ISO/IEC/IEEE 8802-1AC-2018(E)"): the spaced spelling is the
320
+ // language marker and drops, the glued one prints as parenthetical
321
+ // content. Re-spell the boundary (Ruby: Parser.normalize_input).
322
+ // Scoped to the three-way lists - the two-way IEC/IEEE copublished
323
+ // form keeps its glued (E) as identity ("…:2012(E)").
324
+ cleaned = cleaned.replace(/^((?:ISO\/IEC\/IEEE|IEEE\/ISO\/IEC|IEEE\/IEC\/ISO)\s+[^()]+?[^()\s])\(E\)$/, "$1 (E)");
325
+ // The stage-first joint draft's dash part carries a bare comma year
326
+ // ("IEC/IEEE FDIS P60780-323, 2015"): the joint route takes no bare
327
+ // year there and the copublished route claims the string, so drop
328
+ // the non-identity year and let the stage-first route read the dash
329
+ // part (the rendered face is the dot human).
330
+ cleaned = cleaned.replace(/^((?:IEC\/IEEE|IEEE\/IEC)\s+(?:FDIS|FCD|CDV|DIS|CD|WD|PWI|NP)\s+P\d+(?:-\d+)+),\s+\d{4}$/, "$1");
331
+ // The IEEE-led joint list's dash/underscore stage tail carries a
332
+ // month-name date ("IEEE/ISO/IEC P29119-2-DIS, December 2011"): the
333
+ // generic route answers with a slashed copublisher, so re-spell the
334
+ // stage as the D= designator the joint route reads (Ruby:
335
+ // Parser.normalize_input). Scoped to the IEEE-led list - the
336
+ // ISO/IEC- and IEC/IEEE-led forms already render the face.
337
+ 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) => {
338
+ const month = STAGE_MONTH_NUMBERS[mon.charAt(0).toUpperCase() + mon.slice(1).toLowerCase()];
339
+ return month === undefined
340
+ ? _m
341
+ : `${pubs} ${num}/D=${stage}${iter}-${year}${month}`;
342
+ });
311
343
  const pubs = "((?:ISO/IEC/IEEE|IEEE/ISO/IEC|IEEE/IEC/ISO|ISO/IEEE|IEC/IEEE|IEEE/IEC|ISO/IEC)(?:/ ?| ))";
312
344
  const stage = "(FDIS|FCD|CDV|DIS\\d?|CD\\d?|WD|PWI|NP)";
313
345
  const num = "(P?\\d+(?:[.-]\\d+)?)";
@@ -104,7 +104,7 @@ export const UPDATE_CODES = [
104
104
  { plain: "ISO/IEC/IEEE DIS P16326/201x, December 2018", replacement: "ISO/IEC/IEEE DIS P16326-2018-12" },
105
105
  { plain: "ISO/IEC/IEEE/P21839, 2019(E)", replacement: "ISO/IEC/IEEE P21839-2019" },
106
106
  { plain: "ISO/IEC/IEEE CD2 P12207-2: 201x(E), February 2019", replacement: "ISO/IEC/IEEE CD2 P12207.2-2019-02" },
107
- { plain: "ISO/IEC/IEEE P42010.WD4:2019(E)", replacement: "ISO/IEC/IEEE P42010/D-4-2019" },
107
+ { plain: "ISO/IEC/IEEE P42010.WD4:2019(E)", replacement: "ISO/IEC/IEEE P42010.2019/D4" },
108
108
  { plain: "ISO/IEC/IEEE/P16085_DIS, March 2020", replacement: "ISO/IEC/IEEE DIS P16085-2020-03" },
109
109
  { plain: "ANSI/IEEE Std: Outdoor Apparatus Bushings", replacement: "ANSI/IEEE Std 21-1976-11" },
110
110
  { plain: "Draft National Electrical Safety Code, January 2016", replacement: "IEEE PC2-2016-01" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pubid/pubid",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
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",