marc-ts 0.1.0 → 0.4.2

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/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
- import { n as p, t as S } from "./types-c4Mo9m9u.js";
2
- var K = 27, v = "", P = /* @__PURE__ */ new Map([
1
+ import { n as p, t as S } from "./types-BMKDHD1l.js";
2
+ import { t as Q } from "./warnings-Bt6wvWFe.js";
3
+ var ee = 27, v = "�", W = /* @__PURE__ */ new Map([
3
4
  [33, "Ł"],
4
5
  [34, "Ø"],
5
6
  [35, "Đ"],
@@ -58,7 +59,7 @@ var K = 27, v = "�", P = /* @__PURE__ */ new Map([
58
59
  [122, "︢"],
59
60
  [123, "︣"],
60
61
  [126, "̓"]
61
- ]), V = new Map(Array.from(G.entries()).map(([e, t]) => [t, e + 128])), X = new Map(Array.from(P.entries()).map(([e, t]) => [t, e + 128])), Q = M(65, "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", 97, "αβγδεζηθικλμνξοπρστυφχψω"), ee = M(96, "אבגדהוזחטיךכלםמןנסעףפץצקרשת"), te = M(65, "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ", 97, "абвгдежзийклмнопрстуфхцчшщъыьэюя"), ne = /* @__PURE__ */ new Map([
62
+ ]), te = new Map(Array.from(G.entries()).map(([e, t]) => [t, e + 128])), ne = new Map(Array.from(W.entries()).map(([e, t]) => [t, e + 128])), re = T(65, "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", 97, "αβγδεζηθικλμνξοπρστυφχψω"), ie = T(96, "אבגדהוזחטיךכלםמןנסעףפץצקרשת"), se = T(65, "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ", 97, "абвгдежзийклмнопрстуфхцчшщъыьэюя"), oe = /* @__PURE__ */ new Map([
62
63
  [33, "ء"],
63
64
  [34, "آ"],
64
65
  [35, "أ"],
@@ -95,7 +96,7 @@ var K = 27, v = "�", P = /* @__PURE__ */ new Map([
95
96
  [72, "و"],
96
97
  [73, "ى"],
97
98
  [74, "ي"]
98
- ]), re = /* @__PURE__ */ new Map([
99
+ ]), ae = /* @__PURE__ */ new Map([
99
100
  [40, "₍"],
100
101
  [41, "₎"],
101
102
  [43, "₊"],
@@ -110,7 +111,7 @@ var K = 27, v = "�", P = /* @__PURE__ */ new Map([
110
111
  [55, "₇"],
111
112
  [56, "₈"],
112
113
  [57, "₉"]
113
- ]), ie = /* @__PURE__ */ new Map([
114
+ ]), ce = /* @__PURE__ */ new Map([
114
115
  [40, "⁽"],
115
116
  [41, "⁾"],
116
117
  [43, "⁺"],
@@ -126,7 +127,7 @@ var K = 27, v = "�", P = /* @__PURE__ */ new Map([
126
127
  [56, "⁸"],
127
128
  [57, "⁹"],
128
129
  [110, "ⁿ"]
129
- ]), se = /* @__PURE__ */ new Map([
130
+ ]), le = /* @__PURE__ */ new Map([
130
131
  [2171169, "一"],
131
132
  [2171170, "丁"],
132
133
  [2171171, "七"],
@@ -161,69 +162,69 @@ var K = 27, v = "�", P = /* @__PURE__ */ new Map([
161
162
  [2171200, "丫"],
162
163
  [2171201, "中"],
163
164
  [2171202, "丰"]
164
- ]), oe = {
165
+ ]), de = {
165
166
  ascii: /* @__PURE__ */ new Map(),
166
- ansel: ae(P, G),
167
- greek: Q,
168
- hebrew: ee,
169
- cyrillic: te,
170
- arabic: ne,
171
- subscript: re,
172
- superscript: ie
167
+ ansel: fe(W, G),
168
+ greek: re,
169
+ hebrew: ie,
170
+ cyrillic: se,
171
+ arabic: oe,
172
+ subscript: ae,
173
+ superscript: ce
173
174
  };
174
- function M(...e) {
175
+ function T(...e) {
175
176
  const t = /* @__PURE__ */ new Map();
176
177
  for (let n = 0; n < e.length; n += 2) {
177
- const r = e[n], i = e[n + 1];
178
- Array.from(i).forEach((s, o) => t.set(r + o, s));
178
+ const i = e[n], r = e[n + 1];
179
+ Array.from(r).forEach((s, o) => t.set(i + o, s));
179
180
  }
180
181
  return t;
181
182
  }
182
- function ae(...e) {
183
+ function fe(...e) {
183
184
  const t = /* @__PURE__ */ new Map();
184
- for (const n of e) for (const [r, i] of n) t.set(r, i);
185
+ for (const n of e) for (const [i, r] of n) t.set(i, r);
185
186
  return t;
186
187
  }
187
- function T(e) {
188
+ function M(e) {
188
189
  const t = e.codePointAt(0);
189
190
  return t >= 768 && t <= 879 || t >= 65056 && t <= 65071;
190
191
  }
191
- function N(e, t) {
192
+ function C(e, t) {
192
193
  return t ? e - 128 : e;
193
194
  }
194
- function ce(e, t, n) {
195
- const r = N(e, n);
196
- return t === "ascii" ? r >= 32 && r <= 126 ? String.fromCharCode(r) : v : oe[t].get(r) ?? v;
195
+ function ue(e, t, n) {
196
+ const i = C(e, n);
197
+ return t === "ascii" ? i >= 32 && i <= 126 ? String.fromCharCode(i) : v : de[t].get(i) ?? v;
197
198
  }
198
- function le(e, t, n) {
199
+ function ge(e, t, n) {
199
200
  if (t + 2 >= e.length) return {
200
201
  char: v,
201
202
  next: e.length
202
203
  };
203
- const r = N(e[t], n), i = N(e[t + 1], n), s = N(e[t + 2], n), o = r << 16 | i << 8 | s;
204
+ const i = C(e[t], n), r = C(e[t + 1], n), s = C(e[t + 2], n), o = i << 16 | r << 8 | s;
204
205
  return {
205
- char: se.get(o) ?? v,
206
+ char: le.get(o) ?? v,
206
207
  next: t + 3
207
208
  };
208
209
  }
209
- function de(e, t, n) {
210
+ function he(e, t, n) {
210
211
  if (t + 1 >= e.length) return {
211
212
  char: v,
212
213
  next: e.length
213
214
  };
214
- const r = e[t + 1];
215
- let i, s;
216
- if (r === 40 || r === 44)
217
- i = "g0", s = t + 2;
218
- else if (r === 41 || r === 45)
219
- i = "g1", s = t + 2;
220
- else if (r === 36) {
215
+ const i = e[t + 1];
216
+ let r, s;
217
+ if (i === 40 || i === 44)
218
+ r = "g0", s = t + 2;
219
+ else if (i === 41 || i === 45)
220
+ r = "g1", s = t + 2;
221
+ else if (i === 36) {
221
222
  const l = e[t + 2];
222
223
  if (l === void 0) return {
223
224
  char: v,
224
225
  next: e.length
225
226
  };
226
- l === 40 || l === 44 ? (i = "g0", s = t + 3) : l === 41 || l === 45 ? (i = "g1", s = t + 3) : (i = "g0", s = t + 2);
227
+ l === 40 || l === 44 ? (r = "g0", s = t + 3) : l === 41 || l === 45 ? (r = "g1", s = t + 3) : (r = "g0", s = t + 2);
227
228
  } else return {
228
229
  char: v,
229
230
  next: t + 2
@@ -240,19 +241,19 @@ function de(e, t, n) {
240
241
  };
241
242
  o = e[s];
242
243
  }
243
- const c = ue(o);
244
- return c ? {
244
+ const a = we(o);
245
+ return a ? {
245
246
  char: "",
246
- next: fe(n, i, c, s + 1)
247
+ next: pe(n, r, a, s + 1)
247
248
  } : {
248
249
  char: v,
249
250
  next: s + 1
250
251
  };
251
252
  }
252
- function fe(e, t, n, r) {
253
- return e[t] = n, r;
253
+ function pe(e, t, n, i) {
254
+ return e[t] = n, i;
254
255
  }
255
- function ue(e) {
256
+ function we(e) {
256
257
  switch (e) {
257
258
  case 49:
258
259
  return "eacc";
@@ -280,226 +281,252 @@ function ue(e) {
280
281
  return;
281
282
  }
282
283
  }
283
- function ge(e) {
284
+ function Ee(e) {
284
285
  const t = {
285
286
  g0: "ascii",
286
287
  g1: "ansel"
287
288
  }, n = [];
288
- let r = "", i = 0;
289
+ let i = "", r = 0;
289
290
  const s = (o) => {
290
291
  if (o) {
291
- if (T(o)) {
292
- r += o;
292
+ if (M(o)) {
293
+ i += o;
293
294
  return;
294
295
  }
295
- n.push(o + r), r = "";
296
+ n.push(o + i), i = "";
296
297
  }
297
298
  };
298
- for (; i < e.length; ) {
299
- const o = e[i];
300
- if (o === K) {
301
- const d = de(e, i, t);
302
- s(d.char), i = d.next;
299
+ for (; r < e.length; ) {
300
+ const o = e[r];
301
+ if (o === ee) {
302
+ const d = he(e, r, t);
303
+ s(d.char), r = d.next;
303
304
  continue;
304
305
  }
305
306
  if (o < 32) {
306
- s(String.fromCharCode(o)), i++;
307
+ s(String.fromCharCode(o)), r++;
307
308
  continue;
308
309
  }
309
- const c = o >= 160, l = c ? t.g1 : t.g0;
310
+ const a = o >= 160, l = a ? t.g1 : t.g0;
310
311
  if (l === "eacc") {
311
- const d = le(e, i, c);
312
- s(d.char), i = d.next;
312
+ const d = ge(e, r, a);
313
+ s(d.char), r = d.next;
313
314
  continue;
314
315
  }
315
- s(ce(o, l, c)), i++;
316
+ s(ue(o, l, a)), r++;
316
317
  }
317
- return r && n.push(r), n.join("");
318
+ return i && n.push(i), n.join("");
318
319
  }
319
- function Te(e) {
320
+ function Ue(e) {
320
321
  return k(e).bytes;
321
322
  }
322
323
  function k(e) {
323
324
  const t = e.normalize("NFD"), n = [];
324
- let r = 0, i = 0;
325
- for (; i < t.length; ) {
326
- const s = t.codePointAt(i), o = t[i];
327
- if (T(o)) {
328
- n.push(63), r++, i++;
325
+ let i = 0, r = 0;
326
+ for (; r < t.length; ) {
327
+ const s = t.codePointAt(r), o = t[r];
328
+ if (M(o)) {
329
+ n.push(63), i++, r++;
329
330
  continue;
330
331
  }
331
- let c = i + (s > 65535 ? 2 : 1);
332
+ let a = r + (s > 65535 ? 2 : 1);
332
333
  const l = [];
333
- for (; c < t.length && T(t[c]); ) {
334
- const d = V.get(t[c]);
335
- d !== void 0 ? l.push(d) : (l.push(63), r++), c++;
334
+ for (; a < t.length && M(t[a]); ) {
335
+ const d = te.get(t[a]);
336
+ d !== void 0 ? l.push(d) : (l.push(63), i++), a++;
336
337
  }
337
338
  if (n.push(...l), s < 128) n.push(s);
338
339
  else {
339
- const d = X.get(o);
340
- d !== void 0 ? n.push(d) : (n.push(63), r++);
340
+ const d = ne.get(o);
341
+ d !== void 0 ? n.push(d) : (n.push(63), i++);
341
342
  }
342
- i = c;
343
+ r = a;
343
344
  }
344
345
  return {
345
346
  bytes: new Uint8Array(n),
346
- lossyCount: r
347
+ lossyCount: i
347
348
  };
348
349
  }
349
- var D = 31, W = 30, I = 24, C = 12, _ = 3, U = 4, R = new TextDecoder("utf-8", { fatal: !1 });
350
+ var U = 31, z = 30, _ = 24, I = 12, B = 3, x = new TextDecoder("utf-8", { fatal: !1 });
350
351
  function H(e) {
351
- return R.decode(e);
352
+ return x.decode(e);
352
353
  }
353
354
  function J(e, t = 16) {
354
- const n = e.slice(0, t), r = Array.from(n, (i) => i.toString(16).padStart(2, "0")).join(" ");
355
- return e.length > t ? `${r} … (${e.length} bytes)` : r;
356
- }
357
- function he(e, t = {}) {
358
- const n = t.strict ?? !1, r = t.maxWarnings ?? 100, i = [];
359
- if (e.length < I + 1) {
360
- const a = g("truncated_record", `Record too short: ${e.length} bytes`);
361
- if (n) throw new Error(a.message);
362
- return i.push(a), {
355
+ const n = e.slice(0, t), i = Array.from(n, (r) => r.toString(16).padStart(2, "0")).join(" ");
356
+ return e.length > t ? `${i} … (${e.length} bytes)` : i;
357
+ }
358
+ function N(e, t = {}) {
359
+ const n = t.strict ?? !1, i = t.maxWarnings ?? 100, r = [];
360
+ if (e.length < 25) {
361
+ const c = u("truncated_record", `Record too short: ${e.length} bytes`);
362
+ if (n) throw new Error(c.message);
363
+ return r.push(c), {
363
364
  record: null,
364
- warnings: i
365
+ warnings: r
365
366
  };
366
367
  }
367
- const s = pe(e);
368
- if (!we(s, i, n) && (n || i.length >= r))
368
+ const s = me(e);
369
+ if (!ve(s, r, n) && (n || r.length >= i))
369
370
  return {
370
371
  record: null,
371
- warnings: i
372
+ warnings: r
372
373
  };
373
374
  const o = parseInt(s.substring(0, 5), 10);
374
375
  if (isNaN(o) || o > e.length) {
375
- const a = g("invalid_leader", `Invalid record length in leader: ${s.substring(0, 5)}`);
376
- if (n) throw new Error(a.message);
377
- i.push(a);
376
+ const c = u("invalid_leader", `Invalid record length in leader: ${s.substring(0, 5)}`);
377
+ if (n) throw new Error(c.message);
378
+ r.push(c);
378
379
  } else if (o < e.length) {
379
- const a = g("truncated_record", `Buffer is longer than the record length declared in the leader: leader says ${o}, buffer is ${e.length} bytes. Trailing bytes ignored (likely a concatenated stream — split on 0x1D first).`);
380
- if (n) throw new Error(a.message);
381
- i.push(a), e = e.slice(0, o);
382
- }
383
- const c = parseInt(s.substring(12, 17), 10);
384
- if (isNaN(c)) {
385
- const a = g("invalid_leader", `Invalid base address in leader: ${s.substring(12, 17)}`);
386
- if (n) throw new Error(a.message);
387
- return i.push(a), {
380
+ const c = u("truncated_record", `Buffer is longer than the record length declared in the leader: leader says ${o}, buffer is ${e.length} bytes. Trailing bytes ignored (likely a concatenated stream — split on 0x1D first).`);
381
+ if (n) throw new Error(c.message);
382
+ r.push(c), e = e.slice(0, o);
383
+ }
384
+ const a = parseInt(s.substring(12, 17), 10);
385
+ if (isNaN(a)) {
386
+ const c = u("invalid_leader", `Invalid base address in leader: ${s.substring(12, 17)}`);
387
+ if (n) throw new Error(c.message);
388
+ return r.push(c), {
388
389
  record: null,
389
- warnings: i
390
+ warnings: r
390
391
  };
391
392
  }
392
- const l = I, d = e.indexOf(W, l);
393
+ const l = _, d = e.indexOf(z, l);
393
394
  if (d === -1) {
394
- const a = g("invalid_directory", "Directory terminator not found");
395
- if (n) throw new Error(a.message);
396
- return i.push(a), {
395
+ const c = u("invalid_directory", "Directory terminator not found");
396
+ if (n) throw new Error(c.message);
397
+ return r.push(c), {
397
398
  record: null,
398
- warnings: i
399
+ warnings: r
399
400
  };
400
401
  }
401
- const u = Ee(e.slice(l, d), i, n, r);
402
- if (u.length === 0) {
403
- const a = g("invalid_directory", "No directory entries found");
404
- if (n) throw new Error(a.message);
405
- return i.push(a), {
402
+ const g = Se(e.slice(l, d), r, n, i);
403
+ if (g.length === 0) {
404
+ const c = u("invalid_directory", "No directory entries found");
405
+ if (n) throw new Error(c.message);
406
+ return r.push(c), {
406
407
  record: null,
407
- warnings: i
408
+ warnings: r
408
409
  };
409
410
  }
410
411
  const f = s[9] === " ";
411
412
  if (s[9] !== " " && s[9] !== "a") {
412
- const a = g("invalid_leader", `Leader position 9 (encoding flag) is '${s[9]}'; expected 'a' (UTF-8) or ' ' (MARC-8). Defaulting to UTF-8.`);
413
- if (n) throw new Error(a.message);
414
- i.push(a);
413
+ const c = u("invalid_leader", `Leader position 9 (encoding flag) is '${s[9]}'; expected 'a' (UTF-8) or ' ' (MARC-8). Defaulting to UTF-8.`);
414
+ if (n) throw new Error(c.message);
415
+ r.push(c);
415
416
  }
416
417
  return {
417
418
  record: {
418
419
  leader: s,
419
- fields: me(e, u, c, f ? ge : (a) => R.decode(a), i, n, r)
420
+ fields: be(e, g, a, f ? Ee : (c) => x.decode(c), r, n, i)
420
421
  },
421
- warnings: i
422
+ warnings: r
422
423
  };
423
424
  }
424
- function Me(e) {
425
- const t = he(e, { strict: !0 });
426
- if (!t.record) throw new Error("Failed to parse MARC record in strict mode");
427
- return t.record;
425
+ var j = 29;
426
+ function Be(e, t) {
427
+ const n = [];
428
+ let i = 0;
429
+ for (let r = 0; r < e.length; r++) if (e[r] === j) {
430
+ const s = e.slice(i, r + 1);
431
+ if (s.length > 0) {
432
+ const o = N(s, t);
433
+ o.record && n.push(o.record);
434
+ }
435
+ i = r + 1;
436
+ }
437
+ if (i < e.length) {
438
+ const r = N(e.slice(i), t);
439
+ r.record && n.push(r.record);
440
+ }
441
+ return n;
428
442
  }
429
- function pe(e) {
430
- const t = e.slice(0, I);
431
- return R.decode(t);
443
+ function Oe(e, t) {
444
+ const n = [];
445
+ let i = 0;
446
+ for (let r = 0; r < e.length; r++) if (e[r] === j) {
447
+ const s = e.slice(i, r + 1);
448
+ s.length > 0 && n.push(N(s, t)), i = r + 1;
449
+ }
450
+ if (i < e.length) {
451
+ const r = e.slice(i);
452
+ n.push(N(r, t));
453
+ }
454
+ return { results: n };
455
+ }
456
+ function me(e) {
457
+ const t = e.slice(0, _);
458
+ return x.decode(t);
432
459
  }
433
- function we(e, t, n) {
434
- if (e.length !== I) {
435
- const r = g("invalid_leader", `Leader length is ${e.length}, expected ${I}`);
436
- if (n) throw new Error(r.message);
437
- return t.push(r), !1;
460
+ function ve(e, t, n) {
461
+ if (e.length !== _) {
462
+ const i = u("invalid_leader", `Leader length is ${e.length}, expected ${_}`);
463
+ if (n) throw new Error(i.message);
464
+ return t.push(i), !1;
438
465
  }
439
466
  if (e[10] !== "2") {
440
- const r = g("invalid_leader", `Leader position 10 (indicator count) is '${e[10]}', expected '2'`);
441
- t.push(r);
467
+ const i = u("invalid_leader", `Leader position 10 (indicator count) is '${e[10]}', expected '2'`);
468
+ t.push(i);
442
469
  }
443
470
  if (e[11] !== "2") {
444
- const r = g("invalid_leader", `Leader position 11 (subfield code length) is '${e[11]}', expected '2'`);
445
- t.push(r);
471
+ const i = u("invalid_leader", `Leader position 11 (subfield code length) is '${e[11]}', expected '2'`);
472
+ t.push(i);
446
473
  }
447
474
  return !0;
448
475
  }
449
- function Ee(e, t, n, r) {
450
- const i = [];
451
- for (let s = 0; s < e.length; s += C) {
452
- if (t.length >= r) {
453
- t.push(g("truncated_record", `Directory parsing halted after reaching maxWarnings limit (${r}); remaining ${e.length - s} bytes of directory not parsed.`));
476
+ function Se(e, t, n, i) {
477
+ const r = [];
478
+ for (let s = 0; s < e.length; s += I) {
479
+ if (t.length >= i) {
480
+ t.push(u("truncated_record", `Directory parsing halted after reaching maxWarnings limit (${i}); remaining ${e.length - s} bytes of directory not parsed.`));
454
481
  break;
455
482
  }
456
- if (s + C > e.length) break;
457
- const o = e.slice(s, s + C), c = R.decode(o), l = c.substring(0, _), d = c.substring(_, _ + U), u = c.substring(_ + U, C), f = parseInt(d, 10), a = parseInt(u, 10);
458
- if (isNaN(f) || isNaN(a)) {
459
- const w = g("invalid_directory", `Invalid directory entry for tag ${l}: length=${d}, position=${u}`);
483
+ if (s + I > e.length) break;
484
+ const o = e.slice(s, s + I), a = x.decode(o), l = a.substring(0, B), d = a.substring(B, 7), g = a.substring(7, I), f = parseInt(d, 10), c = parseInt(g, 10);
485
+ if (isNaN(f) || isNaN(c)) {
486
+ const w = u("invalid_directory", `Invalid directory entry for tag ${l}: length=${d}, position=${g}`);
460
487
  if (n) throw new Error(w.message);
461
488
  t.push(w);
462
489
  continue;
463
490
  }
464
- i.push({
491
+ r.push({
465
492
  tag: l,
466
493
  fieldLength: f,
467
- startingPosition: a
494
+ startingPosition: c
468
495
  });
469
496
  }
470
- return i;
497
+ return r;
471
498
  }
472
- function me(e, t, n, r, i, s, o) {
473
- const c = [];
499
+ function be(e, t, n, i, r, s, o) {
500
+ const a = [];
474
501
  for (const l of t) {
475
- if (i.length >= o) {
476
- i.push(g("truncated_record", `Field parsing halted after reaching maxWarnings limit (${o}); not all directory entries were processed.`, void 0, l.tag));
502
+ if (r.length >= o) {
503
+ r.push(u("truncated_record", `Field parsing halted after reaching maxWarnings limit (${o}); not all directory entries were processed.`, void 0, l.tag));
477
504
  break;
478
505
  }
479
- const d = n + l.startingPosition, u = d + l.fieldLength - 1;
480
- if (d >= e.length || u > e.length) {
481
- const a = g("invalid_field", `Field ${l.tag} out of bounds: start=${d}, end=${u}, buffer length=${e.length}`, d, l.tag);
482
- if (s) throw new Error(a.message);
483
- i.push(a);
506
+ const d = n + l.startingPosition, g = d + l.fieldLength - 1;
507
+ if (d >= e.length || g > e.length) {
508
+ const c = u("invalid_field", `Field ${l.tag} out of bounds: start=${d}, end=${g}, buffer length=${e.length}`, d, l.tag);
509
+ if (s) throw new Error(c.message);
510
+ r.push(c);
484
511
  continue;
485
512
  }
486
513
  let f;
487
- if (e[u] !== W) {
488
- const a = g("invalid_field", `Field ${l.tag} does not end with a field terminator at byte ${u} (found 0x${(e[u] ?? 0).toString(16).padStart(2, "0")}); using the full declared length without stripping a terminator byte.`, d, l.tag);
489
- if (s) throw new Error(a.message);
490
- i.push(a), f = e.slice(d, d + l.fieldLength);
491
- } else f = e.slice(d, u);
514
+ if (e[g] !== z) {
515
+ const c = u("invalid_field", `Field ${l.tag} does not end with a field terminator at byte ${g} (found 0x${(e[g] ?? 0).toString(16).padStart(2, "0")}); using the full declared length without stripping a terminator byte.`, d, l.tag);
516
+ if (s) throw new Error(c.message);
517
+ r.push(c), f = e.slice(d, d + l.fieldLength);
518
+ } else f = e.slice(d, g);
492
519
  if (l.tag.startsWith("00")) {
493
520
  try {
494
- const a = r(f);
495
- c.push({
521
+ const c = i(f);
522
+ a.push({
496
523
  tag: l.tag,
497
- data: a
524
+ data: c
498
525
  });
499
- } catch (a) {
500
- const w = g("encoding_error", `Failed to decode control field ${l.tag}: ${a instanceof Error ? a.message : String(a)}. Raw bytes (hex): ${J(f)}.`, d, l.tag);
526
+ } catch (c) {
527
+ const w = u("encoding_error", `Failed to decode control field ${l.tag}: ${c instanceof Error ? c.message : String(c)}. Raw bytes (hex): ${J(f)}.`, d, l.tag);
501
528
  if (s) throw new Error(w.message);
502
- i.push(w), c.push({
529
+ r.push(w), a.push({
503
530
  tag: l.tag,
504
531
  data: H(f)
505
532
  });
@@ -507,104 +534,96 @@ function me(e, t, n, r, i, s, o) {
507
534
  continue;
508
535
  }
509
536
  if (f.length < 2) {
510
- const a = g("invalid_field", `Data field ${l.tag} too short for indicators: ${f.length} bytes`, d, l.tag);
511
- if (s) throw new Error(a.message);
512
- i.push(a);
537
+ const c = u("invalid_field", `Data field ${l.tag} too short for indicators: ${f.length} bytes`, d, l.tag);
538
+ if (s) throw new Error(c.message);
539
+ r.push(c);
513
540
  continue;
514
541
  }
515
542
  try {
516
- const a = String.fromCharCode(f[0] ?? 0), w = String.fromCharCode(f[1] ?? 0), y = ve(f.slice(2), r, l.tag, i, s, o);
517
- c.push({
543
+ const c = String.fromCharCode(f[0] ?? 0), w = String.fromCharCode(f[1] ?? 0), A = ye(f.slice(2), i, l.tag, r, s, o);
544
+ a.push({
518
545
  tag: l.tag,
519
- indicator1: a,
546
+ indicator1: c,
520
547
  indicator2: w,
521
- subfields: y
548
+ subfields: A
522
549
  });
523
- } catch (a) {
524
- const w = g("invalid_field", `Failed to parse data field ${l.tag}: ${a instanceof Error ? a.message : String(a)}`, d, l.tag);
550
+ } catch (c) {
551
+ const w = u("invalid_field", `Failed to parse data field ${l.tag}: ${c instanceof Error ? c.message : String(c)}`, d, l.tag);
525
552
  if (s) throw new Error(w.message);
526
- i.push(w);
553
+ r.push(w);
527
554
  }
528
555
  }
529
- return c;
556
+ return a;
530
557
  }
531
- function ve(e, t, n, r, i, s) {
558
+ function ye(e, t, n, i, r, s) {
532
559
  const o = [];
533
- let c = 0;
534
- for (; c < e.length; ) {
535
- if (r.length >= s) {
536
- r.push(g("truncated_record", `Subfield parsing halted after reaching maxWarnings limit (${s}) in field ${n}; not all subfields were processed.`, void 0, n));
560
+ let a = 0;
561
+ for (; a < e.length; ) {
562
+ if (i.length >= s) {
563
+ i.push(u("truncated_record", `Subfield parsing halted after reaching maxWarnings limit (${s}) in field ${n}; not all subfields were processed.`, void 0, n));
537
564
  break;
538
565
  }
539
- if (e[c] !== D) {
540
- const f = g("invalid_field", `Expected subfield delimiter in field ${n} at position ${c}`, void 0, n);
541
- if (i) throw new Error(f.message);
542
- r.push(f);
566
+ if (e[a] !== U) {
567
+ const f = u("invalid_field", `Expected subfield delimiter in field ${n} at position ${a}`, void 0, n);
568
+ if (r) throw new Error(f.message);
569
+ i.push(f);
543
570
  break;
544
571
  }
545
- if (c++, c >= e.length) break;
546
- const l = String.fromCharCode(e[c] ?? 0);
547
- c++;
548
- const d = c;
549
- for (; c < e.length && e[c] !== D; ) c++;
550
- const u = e.slice(d, c);
572
+ if (a++, a >= e.length) break;
573
+ const l = String.fromCharCode(e[a] ?? 0);
574
+ a++;
575
+ const d = a;
576
+ for (; a < e.length && e[a] !== U; ) a++;
577
+ const g = e.slice(d, a);
551
578
  try {
552
- const f = t(u);
579
+ const f = t(g);
553
580
  o.push({
554
581
  code: l,
555
582
  value: f
556
583
  });
557
584
  } catch (f) {
558
- const a = g("encoding_error", `Failed to decode subfield ${n}$${l}: ${f instanceof Error ? f.message : String(f)}. Raw bytes (hex): ${J(u)}.`, void 0, n);
559
- if (i) throw new Error(a.message);
560
- r.push(a), o.push({
585
+ const c = u("encoding_error", `Failed to decode subfield ${n}$${l}: ${f instanceof Error ? f.message : String(f)}. Raw bytes (hex): ${J(g)}.`, void 0, n);
586
+ if (r) throw new Error(c.message);
587
+ i.push(c), o.push({
561
588
  code: l,
562
- value: H(u)
589
+ value: H(g)
563
590
  });
564
591
  }
565
592
  }
566
593
  return o;
567
594
  }
568
- function g(e, t, n, r) {
569
- return {
570
- type: e,
571
- message: t,
572
- position: n,
573
- tag: r
574
- };
575
- }
576
- function Se(e, t, n, r) {
595
+ function u(e, t, n, i) {
577
596
  return {
578
597
  type: e,
579
598
  message: t,
580
599
  position: n,
581
- tag: r
600
+ tag: i
582
601
  };
583
602
  }
584
- var be = 31, O = 30, $e = 29, F = 24, Ae = 3, Ie = 4, ye = 5;
585
- function De(e, t = {}) {
586
- return Ce(e, t).bytes;
587
- }
588
- function Ce(e, t = {}) {
589
- _e(e);
590
- const n = [], r = t.encoding === "marc8", i = new TextEncoder(), s = r ? (E, b) => {
591
- const $ = k(E);
592
- return $.lossyCount > 0 && n.push(Se("encoding_error", `MARC-8 encoding substituted ${$.lossyCount} character(s) with '?' because they have no MARC-8 equivalent.`, void 0, b)), $.bytes;
593
- } : (E) => i.encode(E), o = [], c = [];
594
- let l = 0;
603
+ var $e = 31, O = 30, Ae = 29, R = 24, Ie = 3, Ce = 4, _e = 5;
604
+ function Ne(e, t = {}) {
605
+ return Y(e, t).bytes;
606
+ }
607
+ function Y(e, t = {}) {
608
+ Re(e);
609
+ const n = [], i = t.maxWarnings ?? 100, r = t.encoding === "marc8", s = new TextEncoder(), o = r ? (E, b) => {
610
+ const y = k(E);
611
+ return y.lossyCount > 0 && n.length < i && n.push(Q("encoding_error", `MARC-8 encoding substituted ${y.lossyCount} character(s) with '?' because they have no MARC-8 equivalent.`, void 0, b)), y.bytes;
612
+ } : (E) => s.encode(E), a = [], l = [];
613
+ let d = 0;
595
614
  for (const E of e.fields) {
596
- const b = Ne(E, (Z) => s(Z, E.tag)), $ = b.length + 1, q = E.tag.padEnd(Ae, " ") + $.toString().padStart(Ie, "0") + l.toString().padStart(ye, "0");
597
- o.push(q), c.push(b), c.push(new Uint8Array([O])), l += $;
598
- }
599
- const d = i.encode(o.join("")), u = new Uint8Array(d.length + 1);
600
- u.set(d), u[d.length] = O;
601
- const f = F + u.length, a = c.reduce((E, b) => E + b.length, 0), w = new Uint8Array(a);
602
- let y = 0;
603
- for (const E of c)
604
- w.set(E, y), y += E.length;
605
- const x = f + a + 1, Y = Fe(e.leader, x, f, r), A = new Uint8Array(x);
606
- return A.set(i.encode(Y), 0), A.set(u, F), A.set(w, f), A[x - 1] = $e, {
607
- bytes: A,
615
+ const b = xe(E, (X) => o(X, E.tag)), y = b.length + 1, V = E.tag.padEnd(Ie, " ") + y.toString().padStart(Ce, "0") + d.toString().padStart(_e, "0");
616
+ a.push(V), l.push(b), l.push(new Uint8Array([O])), d += y;
617
+ }
618
+ const g = s.encode(a.join("")), f = new Uint8Array(g.length + 1);
619
+ f.set(g), f[g.length] = O;
620
+ const c = R + f.length, w = l.reduce((E, b) => E + b.length, 0), A = new Uint8Array(w);
621
+ let D = 0;
622
+ for (const E of l)
623
+ A.set(E, D), D += E.length;
624
+ const F = c + w + 1, K = Fe(e.leader, F, c, r), $ = new Uint8Array(F);
625
+ return $.set(s.encode(K), 0), $.set(f, R), $.set(A, c), $[F - 1] = Ae, {
626
+ bytes: $,
608
627
  warnings: n
609
628
  };
610
629
  }
@@ -612,7 +631,7 @@ function L(e) {
612
631
  const t = e.charCodeAt(0);
613
632
  return t >= 32 && t <= 126;
614
633
  }
615
- function _e(e) {
634
+ function Re(e) {
616
635
  for (const t of e.fields) {
617
636
  if (typeof t.tag != "string" || t.tag.length !== 3) throw new Error(`MARC field tag must be exactly 3 characters; got ${JSON.stringify(t.tag)}`);
618
637
  if (!S(t)) {
@@ -627,188 +646,210 @@ function _e(e) {
627
646
  }
628
647
  }
629
648
  }
630
- function Ne(e, t) {
649
+ function xe(e, t) {
631
650
  if (S(e)) return t(e.data);
632
651
  const n = [new Uint8Array([e.indicator1.charCodeAt(0), e.indicator2.charCodeAt(0)])];
633
652
  for (const o of e.subfields) {
634
- const c = new Uint8Array([be, o.code.charCodeAt(0)]);
635
- n.push(c, t(o.value));
653
+ const a = new Uint8Array([$e, o.code.charCodeAt(0)]);
654
+ n.push(a, t(o.value));
636
655
  }
637
- const r = n.reduce((o, c) => o + c.length, 0), i = new Uint8Array(r);
656
+ const i = n.reduce((o, a) => o + a.length, 0), r = new Uint8Array(i);
638
657
  let s = 0;
639
658
  for (const o of n)
640
- i.set(o, s), s += o.length;
641
- return i;
659
+ r.set(o, s), s += o.length;
660
+ return r;
642
661
  }
643
- function Fe(e, t, n, r) {
644
- let i = e.padEnd(F, " ").substring(0, F);
662
+ function Fe(e, t, n, i) {
663
+ let r = e.padEnd(R, " ").substring(0, R);
645
664
  const s = t.toString().padStart(5, "0");
646
665
  if (s.length > 5) throw new Error(`Record length ${t} exceeds maximum (99999)`);
647
- i = s + i.substring(5);
666
+ r = s + r.substring(5);
648
667
  const o = n.toString().padStart(5, "0");
649
668
  if (o.length > 5) throw new Error(`Base address ${n} exceeds maximum (99999)`);
650
- return i = i.substring(0, 12) + o + i.substring(17), i = i.substring(0, 9) + (r ? " " : "a") + i.substring(10), i;
669
+ return r = r.substring(0, 12) + o + r.substring(17), r = r.substring(0, 9) + (i ? " " : "a") + r.substring(10), r;
670
+ }
671
+ function Pe(e, t = {}) {
672
+ const n = e.map((o) => Ne(o, t)), i = n.reduce((o, a) => o + a.length, 0), r = new Uint8Array(i);
673
+ let s = 0;
674
+ for (const o of n)
675
+ r.set(o, s), s += o.length;
676
+ return r;
677
+ }
678
+ function We(e, t = {}) {
679
+ const n = [], i = [];
680
+ for (const a of e) {
681
+ const l = Y(a, t);
682
+ n.push(l), i.push(l.bytes);
683
+ }
684
+ const r = i.reduce((a, l) => a + l.length, 0), s = new Uint8Array(r);
685
+ let o = 0;
686
+ for (const a of i)
687
+ s.set(a, o), o += a.length;
688
+ return {
689
+ bytes: s,
690
+ results: n
691
+ };
651
692
  }
652
693
  function m(e, t) {
653
694
  return e.fields.find((n) => n.tag === t);
654
695
  }
655
- function Ue(e, t) {
696
+ function Ge(e, t) {
656
697
  return e.fields.filter((n) => n.tag === t);
657
698
  }
658
699
  function h(e, t) {
659
700
  return e.subfields.find((n) => n.code === t)?.value;
660
701
  }
661
- function Oe(e, t) {
702
+ function ke(e, t) {
662
703
  return e.subfields.filter((n) => n.code === t).map((n) => n.value);
663
704
  }
664
- function Be(e) {
705
+ function ze(e) {
665
706
  return e.subfields.map((t) => ({
666
707
  code: t.code,
667
708
  value: t.value
668
709
  }));
669
710
  }
670
- function Pe(e) {
711
+ function He(e) {
671
712
  const t = m(e, "245");
672
713
  if (!t || !p(t)) return;
673
- const n = h(t, "a") ?? "", r = h(t, "b") ?? "";
674
- return (n + " " + r).trim() || void 0;
714
+ const n = h(t, "a") ?? "", i = h(t, "b") ?? "";
715
+ return (n + " " + i).trim() || void 0;
675
716
  }
676
- function Ge(e) {
717
+ function Je(e) {
677
718
  const t = m(e, "245");
678
719
  if (!(!t || !p(t)))
679
720
  return h(t, "a");
680
721
  }
681
- function ke(e) {
722
+ function je(e) {
682
723
  const t = m(e, "100");
683
724
  if (t && p(t)) return h(t, "a");
684
725
  const n = m(e, "110");
685
726
  if (n && p(n)) return h(n, "a");
686
727
  }
687
- function We(e) {
728
+ function Ye(e) {
688
729
  const t = m(e, "250");
689
730
  if (!(!t || !p(t)))
690
731
  return h(t, "a");
691
732
  }
692
- function He(e) {
733
+ function qe(e) {
693
734
  const t = m(e, "264");
694
735
  if (t && p(t)) {
695
- const r = h(t, "b");
696
- if (r) return r;
736
+ const i = h(t, "b");
737
+ if (i) return i;
697
738
  }
698
739
  const n = m(e, "260");
699
740
  if (n && p(n)) return h(n, "b");
700
741
  }
701
- function Je(e) {
742
+ function Ze(e) {
702
743
  const t = m(e, "264");
703
744
  if (t && p(t)) {
704
- const r = h(t, "c");
705
- if (r) return r;
745
+ const i = h(t, "c");
746
+ if (i) return i;
706
747
  }
707
748
  const n = m(e, "260");
708
749
  if (n && p(n)) return h(n, "c");
709
750
  }
710
- function je(e) {
751
+ function Ke(e) {
711
752
  const t = [];
712
753
  for (const n of e.fields) if (n.tag === "020" && p(n)) {
713
- const r = h(n, "a");
714
- r && t.push(r);
754
+ const i = h(n, "a");
755
+ i && t.push(i);
715
756
  }
716
757
  return t;
717
758
  }
718
- function ze(e) {
759
+ function Ve(e) {
719
760
  const t = m(e, "022");
720
761
  if (!(!t || !p(t)))
721
762
  return h(t, "a");
722
763
  }
723
- function Ye(e) {
764
+ function Xe(e) {
724
765
  const t = m(e, "010");
725
766
  if (!(!t || !p(t)))
726
767
  return h(t, "a");
727
768
  }
728
- function qe(e) {
769
+ function Qe(e) {
729
770
  const t = [];
730
771
  for (const n of e.fields) if (n.tag.startsWith("6") && p(n)) {
731
- const r = h(n, "a");
732
- r && t.push(r);
772
+ const i = h(n, "a");
773
+ i && t.push(i);
733
774
  }
734
775
  return t;
735
776
  }
736
- function Ze(e) {
777
+ function et(e) {
737
778
  const t = m(e, "490");
738
779
  if (!(!t || !p(t)))
739
780
  return h(t, "a");
740
781
  }
741
- function j(e, t) {
782
+ function q(e, t) {
742
783
  if (e.length !== 3 || t.length !== 3) return !1;
743
784
  for (let n = 0; n < 3; n++) {
744
- const r = t[n], i = e[n];
745
- if (r === "." || r?.toUpperCase() === "X") {
746
- if (i && !/\d/.test(i)) return !1;
785
+ const i = t[n], r = e[n];
786
+ if (i === "." || i?.toUpperCase() === "X") {
787
+ if (r && !/\d/.test(r)) return !1;
747
788
  continue;
748
789
  }
749
- if (r !== i) return !1;
790
+ if (i !== r) return !1;
750
791
  }
751
792
  return !0;
752
793
  }
753
- function Ke(e, t) {
754
- return e.fields.filter((n) => j(n.tag, t));
794
+ function tt(e, t) {
795
+ return e.fields.filter((n) => q(n.tag, t));
755
796
  }
756
- function Ve(e, t) {
757
- return e.fields.find((n) => j(n.tag, t));
797
+ function nt(e, t) {
798
+ return e.fields.find((n) => q(n.tag, t));
758
799
  }
759
- function z(e, t) {
800
+ function Z(e, t) {
760
801
  return {
761
802
  ...e,
762
803
  fields: [...e.fields, t]
763
804
  };
764
805
  }
765
- function Xe(e, t, n) {
766
- const r = e.fields.findIndex((s) => s.tag === t);
767
- if (r === -1) return z(e, n);
768
- const i = Array.from(e.fields);
769
- return i.splice(r, 0, n), {
806
+ function rt(e, t, n) {
807
+ const i = e.fields.findIndex((s) => s.tag === t);
808
+ if (i === -1) return Z(e, n);
809
+ const r = Array.from(e.fields);
810
+ return r.splice(i, 0, n), {
770
811
  ...e,
771
- fields: i
812
+ fields: r
772
813
  };
773
814
  }
774
- function Qe(e, t, n) {
775
- const r = e.fields.findIndex((s) => s.tag === t);
776
- if (r === -1) return z(e, n);
777
- const i = Array.from(e.fields);
778
- return i.splice(r + 1, 0, n), {
815
+ function it(e, t, n) {
816
+ const i = e.fields.findIndex((s) => s.tag === t);
817
+ if (i === -1) return Z(e, n);
818
+ const r = Array.from(e.fields);
819
+ return r.splice(i + 1, 0, n), {
779
820
  ...e,
780
- fields: i
821
+ fields: r
781
822
  };
782
823
  }
783
- function et(e, t) {
824
+ function st(e, t) {
784
825
  const n = parseInt(t.tag, 10);
785
- let r = e.fields.length;
826
+ let i = e.fields.length;
786
827
  for (let s = 0; s < e.fields.length; s++) {
787
828
  const o = e.fields[s];
788
829
  if (o && parseInt(o.tag, 10) > n) {
789
- r = s;
830
+ i = s;
790
831
  break;
791
832
  }
792
833
  }
793
- const i = Array.from(e.fields);
794
- return i.splice(r, 0, t), {
834
+ const r = Array.from(e.fields);
835
+ return r.splice(i, 0, t), {
795
836
  ...e,
796
- fields: i
837
+ fields: r
797
838
  };
798
839
  }
799
- function tt(e, t) {
840
+ function ot(e, t) {
800
841
  return {
801
842
  ...e,
802
843
  fields: e.fields.filter((n) => n.tag !== t)
803
844
  };
804
845
  }
805
- function nt(e, t) {
846
+ function at(e, t) {
806
847
  return {
807
848
  ...e,
808
849
  fields: e.fields.filter((n) => n !== t)
809
850
  };
810
851
  }
811
- function Re(e, t, n) {
852
+ function Le(e, t, n) {
812
853
  return {
813
854
  ...e,
814
855
  subfields: [...e.subfields, {
@@ -817,46 +858,46 @@ function Re(e, t, n) {
817
858
  }]
818
859
  };
819
860
  }
820
- function rt(e, t) {
861
+ function ct(e, t) {
821
862
  return {
822
863
  ...e,
823
864
  subfields: e.subfields.filter((n) => n.code !== t)
824
865
  };
825
866
  }
826
- function it(e, t, n) {
827
- const r = e.subfields.findIndex((s) => s.code === t);
828
- if (r === -1) return Re(e, t, n);
829
- const i = [...e.subfields];
830
- return i[r] = {
867
+ function lt(e, t, n) {
868
+ const i = e.subfields.findIndex((s) => s.code === t);
869
+ if (i === -1) return Le(e, t, n);
870
+ const r = [...e.subfields];
871
+ return r[i] = {
831
872
  code: t,
832
873
  value: n
833
874
  }, {
834
875
  ...e,
835
- subfields: i
876
+ subfields: r
836
877
  };
837
878
  }
838
- function st(e) {
879
+ function dt(e) {
839
880
  const t = new Array(e.fields.length);
840
881
  for (let n = 0; n < e.fields.length; n++) {
841
- const r = e.fields[n];
842
- if (S(r)) t[n] = {
843
- tag: r.tag,
844
- data: r.data
882
+ const i = e.fields[n];
883
+ if (S(i)) t[n] = {
884
+ tag: i.tag,
885
+ data: i.data
845
886
  };
846
887
  else {
847
- const i = new Array(r.subfields.length);
848
- for (let s = 0; s < r.subfields.length; s++) {
849
- const o = r.subfields[s];
850
- i[s] = {
888
+ const r = new Array(i.subfields.length);
889
+ for (let s = 0; s < i.subfields.length; s++) {
890
+ const o = i.subfields[s];
891
+ r[s] = {
851
892
  code: o.code,
852
893
  value: o.value
853
894
  };
854
895
  }
855
896
  t[n] = {
856
- tag: r.tag,
857
- indicator1: r.indicator1,
858
- indicator2: r.indicator2,
859
- subfields: i
897
+ tag: i.tag,
898
+ indicator1: i.indicator1,
899
+ indicator2: i.indicator2,
900
+ subfields: r
860
901
  };
861
902
  }
862
903
  }
@@ -865,71 +906,71 @@ function st(e) {
865
906
  fields: t
866
907
  };
867
908
  }
868
- function ot(e, t, n = !1) {
909
+ function ft(e, t, n = !1) {
869
910
  if (e.leader !== t.leader || e.fields.length !== t.fields.length) return !1;
870
- const r = n ? [...e.fields].sort(B) : e.fields, i = n ? [...t.fields].sort(B) : t.fields;
871
- for (let s = 0; s < r.length; s++) {
872
- const o = r[s], c = i[s];
873
- if (!o || !c || !xe(o, c)) return !1;
911
+ const i = n ? [...e.fields].sort(P) : e.fields, r = n ? [...t.fields].sort(P) : t.fields;
912
+ for (let s = 0; s < i.length; s++) {
913
+ const o = i[s], a = r[s];
914
+ if (!o || !a || !Me(o, a)) return !1;
874
915
  }
875
916
  return !0;
876
917
  }
877
- function xe(e, t) {
918
+ function Me(e, t) {
878
919
  if (e.tag !== t.tag) return !1;
879
920
  if (S(e) && S(t)) return e.data === t.data;
880
921
  if (!S(e) && !S(t)) {
881
922
  if (e.indicator1 !== t.indicator1 || e.indicator2 !== t.indicator2 || e.subfields.length !== t.subfields.length) return !1;
882
923
  for (let n = 0; n < e.subfields.length; n++) {
883
- const r = e.subfields[n], i = t.subfields[n];
884
- if (!r || !i || r.code !== i.code || r.value !== i.value) return !1;
924
+ const i = e.subfields[n], r = t.subfields[n];
925
+ if (!i || !r || i.code !== r.code || i.value !== r.value) return !1;
885
926
  }
886
927
  return !0;
887
928
  }
888
929
  return !1;
889
930
  }
890
- function B(e, t) {
931
+ function P(e, t) {
891
932
  return e.tag.localeCompare(t.tag);
892
933
  }
893
934
  export {
894
- Re as addSubfield,
895
- z as appendField,
896
- ke as author,
897
- st as cloneRecord,
898
- Se as createWarning,
899
- We as edition,
900
- xe as fieldsEqual,
901
- Be as getAllSubfields,
935
+ Le as addSubfield,
936
+ Z as appendField,
937
+ je as author,
938
+ dt as cloneRecord,
939
+ Q as createWarning,
940
+ Ye as edition,
941
+ Me as fieldsEqual,
942
+ ze as getAllSubfields,
902
943
  m as getField,
903
- Ue as getFields,
904
- Ke as getFieldsByPattern,
905
- Ve as getFirstFieldByPattern,
944
+ Ge as getFields,
945
+ tt as getFieldsByPattern,
946
+ nt as getFirstFieldByPattern,
906
947
  h as getSubfield,
907
- Oe as getSubfields,
908
- Qe as insertFieldAfter,
909
- Xe as insertFieldBefore,
910
- et as insertGroupedField,
948
+ ke as getSubfields,
949
+ it as insertFieldAfter,
950
+ rt as insertFieldBefore,
951
+ st as insertGroupedField,
911
952
  S as isControlField,
912
953
  p as isDataField,
913
- je as isbn,
914
- ze as issn,
915
- Ye as lccn,
916
- ge as marc8ToUnicode,
917
- he as parseMarcRecord,
918
- Me as parseMarcRecordStrict,
919
- Je as publicationDate,
920
- He as publisher,
921
- ot as recordsEqual,
922
- nt as removeField,
923
- tt as removeFields,
924
- rt as removeSubfield,
925
- it as replaceSubfield,
926
- De as serializeMarcRecord,
927
- Ce as serializeMarcRecordWithWarnings,
928
- Ze as seriesStatement,
929
- qe as subjects,
930
- Pe as title,
931
- Ge as titleProper,
932
- Te as unicodeToMarc8,
954
+ Ke as isbn,
955
+ Ve as issn,
956
+ Xe as lccn,
957
+ Ee as marc8ToUnicode,
958
+ Be as parseMarcBinary,
959
+ Oe as parseMarcBinaryWithWarnings,
960
+ Ze as publicationDate,
961
+ qe as publisher,
962
+ ft as recordsEqual,
963
+ at as removeField,
964
+ ot as removeFields,
965
+ ct as removeSubfield,
966
+ lt as replaceSubfield,
967
+ Pe as serializeMarcBinary,
968
+ We as serializeMarcBinaryWithWarnings,
969
+ et as seriesStatement,
970
+ Qe as subjects,
971
+ He as title,
972
+ Je as titleProper,
973
+ Ue as unicodeToMarc8,
933
974
  k as unicodeToMarc8WithStats
934
975
  };
935
976