@pubid/pubid 0.1.3 → 0.1.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/artifact/corpus.json.gz +0 -0
- package/dist/conformance/cli.js +5 -1
- package/dist/flavors/amca/grammar.d.ts +4 -0
- package/dist/flavors/amca/grammar.js +87 -0
- package/dist/flavors/amca/index.d.ts +4 -0
- package/dist/flavors/amca/index.js +76 -0
- package/dist/flavors/amca/model.d.ts +29 -0
- package/dist/flavors/amca/model.js +146 -0
- package/dist/flavors/ansi/index.d.ts +24 -0
- package/dist/flavors/ansi/index.js +147 -0
- package/dist/flavors/api/grammar.d.ts +4 -0
- package/dist/flavors/api/grammar.js +79 -0
- package/dist/flavors/api/index.d.ts +4 -0
- package/dist/flavors/api/index.js +71 -0
- package/dist/flavors/api/model.d.ts +27 -0
- package/dist/flavors/api/model.js +114 -0
- package/dist/flavors/ashrae/grammar.d.ts +2 -0
- package/dist/flavors/ashrae/grammar.js +667 -0
- package/dist/flavors/ashrae/index.d.ts +4 -0
- package/dist/flavors/ashrae/index.js +306 -0
- package/dist/flavors/ashrae/model.d.ts +87 -0
- package/dist/flavors/ashrae/model.js +335 -0
- package/dist/flavors/ashrae/preprocessor.d.ts +7 -0
- package/dist/flavors/ashrae/preprocessor.js +44 -0
- package/dist/flavors/asme/grammar.d.ts +2 -0
- package/dist/flavors/asme/grammar.js +200 -0
- package/dist/flavors/asme/index.d.ts +4 -0
- package/dist/flavors/asme/index.js +138 -0
- package/dist/flavors/asme/model.d.ts +34 -0
- package/dist/flavors/asme/model.js +123 -0
- package/dist/flavors/astm/grammar.d.ts +2 -0
- package/dist/flavors/astm/grammar.js +110 -0
- package/dist/flavors/astm/index.d.ts +2 -0
- package/dist/flavors/astm/index.js +127 -0
- package/dist/flavors/astm/model.d.ts +42 -0
- package/dist/flavors/astm/model.js +263 -0
- package/dist/flavors/bipm/index.d.ts +30 -0
- package/dist/flavors/bipm/index.js +434 -0
- package/dist/flavors/bsi/grammar.d.ts +4 -0
- package/dist/flavors/bsi/grammar.js +535 -0
- package/dist/flavors/bsi/index.d.ts +4 -0
- package/dist/flavors/bsi/index.js +941 -0
- package/dist/flavors/bsi/model.d.ts +127 -0
- package/dist/flavors/bsi/model.js +863 -0
- package/dist/flavors/calconnect/index.d.ts +21 -0
- package/dist/flavors/calconnect/index.js +113 -0
- package/dist/flavors/cen_cenelec/grammar.d.ts +4 -0
- package/dist/flavors/cen_cenelec/grammar.js +107 -0
- package/dist/flavors/cen_cenelec/index.d.ts +5 -0
- package/dist/flavors/cen_cenelec/index.js +263 -0
- package/dist/flavors/cen_cenelec/model.d.ts +45 -0
- package/dist/flavors/cen_cenelec/model.js +490 -0
- package/dist/flavors/cie/grammar.d.ts +5 -0
- package/dist/flavors/cie/grammar.js +127 -0
- package/dist/flavors/cie/index.d.ts +2 -0
- package/dist/flavors/cie/index.js +311 -0
- package/dist/flavors/cie/model.d.ts +122 -0
- package/dist/flavors/cie/model.js +464 -0
- package/dist/flavors/csa/grammar.d.ts +6 -0
- package/dist/flavors/csa/grammar.js +239 -0
- package/dist/flavors/csa/index.d.ts +2 -0
- package/dist/flavors/csa/index.js +634 -0
- package/dist/flavors/csa/model.d.ts +33 -0
- package/dist/flavors/csa/model.js +505 -0
- package/dist/flavors/doi/index.d.ts +13 -0
- package/dist/flavors/doi/index.js +65 -0
- package/dist/flavors/easc/index.d.ts +4 -0
- package/dist/flavors/easc/index.js +107 -0
- package/dist/flavors/ecma/index.d.ts +4 -0
- package/dist/flavors/ecma/index.js +117 -0
- package/dist/flavors/etsi/index.d.ts +14 -0
- package/dist/flavors/etsi/index.js +307 -0
- package/dist/flavors/evs/grammar.d.ts +2 -0
- package/dist/flavors/evs/grammar.js +22 -0
- package/dist/flavors/evs/index.d.ts +2 -0
- package/dist/flavors/evs/index.js +24 -0
- package/dist/flavors/evs/model.d.ts +19 -0
- package/dist/flavors/evs/model.js +36 -0
- package/dist/flavors/gb/index.d.ts +31 -0
- package/dist/flavors/gb/index.js +159 -0
- package/dist/flavors/gost/grammar.d.ts +2 -0
- package/dist/flavors/gost/grammar.js +46 -0
- package/dist/flavors/gost/index.d.ts +2 -0
- package/dist/flavors/gost/index.js +165 -0
- package/dist/flavors/gost/model.d.ts +61 -0
- package/dist/flavors/gost/model.js +147 -0
- package/dist/flavors/gost/prefix_routes.d.ts +15 -0
- package/dist/flavors/gost/prefix_routes.js +192 -0
- package/dist/flavors/iala/index.d.ts +32 -0
- package/dist/flavors/iala/index.js +300 -0
- package/dist/flavors/iana/index.d.ts +19 -0
- package/dist/flavors/iana/index.js +71 -0
- package/dist/flavors/idf/grammar.d.ts +2 -0
- package/dist/flavors/idf/grammar.js +71 -0
- package/dist/flavors/idf/index.d.ts +2 -0
- package/dist/flavors/idf/index.js +100 -0
- package/dist/flavors/idf/model.d.ts +54 -0
- package/dist/flavors/idf/model.js +359 -0
- package/dist/flavors/iec/grammar.d.ts +3 -0
- package/dist/flavors/iec/grammar.js +187 -0
- package/dist/flavors/iec/index.d.ts +4 -0
- package/dist/flavors/iec/index.js +507 -0
- package/dist/flavors/iec/model.d.ts +54 -0
- package/dist/flavors/iec/model.js +437 -0
- package/dist/flavors/ieee/grammar.d.ts +2 -0
- package/dist/flavors/ieee/grammar.js +697 -0
- package/dist/flavors/ieee/index.d.ts +3 -0
- package/dist/flavors/ieee/index.js +1258 -0
- package/dist/flavors/ieee/model.d.ts +144 -0
- package/dist/flavors/ieee/model.js +1237 -0
- package/dist/flavors/ieee/preprocessor.d.ts +8 -0
- package/dist/flavors/ieee/preprocessor.js +410 -0
- package/dist/flavors/ieee/update_codes.d.ts +8 -0
- package/dist/flavors/ieee/update_codes.js +197 -0
- package/dist/flavors/ietf/index.d.ts +30 -0
- package/dist/flavors/ietf/index.js +151 -0
- package/dist/flavors/iho/index.d.ts +4 -0
- package/dist/flavors/iho/index.js +126 -0
- package/dist/flavors/index.d.ts +9 -0
- package/dist/flavors/index.js +136 -0
- package/dist/flavors/isbn/index.d.ts +13 -0
- package/dist/flavors/isbn/index.js +97 -0
- package/dist/flavors/iso/grammar.d.ts +2 -0
- package/dist/flavors/iso/grammar.js +207 -0
- package/dist/flavors/iso/index.d.ts +2 -0
- package/dist/flavors/iso/index.js +343 -0
- package/dist/flavors/iso/model.d.ts +159 -0
- package/dist/flavors/iso/model.js +802 -0
- package/dist/flavors/iso/stages.generated.d.ts +13 -0
- package/dist/flavors/iso/stages.generated.js +391 -0
- package/dist/flavors/itu/grammar.d.ts +4 -0
- package/dist/flavors/itu/grammar.js +205 -0
- package/dist/flavors/itu/index.d.ts +2 -0
- package/dist/flavors/itu/index.js +224 -0
- package/dist/flavors/itu/model.d.ts +184 -0
- package/dist/flavors/itu/model.js +599 -0
- package/dist/flavors/jcgm/index.d.ts +7 -0
- package/dist/flavors/jcgm/index.js +300 -0
- package/dist/flavors/jis/index.d.ts +4 -0
- package/dist/flavors/jis/index.js +267 -0
- package/dist/flavors/nist/grammar.d.ts +2 -0
- package/dist/flavors/nist/grammar.js +287 -0
- package/dist/flavors/nist/index.d.ts +2 -0
- package/dist/flavors/nist/index.js +1244 -0
- package/dist/flavors/nist/model.d.ts +155 -0
- package/dist/flavors/nist/model.js +823 -0
- package/dist/flavors/nist/preprocessor.d.ts +11 -0
- package/dist/flavors/nist/preprocessor.js +281 -0
- package/dist/flavors/oasis/index.d.ts +23 -0
- package/dist/flavors/oasis/index.js +110 -0
- package/dist/flavors/ogc/index.d.ts +20 -0
- package/dist/flavors/ogc/index.js +75 -0
- package/dist/flavors/oiml/grammar.d.ts +2 -0
- package/dist/flavors/oiml/grammar.js +206 -0
- package/dist/flavors/oiml/implementation.d.ts +9 -0
- package/dist/flavors/oiml/implementation.js +45 -0
- package/dist/flavors/oiml/model.d.ts +23 -0
- package/dist/flavors/oiml/model.js +592 -0
- package/dist/flavors/omg/index.d.ts +14 -0
- package/dist/flavors/omg/index.js +73 -0
- package/dist/flavors/plateau/index.d.ts +4 -0
- package/dist/flavors/plateau/index.js +97 -0
- package/dist/flavors/tgpp/index.d.ts +4 -0
- package/dist/flavors/tgpp/index.js +122 -0
- package/dist/flavors/un/index.d.ts +13 -0
- package/dist/flavors/un/index.js +90 -0
- package/dist/flavors/w3c/index.d.ts +14 -0
- package/dist/flavors/w3c/index.js +148 -0
- package/dist/flavors/xsf/index.d.ts +18 -0
- package/dist/flavors/xsf/index.js +65 -0
- package/dist/grammar/engine.d.ts +78 -0
- package/dist/grammar/engine.js +351 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/model/attribute.d.ts +54 -0
- package/dist/model/attribute.js +53 -0
- package/dist/model/builder.d.ts +39 -0
- package/dist/model/builder.js +124 -0
- package/dist/model/component.d.ts +70 -0
- package/dist/model/component.js +170 -0
- package/dist/model/identifier.d.ts +84 -0
- package/dist/model/identifier.js +270 -0
- package/dist/model/urn-generator.d.ts +27 -0
- package/dist/model/urn-generator.js +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { BaseIdentifier, registerType } from "../../model/identifier.js";
|
|
2
|
+
import { extendAttributes, keyValue } from "../../model/attribute.js";
|
|
3
|
+
import { BaseUrnGenerator } from "../../model/urn-generator.js";
|
|
4
|
+
/**
|
|
5
|
+
* Port of lib/pubid/astm: the CodeNumber split columns (letter/number/
|
|
6
|
+
* suffix/subseries/dual_m) on every concrete class, the renderer family
|
|
7
|
+
* and the URN generator. Adjunct stores its designation directly in
|
|
8
|
+
* `number`.
|
|
9
|
+
*/
|
|
10
|
+
export class AstmCode {
|
|
11
|
+
letter;
|
|
12
|
+
number;
|
|
13
|
+
suffix;
|
|
14
|
+
subseries;
|
|
15
|
+
dualM;
|
|
16
|
+
constructor(attrs) {
|
|
17
|
+
this.letter = attrs["letter"];
|
|
18
|
+
this.number = attrs["number"];
|
|
19
|
+
this.suffix = attrs["suffix"];
|
|
20
|
+
this.subseries = attrs["subseries"];
|
|
21
|
+
this.dualM = attrs["dual_m"] === true;
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
if (this.letter !== undefined) {
|
|
25
|
+
let result = [this.letter, this.number, this.suffix]
|
|
26
|
+
.filter((s) => s !== undefined)
|
|
27
|
+
.join("");
|
|
28
|
+
if (this.subseries !== undefined)
|
|
29
|
+
result += `-S${this.subseries}`;
|
|
30
|
+
if (this.dualM)
|
|
31
|
+
result += "M";
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
let result = this.number ?? "";
|
|
35
|
+
if (this.suffix !== undefined)
|
|
36
|
+
result += this.suffix;
|
|
37
|
+
if (this.subseries !== undefined)
|
|
38
|
+
result += `-S${this.subseries}`;
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const CODE_COLUMN_DEFS = {
|
|
43
|
+
number: { type: "string" },
|
|
44
|
+
letter: { type: "string" },
|
|
45
|
+
suffix: { type: "string" },
|
|
46
|
+
subseries: { type: "string" },
|
|
47
|
+
dual_m: { type: "boolean", default: false },
|
|
48
|
+
};
|
|
49
|
+
const CODE_COLUMN_MAPPINGS = keyValue({ wire: "number", to: "number" }, { wire: "letter", to: "letter" }, { wire: "suffix", to: "suffix" }, { wire: "subseries", to: "subseries" }, { wire: "dual_m", to: "dual_m" });
|
|
50
|
+
export class AstmIdentifier extends BaseIdentifier {
|
|
51
|
+
static attributes = extendAttributes(BaseIdentifier, {
|
|
52
|
+
...CODE_COLUMN_DEFS,
|
|
53
|
+
publisher: { type: "string", default: "ASTM" },
|
|
54
|
+
year: { type: "string" },
|
|
55
|
+
format_suffix: { type: "string" },
|
|
56
|
+
type: { type: "string" },
|
|
57
|
+
});
|
|
58
|
+
static mappings = keyValue(...CODE_COLUMN_MAPPINGS, { wire: "publisher", to: "publisher" }, { wire: "year", to: "year" }, { wire: "format_suffix", to: "format_suffix" }, { wire: "type", to: "type" });
|
|
59
|
+
code() {
|
|
60
|
+
if (this.number === undefined && this.letter === undefined)
|
|
61
|
+
return undefined;
|
|
62
|
+
return new AstmCode({
|
|
63
|
+
letter: this.letter,
|
|
64
|
+
number: this.number,
|
|
65
|
+
suffix: this.suffix,
|
|
66
|
+
subseries: this.subseries,
|
|
67
|
+
dual_m: this.dual_m,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
toUrn() {
|
|
71
|
+
return new AstmUrnGenerator(this).generate();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function yearPortion(year) {
|
|
75
|
+
return year.length === 4 ? year.slice(-2) : year;
|
|
76
|
+
}
|
|
77
|
+
// --- Renderer -------------------------------------------------------------------
|
|
78
|
+
function renderStandard(id) {
|
|
79
|
+
const parts = [];
|
|
80
|
+
parts.push(id.publisher);
|
|
81
|
+
const code = id.code();
|
|
82
|
+
if (code !== undefined) {
|
|
83
|
+
let codeStr = code.render();
|
|
84
|
+
if (code.dualM) {
|
|
85
|
+
const baseCode = `${code.letter ?? ""}${code.number ?? ""}`;
|
|
86
|
+
codeStr = `${baseCode}/${baseCode}M`;
|
|
87
|
+
}
|
|
88
|
+
parts.push(codeStr);
|
|
89
|
+
}
|
|
90
|
+
let result = parts.join(" ");
|
|
91
|
+
const self = id;
|
|
92
|
+
if (id.year !== undefined) {
|
|
93
|
+
result += `-${yearPortion(id.year)}`;
|
|
94
|
+
if (self["sub_year"] !== undefined)
|
|
95
|
+
result += self["sub_year"];
|
|
96
|
+
}
|
|
97
|
+
if (self["reapproval"] !== undefined)
|
|
98
|
+
result += `(${self["reapproval"]})`;
|
|
99
|
+
if (self["edition"] !== undefined)
|
|
100
|
+
result += `e${self["edition"]}`;
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
// --- URN generator ---------------------------------------------------------------
|
|
104
|
+
class AstmUrnGenerator extends BaseUrnGenerator {
|
|
105
|
+
generate() {
|
|
106
|
+
const id = this.identifier;
|
|
107
|
+
const self = id;
|
|
108
|
+
// Ruby: ["urn", ns, type_segment?, code, ...] with the publisher
|
|
109
|
+
// replacing the namespace slot ("iso/astm" for ISO/ASTMTR).
|
|
110
|
+
const parts = ["urn", id.publisher.toLowerCase(), "std"];
|
|
111
|
+
const code = id.code();
|
|
112
|
+
if (code !== undefined)
|
|
113
|
+
parts.push(code.render());
|
|
114
|
+
if (id.year !== undefined)
|
|
115
|
+
parts.push(yearPortion(id.year));
|
|
116
|
+
if (self["sub_year"] !== undefined)
|
|
117
|
+
parts.push(String(self["sub_year"]));
|
|
118
|
+
if (self["reapproval"] !== undefined)
|
|
119
|
+
parts.push(`reapp.${self["reapproval"]}`);
|
|
120
|
+
if (self["edition"] !== undefined)
|
|
121
|
+
parts.push(`e${self["edition"]}`);
|
|
122
|
+
return parts.join(":");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function astmClass(spec) {
|
|
126
|
+
class AstmConcrete extends AstmIdentifier {
|
|
127
|
+
static polymorphicName = `pubid:astm:${spec.kind}`;
|
|
128
|
+
static urnGenerator = AstmUrnGenerator;
|
|
129
|
+
static get attributes() {
|
|
130
|
+
return spec.extraDefs === undefined
|
|
131
|
+
? AstmIdentifier.attributes
|
|
132
|
+
: extendAttributes(AstmIdentifier, spec.extraDefs);
|
|
133
|
+
}
|
|
134
|
+
static get mappings() {
|
|
135
|
+
return spec.extraDefs === undefined
|
|
136
|
+
? [...AstmIdentifier.mappings]
|
|
137
|
+
: [...AstmIdentifier.mappings,
|
|
138
|
+
...Object.keys(spec.extraDefs).map((name) => ({ wire: name, to: name }))];
|
|
139
|
+
}
|
|
140
|
+
render() {
|
|
141
|
+
return spec.render(this);
|
|
142
|
+
}
|
|
143
|
+
toUrn() {
|
|
144
|
+
return spec.urn !== undefined ? spec.urn(this) : super.toUrn();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
registerType(AstmConcrete);
|
|
148
|
+
return AstmConcrete;
|
|
149
|
+
}
|
|
150
|
+
export const StandardClass = astmClass({
|
|
151
|
+
kind: "standard",
|
|
152
|
+
extraDefs: {
|
|
153
|
+
sub_year: { type: "string" },
|
|
154
|
+
reapproval: { type: "string" },
|
|
155
|
+
edition: { type: "string" },
|
|
156
|
+
},
|
|
157
|
+
render: renderStandard,
|
|
158
|
+
});
|
|
159
|
+
export const IsoDualPublishedClass = astmClass({
|
|
160
|
+
kind: "iso-dual-published",
|
|
161
|
+
extraDefs: {
|
|
162
|
+
sub_year: { type: "string" },
|
|
163
|
+
reapproval: { type: "string" },
|
|
164
|
+
edition: { type: "string" },
|
|
165
|
+
},
|
|
166
|
+
render: renderStandard,
|
|
167
|
+
});
|
|
168
|
+
export const ResearchReportClass = astmClass({
|
|
169
|
+
kind: "research-report",
|
|
170
|
+
extraDefs: { committee: { type: "string" } },
|
|
171
|
+
render: (id) => [id.publisher, `RR:${id["committee"]}-${id.code()?.number}`].join(" "),
|
|
172
|
+
});
|
|
173
|
+
export const DataSeriesClass = astmClass({
|
|
174
|
+
kind: "data-series",
|
|
175
|
+
extraDefs: { hol_suffix: { type: "boolean" } },
|
|
176
|
+
render: (id) => {
|
|
177
|
+
const self = id;
|
|
178
|
+
let result = `${id.publisher} DS`;
|
|
179
|
+
result += id.code()?.render() ?? "";
|
|
180
|
+
if (self["hol_suffix"] === true)
|
|
181
|
+
result += "HOL";
|
|
182
|
+
if (id.format_suffix !== undefined)
|
|
183
|
+
result += id.format_suffix;
|
|
184
|
+
return result;
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
export const TechnicalReportClass = astmClass({
|
|
188
|
+
kind: "technical-report",
|
|
189
|
+
render: (id) => {
|
|
190
|
+
let result;
|
|
191
|
+
const code = id.code();
|
|
192
|
+
if (id.publisher === "ISO/ASTM" && (code === undefined || code.letter === undefined)) {
|
|
193
|
+
result = "ISO/ASTMTR";
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
result = "TR";
|
|
197
|
+
if (code?.letter !== undefined)
|
|
198
|
+
result += code.letter;
|
|
199
|
+
}
|
|
200
|
+
if (code?.number !== undefined)
|
|
201
|
+
result += code.number;
|
|
202
|
+
if (id.format_suffix !== undefined)
|
|
203
|
+
result += id.format_suffix;
|
|
204
|
+
return result;
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
export const MonographClass = astmClass({
|
|
208
|
+
kind: "monograph",
|
|
209
|
+
extraDefs: { edition: { type: "string" } },
|
|
210
|
+
render: (id) => {
|
|
211
|
+
const self = id;
|
|
212
|
+
let result = `${id.publisher} MONO`;
|
|
213
|
+
result += id.code()?.number ?? "";
|
|
214
|
+
if (self["edition"] !== undefined)
|
|
215
|
+
result += `-${self["edition"]}`;
|
|
216
|
+
if (id.format_suffix !== undefined)
|
|
217
|
+
result += id.format_suffix;
|
|
218
|
+
return result;
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
export const AdjunctClass = astmClass({
|
|
222
|
+
kind: "adjunct",
|
|
223
|
+
extraDefs: {
|
|
224
|
+
ea_suffix: { type: "boolean" },
|
|
225
|
+
dvd_suffix: { type: "boolean" },
|
|
226
|
+
},
|
|
227
|
+
render: (id) => {
|
|
228
|
+
const self = id;
|
|
229
|
+
const result = [];
|
|
230
|
+
if (self["ea_suffix"] !== true && self["dvd_suffix"] !== true) {
|
|
231
|
+
result.push(id.publisher);
|
|
232
|
+
}
|
|
233
|
+
result.push(`ADJ${id.number ?? ""}${self["ea_suffix"] === true ? "-EA" : ""}${self["dvd_suffix"] === true ? "DVD" : ""}`);
|
|
234
|
+
return result.join(" ");
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
export const WorkInProgressClass = astmClass({
|
|
238
|
+
kind: "work-in-progress",
|
|
239
|
+
render: (id) => `${id.publisher} WK${id.code()?.number ?? ""}`,
|
|
240
|
+
});
|
|
241
|
+
export const ManualClass = astmClass({
|
|
242
|
+
kind: "manual",
|
|
243
|
+
extraDefs: {
|
|
244
|
+
edition: { type: "string" },
|
|
245
|
+
supplement: { type: "boolean" },
|
|
246
|
+
tp_designation: { type: "string" },
|
|
247
|
+
},
|
|
248
|
+
render: (id) => {
|
|
249
|
+
const self = id;
|
|
250
|
+
let result = "MNL";
|
|
251
|
+
if (self["tp_designation"] !== undefined)
|
|
252
|
+
result += "TP";
|
|
253
|
+
result += id.code()?.number ?? "";
|
|
254
|
+
if (self["edition"] !== undefined)
|
|
255
|
+
result += `-${self["edition"]}`;
|
|
256
|
+
result = `${id.publisher} ${result}`;
|
|
257
|
+
if (self["supplement"] === true)
|
|
258
|
+
result += "-SUP";
|
|
259
|
+
if (id.format_suffix !== undefined)
|
|
260
|
+
result += id.format_suffix;
|
|
261
|
+
return result;
|
|
262
|
+
},
|
|
263
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Grammar } from "../../grammar/engine.js";
|
|
2
|
+
import type { FlavorImplementation } from "../../conformance/implementation.js";
|
|
3
|
+
import { BaseIdentifier } from "../../model/identifier.js";
|
|
4
|
+
export declare const bipmGrammar: Grammar;
|
|
5
|
+
export declare abstract class BipmIdentifier extends BaseIdentifier {
|
|
6
|
+
static attributes: import("../../model/attribute.js").AttributeTable;
|
|
7
|
+
static mappings: import("../../model/attribute.js").FieldMapping[];
|
|
8
|
+
readonly group: string | undefined;
|
|
9
|
+
readonly type_code: string | undefined;
|
|
10
|
+
readonly number: string | undefined;
|
|
11
|
+
readonly year: number | undefined;
|
|
12
|
+
readonly language: string | undefined;
|
|
13
|
+
readonly form: string | undefined;
|
|
14
|
+
readonly issue: string | undefined;
|
|
15
|
+
readonly article: string | undefined;
|
|
16
|
+
readonly edition: string | undefined;
|
|
17
|
+
readonly version: string | undefined;
|
|
18
|
+
readonly years: string | undefined;
|
|
19
|
+
readonly variant: string | undefined;
|
|
20
|
+
readonly mep_code: string | undefined;
|
|
21
|
+
readonly report_code: string | undefined;
|
|
22
|
+
readonly guide_kind: string | undefined;
|
|
23
|
+
readonly appendix: string | undefined;
|
|
24
|
+
readonly annex: string | undefined;
|
|
25
|
+
readonly part: string | undefined;
|
|
26
|
+
numberSegment(): string;
|
|
27
|
+
yearSegment(lang?: string): string;
|
|
28
|
+
fullContentWrap(body: string): string;
|
|
29
|
+
}
|
|
30
|
+
export declare function bipmGrammarImplementation(): FlavorImplementation;
|