@orkestrel/guide 0.0.24 → 0.0.26

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.
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _orkestrel_markdown = require("@orkestrel/markdown");
3
3
  let _orkestrel_contract = require("@orkestrel/contract");
4
- //#region src/core/constants.ts
4
+ // src/core/constants.ts
5
5
  /**
6
6
  * Lists the declaration keywords a documented or exported symbol carries, in the order the
7
7
  * reflection grammar names them — the frozen population `ExportKeyword`, `isExportKeyword`, and
@@ -74,8 +74,7 @@ var EXTERNAL_SCHEMES = Object.freeze([
74
74
  "mailto:",
75
75
  "tel:"
76
76
  ]);
77
- //#endregion
78
- //#region src/core/validators.ts
77
+ // src/core/validators.ts
79
78
  /**
80
79
  * Checks whether `value` is one of the documented {@link ExportKeyword}
81
80
  * literals — the guard behind extracting a Surface table's `Kind` cell into a
@@ -203,8 +202,7 @@ var isManifestEntry = (0, _orkestrel_contract.recordOf)({
203
202
  source: (0, _orkestrel_contract.unionOf)(_orkestrel_contract.isString, (0, _orkestrel_contract.arrayOf)(_orkestrel_contract.isString)),
204
203
  tests: _orkestrel_contract.isString
205
204
  });
206
- //#endregion
207
- //#region src/core/helpers.ts
205
+ // src/core/helpers.ts
208
206
  /**
209
207
  * Extracts aligned physical source-line records in one character traversal.
210
208
  * Real line and block comments and complete template tokens become spaces in
@@ -238,462 +236,468 @@ var isManifestEntry = (0, _orkestrel_contract.recordOf)({
238
236
  */
239
237
  function extractSourceLines(source) {
240
238
  const lines = [];
241
- let characters = [];
242
- let jsdocCharacters = [];
239
+ const tokens = [];
243
240
  const identifier = /#?[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/uy;
244
- const templates = [];
245
- const parentheses = [];
246
- let start = 0;
247
- let mode = "code";
248
- let escaped = false;
249
- let regexClass = false;
250
- let operandExpected = true;
251
- let memberExpected = false;
252
- let pendingRole;
253
- let restricted;
254
- let separated = false;
255
- let blockTemplate = false;
256
- let lineTemplate = false;
257
- let jsdoc = false;
258
- let jsdocPresent = false;
259
- for (let offset = 0; offset < source.length; offset += 1) {
260
- const character = source[offset];
261
- if (character === void 0) continue;
241
+ const numeric = /[A-Za-z0-9_$.]+/y;
242
+ const final = source.split("").reduce((state, character, offset) => {
243
+ if (offset < state.offset) return state;
262
244
  const next = source[offset + 1];
263
245
  const crlf = character === "\r" && next === "\n";
264
246
  if (character === "\n" || crlf) {
265
- const code = characters.join("");
266
- const present = jsdocPresent || jsdoc;
247
+ const parts = tokens.slice(state.token);
248
+ const code = parts.map((part) => part.code).join("");
267
249
  lines.push({
268
- source: source.slice(start, offset),
250
+ source: source.slice(state.start, offset),
269
251
  code,
270
- jsdoc: present ? jsdocCharacters.join("").padEnd(code.length, " ") : void 0
252
+ jsdoc: state.present || state.jsdoc ? parts.map((part) => part.jsdoc ?? " ".repeat(part.code.length)).join("") : void 0
271
253
  });
272
- characters = [];
273
- jsdocCharacters = [];
274
- jsdocPresent = jsdoc;
275
- if (mode !== "template") separated = true;
276
- if (restricted !== void 0) {
277
- operandExpected = true;
278
- memberExpected = false;
279
- pendingRole = void 0;
280
- restricted = void 0;
281
- }
282
- if (crlf) offset += 1;
283
- start = offset + 1;
284
- if (mode === "line") mode = lineTemplate ? "templateCode" : "code";
285
- else if (mode === "regex") {
286
- mode = "code";
287
- operandExpected = true;
288
- regexClass = false;
289
- } else if (mode === "templateLine" || mode === "templateRegex") {
290
- mode = "templateCode";
291
- operandExpected = true;
292
- regexClass = false;
293
- } else if (mode === "single" || mode === "double") {
294
- if (!escaped) {
295
- mode = "code";
296
- operandExpected = true;
297
- }
298
- } else if (mode === "templateSingle" || mode === "templateDouble") {
299
- if (!escaped) {
300
- mode = "templateCode";
301
- operandExpected = true;
302
- }
303
- }
304
- escaped = false;
305
- continue;
306
- }
307
- if (mode === "line" || mode === "templateLine") {
308
- characters.push(" ");
309
- continue;
310
- }
311
- if (mode === "block" || mode === "templateBlock") {
312
- characters.push(" ");
313
- if (jsdoc) jsdocCharacters.push(character);
314
- if (character === "*" && next === "/") {
315
- characters.push(" ");
316
- if (jsdoc) {
317
- jsdocCharacters.push("/");
318
- jsdoc = false;
319
- }
320
- offset += 1;
321
- mode = blockTemplate ? "templateCode" : "code";
322
- }
323
- continue;
254
+ const regular = state.mode === "single" || state.mode === "double";
255
+ const quoted = state.mode === "templateSingle" || state.mode === "templateDouble";
256
+ const reset = state.mode === "regex" || state.mode === "templateLine" || state.mode === "templateRegex";
257
+ const mode = state.mode === "line" ? state.line ? "templateCode" : "code" : state.mode === "regex" ? "code" : state.mode === "templateLine" || state.mode === "templateRegex" ? "templateCode" : regular && !state.escaped ? "code" : quoted && !state.escaped ? "templateCode" : state.mode;
258
+ return {
259
+ ...state,
260
+ offset: offset + (crlf ? 2 : 1),
261
+ start: offset + (crlf ? 2 : 1),
262
+ token: tokens.length,
263
+ mode,
264
+ escaped: false,
265
+ regex: reset ? false : state.regex,
266
+ operand: state.restricted !== void 0 || reset || (regular || quoted) && !state.escaped ? true : state.operand,
267
+ member: state.restricted !== void 0 ? false : state.member,
268
+ role: state.restricted !== void 0 ? void 0 : state.role,
269
+ restricted: void 0,
270
+ separated: state.mode !== "template" ? true : state.separated,
271
+ present: state.jsdoc
272
+ };
324
273
  }
325
- if (mode === "single" || mode === "double") {
326
- characters.push(character);
327
- if (escaped) {
328
- escaped = false;
329
- continue;
330
- }
331
- if (character === "\\") {
332
- escaped = true;
333
- continue;
334
- }
335
- if (mode === "single" && character === "'" || mode === "double" && character === "\"") {
336
- mode = "code";
337
- operandExpected = false;
338
- }
339
- continue;
274
+ if (state.mode === "line" || state.mode === "templateLine") {
275
+ tokens.push({ code: " " });
276
+ return state;
340
277
  }
341
- if (mode === "regex") {
342
- characters.push(character);
343
- if (escaped) {
344
- escaped = false;
345
- continue;
346
- }
347
- if (character === "\\") {
348
- escaped = true;
349
- continue;
350
- }
351
- if (character === "[") regexClass = true;
352
- else if (character === "]") regexClass = false;
353
- else if (character === "/" && !regexClass) {
354
- mode = "code";
355
- operandExpected = false;
356
- }
357
- continue;
278
+ if (state.mode === "block" || state.mode === "templateBlock") {
279
+ const closes = character === "*" && next === "/";
280
+ tokens.push({
281
+ code: closes ? " " : " ",
282
+ ...state.jsdoc ? { jsdoc: closes ? "*/" : character } : {}
283
+ });
284
+ return closes ? {
285
+ ...state,
286
+ offset: offset + 2,
287
+ jsdoc: false,
288
+ mode: state.block ? "templateCode" : "code"
289
+ } : state;
358
290
  }
359
- if (mode === "templateSingle" || mode === "templateDouble") {
360
- characters.push(" ");
361
- if (escaped) {
362
- escaped = false;
363
- continue;
364
- }
365
- if (character === "\\") {
366
- escaped = true;
367
- continue;
368
- }
369
- if (mode === "templateSingle" && character === "'" || mode === "templateDouble" && character === "\"") {
370
- mode = "templateCode";
371
- operandExpected = false;
372
- }
373
- continue;
291
+ if (state.mode === "single" || state.mode === "double" || state.mode === "templateSingle" || state.mode === "templateDouble") {
292
+ const template = state.mode === "templateSingle" || state.mode === "templateDouble";
293
+ tokens.push({ code: template ? " " : character });
294
+ if (state.escaped) return {
295
+ ...state,
296
+ escaped: false
297
+ };
298
+ if (character === "\\") return {
299
+ ...state,
300
+ escaped: true
301
+ };
302
+ return (state.mode === "single" || state.mode === "templateSingle" ? character === "'" : character === "\"") ? {
303
+ ...state,
304
+ mode: template ? "templateCode" : "code",
305
+ operand: false
306
+ } : state;
374
307
  }
375
- if (mode === "templateRegex") {
376
- characters.push(" ");
377
- if (escaped) {
378
- escaped = false;
379
- continue;
380
- }
381
- if (character === "\\") {
382
- escaped = true;
383
- continue;
384
- }
385
- if (character === "[") regexClass = true;
386
- else if (character === "]") regexClass = false;
387
- else if (character === "/" && !regexClass) {
388
- mode = "templateCode";
389
- operandExpected = false;
390
- }
391
- continue;
308
+ if (state.mode === "regex" || state.mode === "templateRegex") {
309
+ tokens.push({ code: state.mode === "templateRegex" ? " " : character });
310
+ if (state.escaped) return {
311
+ ...state,
312
+ escaped: false
313
+ };
314
+ if (character === "\\") return {
315
+ ...state,
316
+ escaped: true
317
+ };
318
+ if (character === "[") return {
319
+ ...state,
320
+ regex: true
321
+ };
322
+ if (character === "]") return {
323
+ ...state,
324
+ regex: false
325
+ };
326
+ if (character === "/" && !state.regex) return {
327
+ ...state,
328
+ mode: state.mode === "templateRegex" ? "templateCode" : "code",
329
+ operand: false
330
+ };
331
+ return state;
392
332
  }
393
- if (mode === "template") {
394
- characters.push(" ");
395
- if (escaped) {
396
- escaped = false;
397
- continue;
398
- }
399
- if (character === "\\") {
400
- escaped = true;
401
- continue;
402
- }
403
- if (character === "$" && next === "{") {
404
- characters.push(" ");
405
- offset += 1;
406
- const index = templates.length - 1;
407
- if (index >= 0) templates[index] = 1;
408
- mode = "templateCode";
409
- operandExpected = true;
410
- memberExpected = false;
411
- pendingRole = void 0;
412
- continue;
413
- }
333
+ if (state.mode === "template") {
334
+ const interpolation = !state.escaped && character === "$" && next === "{";
335
+ tokens.push({ code: interpolation ? " " : " " });
336
+ if (state.escaped) return {
337
+ ...state,
338
+ escaped: false
339
+ };
340
+ if (character === "\\") return {
341
+ ...state,
342
+ escaped: true
343
+ };
344
+ if (interpolation) return {
345
+ ...state,
346
+ offset: offset + 2,
347
+ templates: state.templates === void 0 ? void 0 : {
348
+ ...state.templates,
349
+ depth: 1
350
+ },
351
+ mode: "templateCode",
352
+ operand: true,
353
+ member: false,
354
+ role: void 0
355
+ };
414
356
  if (character === "`") {
415
- templates.pop();
416
- mode = templates.length === 0 ? "code" : "templateCode";
417
- operandExpected = false;
357
+ const templates = state.templates?.previous;
358
+ return {
359
+ ...state,
360
+ templates,
361
+ mode: templates === void 0 ? "code" : "templateCode",
362
+ operand: false
363
+ };
418
364
  }
419
- continue;
365
+ return state;
420
366
  }
421
- const templateCode = mode === "templateCode";
367
+ const template = state.mode === "templateCode";
422
368
  if (character === "/" && next === "/") {
423
- characters.push(" ", " ");
424
- offset += 1;
425
- lineTemplate = templateCode;
426
- mode = templateCode ? "templateLine" : "line";
427
- continue;
369
+ tokens.push({ code: " " });
370
+ return {
371
+ ...state,
372
+ offset: offset + 2,
373
+ line: template,
374
+ mode: template ? "templateLine" : "line"
375
+ };
428
376
  }
429
377
  if (character === "/" && next === "*") {
430
- characters.push(" ", " ");
431
- if (!templateCode && source[offset + 2] === "*") {
432
- const column = offset - start;
433
- const width = jsdocCharacters.join("").length;
434
- jsdocCharacters.push(" ".repeat(column - width), "/", "*");
435
- jsdoc = true;
436
- jsdocPresent = true;
437
- }
438
- offset += 1;
439
- blockTemplate = templateCode;
440
- mode = templateCode ? "templateBlock" : "block";
441
- continue;
442
- }
443
- if (character === "'") {
444
- characters.push(templateCode ? " " : character);
445
- mode = templateCode ? "templateSingle" : "single";
446
- escaped = false;
447
- separated = false;
448
- restricted = void 0;
449
- continue;
450
- }
451
- if (character === "\"") {
452
- characters.push(templateCode ? " " : character);
453
- mode = templateCode ? "templateDouble" : "double";
454
- escaped = false;
455
- separated = false;
456
- restricted = void 0;
457
- continue;
378
+ const jsdoc = !template && source[offset + 2] === "*";
379
+ tokens.push({
380
+ code: " ",
381
+ ...jsdoc ? { jsdoc: "/*" } : {}
382
+ });
383
+ return {
384
+ ...state,
385
+ offset: offset + 2,
386
+ block: template,
387
+ mode: template ? "templateBlock" : "block",
388
+ jsdoc: jsdoc || state.jsdoc,
389
+ present: jsdoc || state.present
390
+ };
458
391
  }
459
- if (character === "`") {
460
- characters.push(" ");
461
- templates.push(0);
462
- mode = "template";
463
- escaped = false;
464
- separated = false;
465
- restricted = void 0;
466
- continue;
392
+ if (character === "'" || character === "\"" || character === "`") {
393
+ tokens.push({ code: template || character === "`" ? " " : character });
394
+ return {
395
+ ...state,
396
+ mode: character === "`" ? "template" : character === "'" ? template ? "templateSingle" : "single" : template ? "templateDouble" : "double",
397
+ templates: character === "`" ? {
398
+ depth: 0,
399
+ previous: state.templates
400
+ } : state.templates,
401
+ escaped: false,
402
+ separated: false,
403
+ restricted: void 0
404
+ };
467
405
  }
468
- const visible = templateCode ? " " : character;
469
- if (character === "/" && next === "=" && !operandExpected) {
470
- characters.push(visible, templateCode ? " " : "=");
471
- offset += 1;
472
- operandExpected = true;
473
- memberExpected = false;
474
- pendingRole = void 0;
475
- separated = false;
476
- restricted = void 0;
477
- continue;
406
+ const visible = template ? " " : character;
407
+ if (character === "/" && next === "=" && !state.operand) {
408
+ tokens.push({ code: template ? " " : "/=" });
409
+ return {
410
+ ...state,
411
+ offset: offset + 2,
412
+ operand: true,
413
+ member: false,
414
+ role: void 0,
415
+ separated: false,
416
+ restricted: void 0
417
+ };
478
418
  }
479
419
  if (character === "/") {
480
- characters.push(visible);
481
- if (operandExpected) {
482
- mode = templateCode ? "templateRegex" : "regex";
483
- escaped = false;
484
- regexClass = false;
485
- } else {
486
- operandExpected = true;
487
- memberExpected = false;
488
- pendingRole = void 0;
489
- }
490
- separated = false;
491
- restricted = void 0;
492
- continue;
420
+ tokens.push({ code: visible });
421
+ return state.operand ? {
422
+ ...state,
423
+ mode: template ? "templateRegex" : "regex",
424
+ escaped: false,
425
+ regex: false,
426
+ separated: false,
427
+ restricted: void 0
428
+ } : {
429
+ ...state,
430
+ operand: true,
431
+ member: false,
432
+ role: void 0,
433
+ separated: false,
434
+ restricted: void 0
435
+ };
493
436
  }
494
437
  identifier.lastIndex = offset;
495
- const identifierMatch = identifier.exec(source);
496
- if (identifierMatch !== null) {
497
- const token = identifierMatch[0];
498
- characters.push(templateCode ? " ".repeat(token.length) : token);
499
- if (token.startsWith("#")) {
500
- operandExpected = false;
501
- memberExpected = false;
502
- pendingRole = void 0;
503
- restricted = void 0;
504
- separated = false;
505
- offset += token.length - 1;
506
- continue;
507
- }
508
- const frame = parentheses[parentheses.length - 1];
509
- const label = restricted === "label";
510
- restricted = void 0;
511
- separated = false;
512
- if (memberExpected) {
513
- memberExpected = false;
514
- operandExpected = false;
515
- pendingRole = void 0;
516
- } else if (label) {
517
- operandExpected = false;
518
- pendingRole = void 0;
519
- restricted = "complete";
520
- } else if (/^(?:if|while|with)$/.test(token)) {
521
- pendingRole = "statement";
522
- operandExpected = true;
523
- } else if (token === "for") {
524
- pendingRole = "for";
525
- operandExpected = true;
526
- } else if (token === "export") {
527
- pendingRole = "export";
528
- operandExpected = true;
529
- } else if (token === "default" && pendingRole === "export") {
530
- pendingRole = void 0;
531
- operandExpected = true;
532
- } else if (/^(?:switch|catch)$/.test(token)) {
533
- pendingRole = "block";
534
- operandExpected = true;
535
- } else if (token === "await" && pendingRole === "for") operandExpected = true;
536
- else if (/^(?:return|throw|case|delete|void|typeof|new|await|yield|else|do|extends)$/.test(token)) {
537
- pendingRole = void 0;
538
- operandExpected = true;
539
- } else if (/^(?:in|instanceof)$/.test(token)) {
540
- pendingRole = void 0;
541
- operandExpected = true;
542
- } else if (/^(?:break|continue)$/.test(token)) {
543
- pendingRole = void 0;
544
- operandExpected = false;
545
- restricted = "label";
546
- } else if (token === "debugger") {
547
- pendingRole = void 0;
548
- operandExpected = false;
549
- restricted = "complete";
550
- } else if (token === "of" && frame?.role === "for" && frame.phase === "left" && !frame.binding && !operandExpected) {
551
- frame.phase = "right";
552
- operandExpected = true;
553
- pendingRole = void 0;
554
- } else if (/^(?:const|let|var)$/.test(token) && frame?.role === "for" && frame.phase === "left") {
555
- frame.binding = true;
556
- operandExpected = true;
557
- pendingRole = void 0;
558
- } else {
559
- if (frame?.binding === true) frame.binding = false;
560
- operandExpected = false;
561
- pendingRole = void 0;
562
- }
563
- offset += token.length - 1;
564
- continue;
438
+ const matched = identifier.exec(source);
439
+ if (matched !== null) {
440
+ const token = matched[0];
441
+ tokens.push({ code: template ? " ".repeat(token.length) : token });
442
+ const stepped = {
443
+ ...state,
444
+ offset: offset + token.length,
445
+ restricted: void 0,
446
+ separated: false
447
+ };
448
+ const frame = state.parentheses;
449
+ if (token.startsWith("#")) return {
450
+ ...stepped,
451
+ operand: false,
452
+ member: false,
453
+ role: void 0
454
+ };
455
+ if (state.member) return {
456
+ ...stepped,
457
+ member: false,
458
+ operand: false,
459
+ role: void 0
460
+ };
461
+ if (state.restricted === "label") return {
462
+ ...stepped,
463
+ operand: false,
464
+ role: void 0,
465
+ restricted: "complete"
466
+ };
467
+ if (/^(?:if|while|with)$/.test(token)) return {
468
+ ...stepped,
469
+ role: "statement",
470
+ operand: true
471
+ };
472
+ if (token === "for") return {
473
+ ...stepped,
474
+ role: "for",
475
+ operand: true
476
+ };
477
+ if (token === "export") return {
478
+ ...stepped,
479
+ role: "export",
480
+ operand: true
481
+ };
482
+ if (token === "default" && state.role === "export") return {
483
+ ...stepped,
484
+ role: void 0,
485
+ operand: true
486
+ };
487
+ if (/^(?:switch|catch)$/.test(token)) return {
488
+ ...stepped,
489
+ role: "block",
490
+ operand: true
491
+ };
492
+ if (token === "await" && state.role === "for") return {
493
+ ...stepped,
494
+ operand: true
495
+ };
496
+ if (/^(?:return|throw|case|delete|void|typeof|new|await|yield|else|do|extends|in|instanceof)$/.test(token)) return {
497
+ ...stepped,
498
+ role: void 0,
499
+ operand: true
500
+ };
501
+ if (/^(?:break|continue)$/.test(token)) return {
502
+ ...stepped,
503
+ role: void 0,
504
+ operand: false,
505
+ restricted: "label"
506
+ };
507
+ if (token === "debugger") return {
508
+ ...stepped,
509
+ role: void 0,
510
+ operand: false,
511
+ restricted: "complete"
512
+ };
513
+ if (token === "of" && frame?.role === "for" && frame.phase === "left" && !frame.binding && !state.operand) return {
514
+ ...stepped,
515
+ parentheses: {
516
+ ...frame,
517
+ phase: "right"
518
+ },
519
+ operand: true,
520
+ role: void 0
521
+ };
522
+ if (/^(?:const|let|var)$/.test(token) && frame?.role === "for" && frame.phase === "left") return {
523
+ ...stepped,
524
+ parentheses: {
525
+ ...frame,
526
+ binding: true
527
+ },
528
+ operand: true,
529
+ role: void 0
530
+ };
531
+ return {
532
+ ...stepped,
533
+ parentheses: frame?.binding === true ? {
534
+ ...frame,
535
+ binding: false
536
+ } : frame,
537
+ operand: false,
538
+ role: void 0
539
+ };
565
540
  }
566
541
  if (/[0-9]/.test(character)) {
567
- let end = offset + 1;
568
- while (end < source.length) {
569
- const part = source[end];
570
- if (part === void 0 || !/[A-Za-z0-9_$.]/.test(part)) break;
571
- end += 1;
572
- }
573
- const token = source.slice(offset, end);
574
- characters.push(templateCode ? " ".repeat(token.length) : token);
575
- operandExpected = false;
576
- memberExpected = false;
577
- pendingRole = void 0;
578
- restricted = void 0;
579
- separated = false;
580
- offset = end - 1;
581
- continue;
582
- }
583
- if (character === "!" && next === "=" && source[offset + 2] === "=" || character === "=" && next === "=" && source[offset + 2] === "=") {
584
- characters.push(visible, templateCode ? " " : source.slice(offset + 1, offset + 3));
585
- offset += 2;
586
- operandExpected = true;
587
- memberExpected = false;
588
- pendingRole = void 0;
589
- restricted = void 0;
590
- separated = false;
591
- continue;
542
+ numeric.lastIndex = offset;
543
+ const token = numeric.exec(source)?.[0] ?? character;
544
+ tokens.push({ code: template ? " ".repeat(token.length) : token });
545
+ return {
546
+ ...state,
547
+ offset: offset + token.length,
548
+ operand: false,
549
+ member: false,
550
+ role: void 0,
551
+ restricted: void 0,
552
+ separated: false
553
+ };
592
554
  }
593
555
  if ((character === "!" || character === "=") && next === "=") {
594
- characters.push(visible, templateCode ? " " : "=");
595
- offset += 1;
596
- operandExpected = true;
597
- memberExpected = false;
598
- pendingRole = void 0;
599
- restricted = void 0;
600
- separated = false;
601
- continue;
556
+ const width = source[offset + 2] === "=" ? 3 : 2;
557
+ tokens.push({ code: template ? " ".repeat(width) : source.slice(offset, offset + width) });
558
+ return {
559
+ ...state,
560
+ offset: offset + width,
561
+ operand: true,
562
+ member: false,
563
+ role: void 0,
564
+ restricted: void 0,
565
+ separated: false
566
+ };
602
567
  }
603
568
  if (character === "+" && next === "+" || character === "-" && next === "-") {
604
- characters.push(visible, templateCode ? " " : next);
605
- offset += 1;
606
- if (separated) operandExpected = true;
607
- memberExpected = false;
608
- pendingRole = void 0;
609
- restricted = void 0;
610
- separated = false;
611
- continue;
569
+ tokens.push({ code: template ? " " : character + next });
570
+ return {
571
+ ...state,
572
+ offset: offset + 2,
573
+ operand: state.separated ? true : state.operand,
574
+ member: false,
575
+ role: void 0,
576
+ restricted: void 0,
577
+ separated: false
578
+ };
612
579
  }
613
580
  if (character === "." && next === "." && source[offset + 2] === ".") {
614
- characters.push(visible, templateCode ? " " : "..");
615
- offset += 2;
616
- operandExpected = true;
617
- memberExpected = false;
618
- pendingRole = void 0;
619
- restricted = void 0;
620
- separated = false;
621
- continue;
581
+ tokens.push({ code: template ? " " : "..." });
582
+ return {
583
+ ...state,
584
+ offset: offset + 3,
585
+ operand: true,
586
+ member: false,
587
+ role: void 0,
588
+ restricted: void 0,
589
+ separated: false
590
+ };
622
591
  }
623
592
  if (character === "?" && next === ".") {
624
- characters.push(visible, templateCode ? " " : ".");
625
- offset += 1;
626
- operandExpected = false;
627
- memberExpected = true;
628
- pendingRole = void 0;
629
- restricted = void 0;
630
- separated = false;
631
- continue;
593
+ tokens.push({ code: template ? " " : "?." });
594
+ return {
595
+ ...state,
596
+ offset: offset + 2,
597
+ operand: false,
598
+ member: true,
599
+ role: void 0,
600
+ restricted: void 0,
601
+ separated: false
602
+ };
632
603
  }
633
- characters.push(visible);
634
- if (/\s/.test(character)) continue;
635
- separated = false;
636
- restricted = void 0;
637
- if (character === "(") {
638
- parentheses.push({
639
- role: pendingRole ?? "plain",
604
+ tokens.push({ code: visible });
605
+ if (/\s/.test(character)) return state;
606
+ const stepped = {
607
+ ...state,
608
+ separated: false,
609
+ restricted: void 0,
610
+ role: void 0,
611
+ member: false
612
+ };
613
+ const frame = state.parentheses;
614
+ if (character === "(") return {
615
+ ...stepped,
616
+ parentheses: {
617
+ role: state.role ?? "plain",
640
618
  phase: "left",
641
- binding: false
642
- });
643
- operandExpected = true;
644
- memberExpected = false;
645
- pendingRole = void 0;
646
- continue;
647
- }
648
- if (character === ")") {
649
- const frame = parentheses.pop();
650
- operandExpected = frame?.role === "statement" || frame?.role === "for";
651
- memberExpected = false;
652
- pendingRole = void 0;
653
- continue;
654
- }
655
- if (character === ";") {
656
- const frame = parentheses[parentheses.length - 1];
657
- if (frame?.role === "for" && frame.phase === "left") frame.phase = "classic";
658
- operandExpected = true;
659
- memberExpected = false;
660
- pendingRole = void 0;
661
- continue;
662
- }
663
- if (character === ".") {
664
- operandExpected = false;
665
- memberExpected = true;
666
- pendingRole = void 0;
667
- continue;
668
- }
669
- if (character === "]" || character === "}") {
670
- const frame = parentheses[parentheses.length - 1];
671
- if (frame?.role === "for" && frame.phase === "left" && frame.binding) frame.binding = false;
672
- }
673
- if (character === "]") operandExpected = false;
674
- else if (character === "}") {
675
- const index = templates.length - 1;
676
- const depth = templates[index];
677
- if (templateCode && index >= 0 && depth !== void 0) {
678
- templates[index] = depth - 1;
679
- if (depth === 1) mode = "template";
680
- }
681
- operandExpected = false;
682
- } else if (character === "{") {
683
- const index = templates.length - 1;
684
- const depth = templates[index];
685
- if (templateCode && index >= 0 && depth !== void 0) templates[index] = depth + 1;
686
- operandExpected = true;
687
- } else if (character !== "!") operandExpected = true;
688
- memberExpected = false;
689
- pendingRole = void 0;
690
- }
691
- const code = characters.join("");
692
- const present = jsdocPresent || jsdoc;
619
+ binding: false,
620
+ previous: frame
621
+ },
622
+ operand: true
623
+ };
624
+ if (character === ")") return {
625
+ ...stepped,
626
+ parentheses: frame?.previous,
627
+ operand: frame?.role === "statement" || frame?.role === "for"
628
+ };
629
+ if (character === ";") return {
630
+ ...stepped,
631
+ parentheses: frame?.role === "for" && frame.phase === "left" ? {
632
+ ...frame,
633
+ phase: "classic"
634
+ } : frame,
635
+ operand: true
636
+ };
637
+ if (character === ".") return {
638
+ ...stepped,
639
+ operand: false,
640
+ member: true
641
+ };
642
+ const parentheses = (character === "]" || character === "}") && frame?.role === "for" && frame.phase === "left" && frame.binding ? {
643
+ ...frame,
644
+ binding: false
645
+ } : frame;
646
+ if (character === "]") return {
647
+ ...stepped,
648
+ parentheses,
649
+ operand: false
650
+ };
651
+ const top = state.templates;
652
+ if (character === "}") return {
653
+ ...stepped,
654
+ parentheses,
655
+ operand: false,
656
+ templates: template && top !== void 0 ? {
657
+ ...top,
658
+ depth: top.depth - 1
659
+ } : top,
660
+ mode: template && top?.depth === 1 ? "template" : state.mode
661
+ };
662
+ if (character === "{") return {
663
+ ...stepped,
664
+ parentheses,
665
+ operand: true,
666
+ templates: template && top !== void 0 ? {
667
+ ...top,
668
+ depth: top.depth + 1
669
+ } : top
670
+ };
671
+ return {
672
+ ...stepped,
673
+ parentheses,
674
+ operand: character !== "!" ? true : state.operand
675
+ };
676
+ }, {
677
+ offset: 0,
678
+ start: 0,
679
+ token: 0,
680
+ mode: "code",
681
+ escaped: false,
682
+ regex: false,
683
+ operand: true,
684
+ member: false,
685
+ role: void 0,
686
+ restricted: void 0,
687
+ separated: false,
688
+ block: false,
689
+ line: false,
690
+ jsdoc: false,
691
+ present: false,
692
+ parentheses: void 0,
693
+ templates: void 0
694
+ });
695
+ const parts = tokens.slice(final.token);
696
+ const code = parts.map((part) => part.code).join("");
693
697
  lines.push({
694
- source: source.slice(start),
698
+ source: source.slice(final.start),
695
699
  code,
696
- jsdoc: present ? jsdocCharacters.join("").padEnd(code.length, " ") : void 0
700
+ jsdoc: final.present || final.jsdoc ? parts.map((part) => part.jsdoc ?? " ".repeat(part.code.length)).join("") : void 0
697
701
  });
698
702
  return lines;
699
703
  }
@@ -909,9 +913,7 @@ function findUnexampled(names, fences, examples) {
909
913
  */
910
914
  function extractFenceImports(fence) {
911
915
  const results = [];
912
- const pattern = /import\s+(?:type\s+)?\{([^}]*)\}\s*from\s*['"]([^'"]+)['"]/gs;
913
- let match;
914
- while ((match = pattern.exec(fence)) !== null) {
916
+ for (const match of fence.matchAll(/import\s+(?:type\s+)?\{([^}]*)\}\s*from\s*['"]([^'"]+)['"]/gs)) {
915
917
  const body = match[1];
916
918
  const specifier = match[2];
917
919
  if (body === void 0 || specifier === void 0) continue;
@@ -1068,11 +1070,11 @@ function normalizeIdentifier(code) {
1068
1070
  * ```
1069
1071
  */
1070
1072
  function extractCellText(cell) {
1071
- let text = "";
1072
- for (const node of cell) if ((0, _orkestrel_markdown.isCodeSpanNode)(node)) text += `\`${node.value}\``;
1073
- else if ((0, _orkestrel_markdown.isEmphasisNode)(node) || (0, _orkestrel_markdown.isLinkNode)(node) || (0, _orkestrel_markdown.isImageNode)(node)) text += extractCellText(node.children);
1074
- else text += (0, _orkestrel_markdown.flattenText)(node);
1075
- return text;
1073
+ return Iterator.from(cell).map((node) => {
1074
+ if ((0, _orkestrel_markdown.isCodeSpanNode)(node)) return `\`${node.value}\``;
1075
+ if ((0, _orkestrel_markdown.isEmphasisNode)(node) || (0, _orkestrel_markdown.isLinkNode)(node) || (0, _orkestrel_markdown.isImageNode)(node)) return extractCellText(node.children);
1076
+ return (0, _orkestrel_markdown.flattenText)(node);
1077
+ }).toArray().join("");
1076
1078
  }
1077
1079
  /**
1078
1080
  * Builds one table cell's inline content from its compared text — the inverse of
@@ -1101,26 +1103,22 @@ function extractCellText(cell) {
1101
1103
  */
1102
1104
  function buildCell(text) {
1103
1105
  const nodes = [];
1104
- const spans = /`([^`]+)`/g;
1105
- let cursor = 0;
1106
- let span;
1107
- while ((span = spans.exec(text)) !== null) {
1106
+ const cursor = Iterator.from(text.matchAll(/`([^`]+)`/g)).reduce((previous, span) => {
1108
1107
  const value = span[1];
1109
- if (value === void 0) continue;
1110
- if (span.index > cursor) nodes.push({
1108
+ if (value === void 0) return previous;
1109
+ if (span.index > previous) nodes.push({
1111
1110
  element: "text",
1112
- value: text.slice(cursor, span.index)
1111
+ value: text.slice(previous, span.index)
1113
1112
  });
1114
- if (value.trim() === value) nodes.push({
1113
+ nodes.push(value.trim() === value ? {
1115
1114
  element: "codeSpan",
1116
1115
  value
1117
- });
1118
- else nodes.push({
1116
+ } : {
1119
1117
  element: "text",
1120
1118
  value: span[0]
1121
1119
  });
1122
- cursor = span.index + span[0].length;
1123
- }
1120
+ return span.index + span[0].length;
1121
+ }, 0);
1124
1122
  if (cursor < text.length) nodes.push({
1125
1123
  element: "text",
1126
1124
  value: text.slice(cursor)
@@ -1144,7 +1142,7 @@ function buildCell(text) {
1144
1142
  * ```
1145
1143
  */
1146
1144
  function findColumnIndex(table, header) {
1147
- for (let index = 0; index < table.header.length; index += 1) {
1145
+ for (const index of table.header.keys()) {
1148
1146
  const cell = table.header[index];
1149
1147
  if (cell !== void 0 && (0, _orkestrel_markdown.flattenText)({
1150
1148
  element: "paragraph",
@@ -1267,7 +1265,10 @@ function extractHidden(source) {
1267
1265
  */
1268
1266
  function joinHead(lines, start) {
1269
1267
  const parts = [];
1270
- for (let index = start; index < lines.length; index += 1) {
1268
+ for (const distance of Array.prototype.keys.call({ get length() {
1269
+ return Math.max(0, Math.ceil(lines.length - start));
1270
+ } })) {
1271
+ const index = start + distance;
1271
1272
  const line = lines[index];
1272
1273
  if (line === void 0) break;
1273
1274
  const text = line.trimEnd();
@@ -1343,7 +1344,7 @@ function collectDeclarations(source) {
1343
1344
  const grammar = /^export (class|interface) ([^\s<]+)(?:<.*>)?(?: .*)? \{(?:\s*\})?$/;
1344
1345
  const lines = extractSourceLines(source);
1345
1346
  const projected = lines.map((line) => line.code);
1346
- for (let index = 0; index < projected.length; index += 1) {
1347
+ for (const index of projected.keys()) {
1347
1348
  const line = projected[index];
1348
1349
  if (line === void 0 || !opener.test(line)) continue;
1349
1350
  const head = joinHead(projected, index);
@@ -1355,12 +1356,14 @@ function collectDeclarations(source) {
1355
1356
  const key = `${keyword} ${name}`;
1356
1357
  const known = declarations.get(key);
1357
1358
  if (known !== void 0 && (known.body.length > 0 || known.bases.length > 0)) continue;
1358
- let depth = 0;
1359
- let flat = "";
1360
- for (const character of head.text.slice(`export ${key}`.length, head.text.lastIndexOf("{"))) if (character === "<") depth += 1;
1361
- else if (character === ">") depth = Math.max(0, depth - 1);
1362
- else if (depth === 0) flat += character;
1363
- const clause = flat.replace(/\bimplements\b[\s\S]*$/, "").match(/\bextends\b([\s\S]*)$/)?.[1];
1359
+ const visible = [];
1360
+ Iterator.from(head.text.slice(`export ${key}`.length, head.text.lastIndexOf("{"))).reduce((depth, character) => {
1361
+ if (character === "<") return depth + 1;
1362
+ if (character === ">") return Math.max(0, depth - 1);
1363
+ if (depth === 0) visible.push(character);
1364
+ return depth;
1365
+ }, 0);
1366
+ const clause = visible.join("").replace(/\bimplements\b[\s\S]*$/, "").match(/\bextends\b([\s\S]*)$/)?.[1];
1364
1367
  const bases = clause === void 0 ? [] : clause.split(",").map((base) => base.trim()).filter(_orkestrel_contract.isNonEmptyString);
1365
1368
  if (head.text.endsWith("}")) {
1366
1369
  declarations.set(key, {
@@ -1369,14 +1372,11 @@ function collectDeclarations(source) {
1369
1372
  });
1370
1373
  continue;
1371
1374
  }
1372
- for (let close = head.end + 1; close < projected.length; close += 1) {
1373
- if (projected[close] !== "}") continue;
1374
- declarations.set(key, {
1375
- body: lines.slice(head.end + 1, close).map((record) => record.source),
1376
- bases
1377
- });
1378
- break;
1379
- }
1375
+ const close = Array.prototype.keys.call({ length: projected.length - head.end - 1 }).map((distance) => head.end + 1 + distance).find((candidate) => projected[candidate] === "}");
1376
+ if (close !== void 0) declarations.set(key, {
1377
+ body: lines.slice(head.end + 1, close).map((record) => record.source),
1378
+ bases
1379
+ });
1380
1380
  }
1381
1381
  return declarations;
1382
1382
  }
@@ -1461,19 +1461,27 @@ function extractMemberMethods(lines) {
1461
1461
  * ```
1462
1462
  */
1463
1463
  function selectSectionBlocks(document, heading) {
1464
- const blocks = [];
1465
- let active = false;
1464
+ const scanned = [];
1466
1465
  for (const block of document.children) {
1466
+ const active = scanned.at(-1)?.active ?? false;
1467
1467
  if ((0, _orkestrel_markdown.isHeadingNode)(block) && block.level <= 2) {
1468
1468
  if (block.level === 2 && (0, _orkestrel_markdown.flattenText)(block).trim() === heading) {
1469
- active = true;
1469
+ scanned.push({
1470
+ block,
1471
+ active: true,
1472
+ heading: true
1473
+ });
1470
1474
  continue;
1471
1475
  }
1472
1476
  if (active) break;
1473
1477
  }
1474
- if (active) blocks.push(block);
1478
+ scanned.push({
1479
+ block,
1480
+ active,
1481
+ heading: false
1482
+ });
1475
1483
  }
1476
- return blocks;
1484
+ return scanned.filter((entry) => entry.active && !entry.heading).map((entry) => entry.block);
1477
1485
  }
1478
1486
  /**
1479
1487
  * Extracts one `## Surface` table row's symbol — its column 0 code span as the name, its
@@ -1591,7 +1599,7 @@ function extractSurface(document) {
1591
1599
  const seen = /* @__PURE__ */ new Set();
1592
1600
  for (const block of selectSectionBlocks(document, SURFACE)) {
1593
1601
  if ((0, _orkestrel_markdown.isTableNode)(block)) {
1594
- for (let row = 0; row < block.rows.length; row += 1) {
1602
+ for (const row of block.rows.keys()) {
1595
1603
  const symbol = extractRowSymbol(block, row);
1596
1604
  if (symbol === void 0) continue;
1597
1605
  const key = computeSymbolKey(symbol);
@@ -1635,7 +1643,7 @@ function extractMethods(document) {
1635
1643
  const groups = [];
1636
1644
  for (const [table, name] of collectGroups(document)) {
1637
1645
  const methods = [];
1638
- for (let row = 0; row < table.rows.length; row += 1) {
1646
+ for (const row of table.rows.keys()) {
1639
1647
  const entry = extractRowEntry(table, row);
1640
1648
  if (entry !== void 0) methods.push(entry);
1641
1649
  }
@@ -1662,20 +1670,19 @@ function extractMethods(document) {
1662
1670
  * ```
1663
1671
  */
1664
1672
  function collectGroups(document) {
1665
- const groups = /* @__PURE__ */ new Map();
1666
- let current;
1667
- for (const block of selectSectionBlocks(document, METHODS)) {
1673
+ const groups = [];
1674
+ selectSectionBlocks(document, METHODS).reduce((current, block) => {
1668
1675
  if ((0, _orkestrel_markdown.isHeadingNode)(block) && block.level === 4) {
1669
- const rawInterface = findFirstCode(block.children);
1670
- current = rawInterface === void 0 ? void 0 : normalizeIdentifier(rawInterface);
1671
- continue;
1676
+ const name = findFirstCode(block.children);
1677
+ return name === void 0 ? void 0 : normalizeIdentifier(name);
1672
1678
  }
1673
1679
  if ((0, _orkestrel_markdown.isTableNode)(block) && current !== void 0) {
1674
- groups.set(block, current);
1675
- current = void 0;
1680
+ groups.push([block, current]);
1681
+ return;
1676
1682
  }
1677
- }
1678
- return groups;
1683
+ return current;
1684
+ }, void 0);
1685
+ return new Map(groups);
1679
1686
  }
1680
1687
  /**
1681
1688
  * Extracts every `## Surface` or `## Methods` table row whose first cell carries no code span.
@@ -1828,18 +1835,11 @@ function unwrapComment(comment) {
1828
1835
  * ```
1829
1836
  */
1830
1837
  function normalizeSummary(text) {
1831
- const parts = text.split(/((?<!`)`[^`]+`(?!`))/);
1832
- let normalized = "";
1833
- for (let index = 0; index < parts.length; index += 1) {
1834
- const part = parts[index] ?? "";
1835
- if (index % 2 === 0) {
1836
- normalized += part.replace(/\{@link\s+[^}|]*\|\s*([^}]*?)\s*\}/g, "`$1`").replace(/\{@link\s+(?:import\([^)]*\)\.|[^}|#\s]*[@/][^}|#\s]*#)?([^}|]*?)\s*\}/g, "`$1`");
1837
- continue;
1838
- }
1838
+ return text.split(/((?<!`)`[^`]+`(?!`))/).map((part, index) => {
1839
+ if (index % 2 === 0) return part.replace(/\{@link\s+[^}|]*\|\s*([^}]*?)\s*\}/g, "`$1`").replace(/\{@link\s+(?:import\([^)]*\)\.|[^}|#\s]*[@/][^}|#\s]*#)?([^}|]*?)\s*\}/g, "`$1`");
1839
1840
  const value = part.slice(1, -1).replace(/\s+/g, " ").trim();
1840
- normalized += `\`${value.length === 0 ? " " : value}\``;
1841
- }
1842
- return normalized.replace(/\s+/g, " ").trim();
1841
+ return `\`${value.length === 0 ? " " : value}\``;
1842
+ }).join("").replace(/\s+/g, " ").trim();
1843
1843
  }
1844
1844
  /**
1845
1845
  * Wraps one paragraph into greedy lines no longer than `width` characters. Every run of
@@ -1856,18 +1856,27 @@ function normalizeSummary(text) {
1856
1856
  * ```
1857
1857
  */
1858
1858
  function wrapText(text, width) {
1859
+ const words = text.split(/\s+/).filter((word) => word.length > 0);
1859
1860
  const lines = [];
1860
- let current = "";
1861
- for (const word of text.split(/\s+/)) {
1862
- if (word.length === 0) continue;
1863
- if (current.length === 0) current = word;
1864
- else if (current.length + 1 + word.length <= width) current += ` ${word}`;
1865
- else {
1866
- lines.push(current);
1867
- current = word;
1868
- }
1869
- }
1870
- if (current.length > 0) lines.push(current);
1861
+ const final = words.reduce((previous, word, index) => {
1862
+ if (index === previous.start) return {
1863
+ start: index,
1864
+ length: word.length
1865
+ };
1866
+ if (previous.length + 1 + word.length <= width) return {
1867
+ start: previous.start,
1868
+ length: previous.length + 1 + word.length
1869
+ };
1870
+ lines.push(words.slice(previous.start, index).join(" "));
1871
+ return {
1872
+ start: index,
1873
+ length: word.length
1874
+ };
1875
+ }, {
1876
+ start: 0,
1877
+ length: 0
1878
+ });
1879
+ if (words.length > 0) lines.push(words.slice(final.start).join(" "));
1871
1880
  return lines;
1872
1881
  }
1873
1882
  /**
@@ -1912,18 +1921,16 @@ function buildComment(lines, indent) {
1912
1921
  */
1913
1922
  function maskFences(text) {
1914
1923
  const masked = [];
1915
- let marker;
1916
- for (const line of text.split("\n")) {
1924
+ text.split("\n").reduce((marker, line) => {
1917
1925
  const fence = /^[ \t]*(`{3,}|~{3,})/.exec(line)?.[1];
1918
1926
  if (marker === void 0) {
1919
1927
  masked.push(line);
1920
- marker = fence;
1921
- continue;
1928
+ return fence;
1922
1929
  }
1923
- const closing = fence !== void 0 && fence.startsWith(marker);
1924
- masked.push(closing ? line : " ".repeat(line.length));
1925
- if (closing) marker = void 0;
1926
- }
1930
+ const closed = fence !== void 0 && fence.startsWith(marker);
1931
+ masked.push(closed ? line : " ".repeat(line.length));
1932
+ return closed ? void 0 : marker;
1933
+ }, void 0);
1927
1934
  return masked.join("\n");
1928
1935
  }
1929
1936
  /**
@@ -1949,67 +1956,67 @@ function maskFences(text) {
1949
1956
  */
1950
1957
  function extractSourceComments(lines) {
1951
1958
  const comments = [];
1952
- let block = false;
1953
- let eligible = false;
1954
- let span = [];
1955
- let pending;
1956
- for (const line of lines) {
1959
+ Iterator.from(lines).reduce((previous, line) => {
1957
1960
  const projection = line.jsdoc;
1958
1961
  const first = projection?.indexOf("/**") ?? -1;
1959
- if (pending !== void 0) {
1960
- if (!block && first >= 0 && line.source.slice(0, first).trim() === "") pending = void 0;
1961
- else {
1962
- comments.push({
1963
- text: pending,
1964
- line
1965
- });
1966
- pending = void 0;
1967
- }
1968
- }
1969
- if (projection === void 0) continue;
1970
- let cursor = 0;
1971
- if (block) {
1972
- const close = projection.indexOf("*/");
1973
- const end = close < 0 ? projection.length : close + 2;
1974
- span.push(projection.slice(0, end));
1975
- if (close < 0) continue;
1976
- block = false;
1977
- const opener = projection.indexOf("/**", close + 2);
1978
- const endOfGap = opener < 0 ? line.source.length : opener;
1979
- const whitespace = line.source.slice(close + 2, endOfGap).trim() === "";
1980
- if (opener < 0) {
1981
- pending = eligible && whitespace ? normalizeComment(span.join("\n")) : void 0;
1982
- continue;
1983
- }
1984
- eligible = eligible && whitespace;
1985
- span = [];
1986
- cursor = opener;
1987
- } else {
1988
- if (first < 0) continue;
1989
- eligible = line.source.slice(0, first).trim() === "";
1990
- span = [];
1991
- cursor = first;
1992
- }
1993
- while (cursor < projection.length) {
1994
- const close = projection.indexOf("*/", cursor + 2);
1995
- const end = close < 0 ? projection.length : close + 2;
1996
- span.push(projection.slice(cursor, end));
1997
- if (close < 0) {
1998
- block = true;
1999
- break;
2000
- }
2001
- const opener = projection.indexOf("/**", close + 2);
2002
- const endOfGap = opener < 0 ? line.source.length : opener;
2003
- const whitespace = line.source.slice(close + 2, endOfGap).trim() === "";
2004
- if (opener < 0) {
2005
- pending = eligible && whitespace ? normalizeComment(span.join("\n")) : void 0;
2006
- break;
2007
- }
2008
- eligible = eligible && whitespace;
2009
- span = [];
2010
- cursor = opener;
2011
- }
2012
- }
1962
+ if (previous.pending !== void 0 && !(!previous.block && first >= 0 && line.source.slice(0, first).trim() === "")) comments.push({
1963
+ text: previous.pending,
1964
+ line
1965
+ });
1966
+ const state = {
1967
+ ...previous,
1968
+ pending: void 0
1969
+ };
1970
+ if (projection === void 0) return state;
1971
+ const close = state.block ? projection.indexOf("*/") : -1;
1972
+ const end = close < 0 ? projection.length : close + 2;
1973
+ if (state.block) state.span.push(projection.slice(0, end));
1974
+ if (state.block && close < 0) return state;
1975
+ const opener = state.block ? projection.indexOf("/**", close + 2) : first;
1976
+ const whitespace = state.block ? line.source.slice(close + 2, opener < 0 ? line.source.length : opener).trim() === "" : line.source.slice(0, first).trim() === "";
1977
+ const eligible = state.block ? state.eligible && whitespace : whitespace;
1978
+ if (opener < 0) return state.block ? {
1979
+ ...state,
1980
+ block: false,
1981
+ pending: eligible ? normalizeComment(state.span.join("\n")) : void 0
1982
+ } : state;
1983
+ const spans = /\/\*(?=\*)[\s\S]*?(?:\*\/|$)/g;
1984
+ spans.lastIndex = opener;
1985
+ return Iterator.from(projection.matchAll(spans)).reduce((current, match) => {
1986
+ const cursor = match.index;
1987
+ const closing = projection.indexOf("*/", cursor + 2);
1988
+ const finish = closing < 0 ? projection.length : closing + 2;
1989
+ const span = [projection.slice(cursor, finish)];
1990
+ if (closing < 0) return {
1991
+ ...current,
1992
+ span,
1993
+ block: true
1994
+ };
1995
+ const next = projection.indexOf("/**", closing + 2);
1996
+ const gap = line.source.slice(closing + 2, next < 0 ? line.source.length : next).trim() === "";
1997
+ if (next < 0) return {
1998
+ ...current,
1999
+ span,
2000
+ block: false,
2001
+ pending: current.eligible && gap ? normalizeComment(span.join("\n")) : void 0
2002
+ };
2003
+ return {
2004
+ ...current,
2005
+ span,
2006
+ block: false,
2007
+ eligible: current.eligible && gap
2008
+ };
2009
+ }, {
2010
+ ...state,
2011
+ block: false,
2012
+ eligible
2013
+ });
2014
+ }, {
2015
+ block: false,
2016
+ eligible: false,
2017
+ span: [],
2018
+ pending: void 0
2019
+ });
2013
2020
  return comments;
2014
2021
  }
2015
2022
  /**
@@ -2108,28 +2115,24 @@ function extractBodyLines(lines) {
2108
2115
  * ```
2109
2116
  */
2110
2117
  function collectKeys(lines) {
2111
- const keys = /* @__PURE__ */ new Map();
2112
- let owner;
2113
- for (const line of lines) {
2118
+ const keys = [];
2119
+ Iterator.from(lines).reduce((owner, line) => {
2114
2120
  const head = /^export (?:async )?(?:abstract )?(function\*?|class|const|interface|type) (\w+)/.exec(line.code);
2115
2121
  const keyword = head?.[1]?.replace(/\*$/, "");
2116
2122
  const name = head?.[2];
2117
2123
  if ((0, _orkestrel_contract.isNonEmptyString)(keyword) && (0, _orkestrel_contract.isNonEmptyString)(name) && isExportKeyword(keyword)) {
2118
- keys.set(line, computeSymbolKey({
2124
+ keys.push([line, computeSymbolKey({
2119
2125
  name,
2120
2126
  keyword
2121
- }));
2122
- owner = keyword === "class" || keyword === "interface" ? name : void 0;
2123
- continue;
2124
- }
2125
- if (line.code === "}") {
2126
- owner = void 0;
2127
- continue;
2127
+ })]);
2128
+ return keyword === "class" || keyword === "interface" ? name : void 0;
2128
2129
  }
2130
+ if (line.code === "}") return void 0;
2129
2131
  const member = /^\t(?:async )?\*?(\w+)\??(?:<.*>)?\(/.exec(line.code)?.[1];
2130
- if (owner !== void 0 && (0, _orkestrel_contract.isNonEmptyString)(member)) keys.set(line, `${owner}.${member}`);
2131
- }
2132
- return keys;
2132
+ if (owner !== void 0 && (0, _orkestrel_contract.isNonEmptyString)(member)) keys.push([line, `${owner}.${member}`]);
2133
+ return owner;
2134
+ }, void 0);
2135
+ return new Map(keys);
2133
2136
  }
2134
2137
  /**
2135
2138
  * Collects the `@example` blocks one doc block's unwrapped text carries, each named for the
@@ -2150,9 +2153,7 @@ function collectKeys(lines) {
2150
2153
  function collectExamples(comment, name) {
2151
2154
  const examples = [];
2152
2155
  const masked = maskFences(comment);
2153
- const tags = /^[ \t]*@example(?=[ \t]|$)[ \t]*(.*)$/gm;
2154
- let tag;
2155
- while ((tag = tags.exec(masked)) !== null) {
2156
+ for (const tag of masked.matchAll(/^[ \t]*@example(?=[ \t]|$)[ \t]*(.*)$/gm)) {
2156
2157
  const title = (tag[1] ?? "").trim();
2157
2158
  const start = tag.index + tag[0].length;
2158
2159
  const rest = comment.slice(start).replace(/^\n/, "");
@@ -2277,20 +2278,17 @@ function extractFences(document) {
2277
2278
  * ```
2278
2279
  */
2279
2280
  function collectFences(document) {
2280
- const fences = /* @__PURE__ */ new Map();
2281
- let title = "";
2282
- for (const node of (0, _orkestrel_markdown.walkNodes)(document)) {
2283
- if ((0, _orkestrel_markdown.isHeadingNode)(node)) {
2284
- title = (0, _orkestrel_markdown.flattenText)(node).trim();
2285
- continue;
2286
- }
2287
- if ((0, _orkestrel_markdown.isCodeBlockNode)(node)) fences.set(node, {
2281
+ const fences = [];
2282
+ Iterator.from((0, _orkestrel_markdown.walkNodes)(document)).reduce((title, node) => {
2283
+ if ((0, _orkestrel_markdown.isHeadingNode)(node)) return (0, _orkestrel_markdown.flattenText)(node).trim();
2284
+ if ((0, _orkestrel_markdown.isCodeBlockNode)(node)) fences.push([node, {
2288
2285
  language: node.lang,
2289
2286
  code: node.code,
2290
2287
  ...title.length === 0 ? {} : { title }
2291
- });
2292
- }
2293
- return fences;
2288
+ }]);
2289
+ return title;
2290
+ }, "");
2291
+ return new Map(fences);
2294
2292
  }
2295
2293
  /**
2296
2294
  * Extracts the guide's tagline — the text of the blockquote following the document's H1,
@@ -2306,17 +2304,30 @@ function collectFences(document) {
2306
2304
  * ```
2307
2305
  */
2308
2306
  function extractTagline(document) {
2309
- let opened = false;
2307
+ const scanned = [];
2310
2308
  for (const block of document.children) {
2309
+ const opened = scanned.at(-1)?.opened ?? false;
2311
2310
  if ((0, _orkestrel_markdown.isHeadingNode)(block)) {
2312
- if (opened) return void 0;
2313
- opened = block.level === 1;
2311
+ if (opened) break;
2312
+ scanned.push({
2313
+ block,
2314
+ opened: block.level === 1,
2315
+ selected: void 0
2316
+ });
2314
2317
  continue;
2315
2318
  }
2316
- if (!opened || !(0, _orkestrel_markdown.isBlockquoteNode)(block)) continue;
2317
- const text = normalizeSummary(block.children.filter(_orkestrel_markdown.isParagraphNode).map((paragraph) => extractCellText(paragraph.children)).join(" "));
2318
- return text.length === 0 ? void 0 : text;
2319
+ const selected = opened && (0, _orkestrel_markdown.isBlockquoteNode)(block) ? block : void 0;
2320
+ scanned.push({
2321
+ block,
2322
+ opened,
2323
+ selected
2324
+ });
2325
+ if (selected !== void 0) break;
2319
2326
  }
2327
+ const selected = scanned.find((entry) => entry.selected !== void 0)?.selected;
2328
+ if (selected === void 0) return void 0;
2329
+ const text = normalizeSummary(selected.children.filter(_orkestrel_markdown.isParagraphNode).map((paragraph) => extractCellText(paragraph.children)).join(" "));
2330
+ return text.length === 0 ? void 0 : text;
2320
2331
  }
2321
2332
  /**
2322
2333
  * Computes the drift between one compared key's guide text and source text. A pair agrees
@@ -2737,33 +2748,26 @@ function renderExample(example) {
2737
2748
  function replaceCell(guide, key, summary) {
2738
2749
  const markdown = (0, _orkestrel_markdown.createMarkdown)(guide);
2739
2750
  const document = markdown.document;
2740
- let located;
2741
- let index = -1;
2742
- for (const block of selectSectionBlocks(document, SURFACE)) {
2743
- if (located !== void 0 || !(0, _orkestrel_markdown.isTableNode)(block)) continue;
2744
- for (let row = 0; row < block.rows.length && located === void 0; row += 1) {
2745
- const symbol = extractRowSymbol(block, row);
2746
- if (symbol === void 0 || computeSymbolKey(symbol) !== key) continue;
2747
- located = block;
2748
- index = row;
2749
- }
2750
- }
2751
- for (const [table, owner] of collectGroups(document)) {
2752
- if (located !== void 0) break;
2753
- for (let row = 0; row < table.rows.length && located === void 0; row += 1) {
2754
- const entry = extractRowEntry(table, row);
2755
- if (entry === void 0 || `${owner}.${entry.name}` !== key) continue;
2756
- located = table;
2757
- index = row;
2758
- }
2759
- }
2760
- if (located === void 0) return void 0;
2761
- const column = findColumnIndex(located, SUMMARY);
2751
+ const surface = Iterator.from(selectSectionBlocks(document, SURFACE)).filter(_orkestrel_markdown.isTableNode).flatMap((table) => table.rows.keys().map((index) => ({
2752
+ table,
2753
+ index,
2754
+ symbol: extractRowSymbol(table, index)
2755
+ }))).find((row) => row.symbol !== void 0 && computeSymbolKey(row.symbol) === key);
2756
+ const groups = collectGroups(document);
2757
+ const selected = surface ?? Iterator.from(groups).flatMap(([table, owner]) => table.rows.keys().map((index) => ({
2758
+ table,
2759
+ index,
2760
+ owner,
2761
+ entry: extractRowEntry(table, index)
2762
+ }))).find((row) => row.entry !== void 0 && `${row.owner}.${row.entry.name}` === key);
2763
+ if (selected === void 0) return void 0;
2764
+ const { table, index } = selected;
2765
+ const column = findColumnIndex(table, SUMMARY);
2762
2766
  if (column === void 0) return void 0;
2763
- if ((extractRowSummary(located, index) ?? "") === normalizeSummary(summary)) return guide;
2764
- const span = markdown.span(located);
2767
+ if ((extractRowSummary(table, index) ?? "") === normalizeSummary(summary)) return guide;
2768
+ const span = markdown.span(table);
2765
2769
  if (span === void 0) return void 0;
2766
- return spliceSpan(guide, span, (0, _orkestrel_markdown.renderMarkdown)(buildTable(located, index, column, summary)));
2770
+ return spliceSpan(guide, span, (0, _orkestrel_markdown.renderMarkdown)(buildTable(table, index, column, summary)));
2767
2771
  }
2768
2772
  /**
2769
2773
  * Replaces one titled fence in a guide's text and returns the whole guide back. The first fence
@@ -2792,14 +2796,9 @@ function replaceCell(guide, key, summary) {
2792
2796
  */
2793
2797
  function replaceFence(guide, title, example) {
2794
2798
  const markdown = (0, _orkestrel_markdown.createMarkdown)(guide);
2795
- let located;
2796
- let current;
2797
- for (const [node, fence] of collectFences(markdown.document)) {
2798
- if (located !== void 0 || fence.title !== title) continue;
2799
- located = node;
2800
- current = fence;
2801
- }
2802
- if (located === void 0 || current === void 0) return void 0;
2799
+ const selected = Iterator.from(collectFences(markdown.document)).find(([, fence]) => fence.title === title);
2800
+ if (selected === void 0) return void 0;
2801
+ const [located, current] = selected;
2803
2802
  if (current.code === example.code && current.language === example.language) return guide;
2804
2803
  const span = markdown.span(located);
2805
2804
  if (span === void 0) return void 0;
@@ -2849,9 +2848,7 @@ function replaceSummary(comment, summary, width = 100) {
2849
2848
  const indent = /^[ \t]*/.exec(comment)?.[0] ?? "";
2850
2849
  const wrapped = wrapText(summary, width - indent.length - 3);
2851
2850
  if (wrapped.length === 0) return void 0;
2852
- const masked = maskFences(content.join("\n")).split("\n");
2853
- let tag = -1;
2854
- for (let index = 0; index < masked.length && tag < 0; index += 1) if (/^[ \t]*@\w/.test(masked[index] ?? "")) tag = index;
2851
+ const tag = maskFences(content.join("\n")).split("\n").findIndex((line) => /^[ \t]*@\w/.test(line));
2855
2852
  if (normalizeSummary(content.slice(0, tag < 0 ? content.length : tag).join("\n")) === normalizeSummary(summary)) return comment;
2856
2853
  const tail = tag < 0 ? [] : content.slice(tag);
2857
2854
  if (tail.length === 0 && wrapped.length === 1 && content.length === 1) {
@@ -2907,17 +2904,17 @@ function replaceExample(comment, example) {
2907
2904
  const content = unwrapComment(comment);
2908
2905
  const masked = maskFences(content.join("\n")).split("\n");
2909
2906
  const title = example.title ?? "";
2910
- let start = -1;
2911
- for (let index = 0; index < masked.length && start < 0; index += 1) {
2912
- const tag = /^[ \t]*@example(?=[ \t]|$)[ \t]*(.*)$/.exec(masked[index] ?? "");
2913
- if (tag !== null && (tag[1] ?? "").trim() === title) start = index;
2914
- }
2907
+ const start = masked.findIndex((line) => {
2908
+ const tag = /^[ \t]*@example(?=[ \t]|$)[ \t]*(.*)$/.exec(line);
2909
+ return tag !== null && (tag[1] ?? "").trim() === title;
2910
+ });
2915
2911
  if (start < 0) return void 0;
2916
2912
  const current = collectExamples(content.join("\n"), example.name).find((entry) => (entry.title ?? "") === title);
2917
2913
  if (current !== void 0 && current.code === example.code && current.language === example.language) return comment;
2918
- let end = content.length;
2919
- for (let index = start + 1; index < masked.length && end === content.length; index += 1) if (/^[ \t]*@\w/.test(masked[index] ?? "")) end = index;
2920
- while (end > start + 1 && (content[end - 1] ?? "").length === 0) end -= 1;
2914
+ const next = masked.findIndex((line, index) => index > start && /^[ \t]*@\w/.test(line));
2915
+ const boundary = next < 0 ? content.length : next;
2916
+ const last = content.findLastIndex((line, index) => index > start && index < boundary && line.length > 0);
2917
+ const end = last < 0 ? start + 1 : last + 1;
2921
2918
  const indent = /^[ \t]*/.exec(comment)?.[0] ?? "";
2922
2919
  const body = [
2923
2920
  `\`\`\`${example.language ?? ""}`,
@@ -2975,52 +2972,56 @@ function replaceExample(comment, example) {
2975
2972
  function locateComment(text, key) {
2976
2973
  const lines = extractSourceLines(text);
2977
2974
  const keys = collectKeys(lines);
2978
- const offsets = [];
2979
- const positions = /* @__PURE__ */ new Map();
2980
- let offset = 0;
2981
- for (let index = 0; index < lines.length; index += 1) {
2982
- const line = lines[index];
2983
- if (line === void 0) continue;
2984
- offsets.push(offset);
2985
- positions.set(line, index);
2975
+ const records = [];
2976
+ for (const [index, line] of lines.entries()) {
2977
+ const offset = records.at(-1)?.next ?? 0;
2986
2978
  const after = offset + line.source.length;
2987
- offset = after + (text.startsWith("\r\n", after) ? 2 : 1);
2979
+ records.push({
2980
+ line,
2981
+ index,
2982
+ offset,
2983
+ next: after + (text.startsWith("\r\n", after) ? 2 : 1)
2984
+ });
2988
2985
  }
2986
+ const offsets = records.map((record) => record.offset);
2987
+ const positions = new Map(records.map((record) => [record.line, record.index]));
2989
2988
  for (const comment of extractSourceComments(lines)) {
2990
2989
  if (keys.get(comment.line) !== key) continue;
2991
2990
  const close = (positions.get(comment.line) ?? 0) - 1;
2992
2991
  const closing = lines[close]?.jsdoc;
2993
2992
  const end = closing === void 0 ? -1 : closing.lastIndexOf("*/");
2994
2993
  if (end < 0) continue;
2995
- let first = close;
2996
- while (first > 0 && lines[first - 1]?.jsdoc !== void 0) first -= 1;
2997
- let inside = false;
2998
- let line = -1;
2999
- let column = -1;
3000
- for (let index = first; index <= close; index += 1) {
2994
+ const first = lines.keys().take(close).map((index) => close - index).find((index) => lines[index - 1]?.jsdoc === void 0) ?? 0;
2995
+ const found = Array.prototype.keys.call({ length: close - first + 1 }).map((distance) => first + distance).reduce((state, index) => {
3001
2996
  const projection = lines[index]?.jsdoc ?? "";
3002
- let cursor = 0;
3003
- while (cursor < projection.length) {
3004
- const at = projection.indexOf(inside ? "*/" : "/**", cursor);
3005
- if (at < 0) break;
3006
- if (!inside) {
3007
- line = index;
3008
- column = at;
3009
- }
3010
- cursor = at + (inside ? 2 : 3);
3011
- inside = !inside;
3012
- }
3013
- }
3014
- if (line < 0) continue;
3015
- const start = (lines[line]?.source ?? "").slice(0, column).trim() === "" ? 0 : column;
2997
+ return Iterator.from(projection.matchAll(/(?=\/\*\*|\*\/)/g)).reduce((current, match) => {
2998
+ const at = match.index;
2999
+ if (at < current.cursor || !projection.startsWith(current.inside ? "*/" : "/**", at)) return current;
3000
+ return {
3001
+ inside: !current.inside,
3002
+ line: current.inside ? current.line : index,
3003
+ column: current.inside ? current.column : at,
3004
+ cursor: at + (current.inside ? 2 : 3)
3005
+ };
3006
+ }, {
3007
+ ...state,
3008
+ cursor: 0
3009
+ });
3010
+ }, {
3011
+ inside: false,
3012
+ line: -1,
3013
+ column: -1,
3014
+ cursor: 0
3015
+ });
3016
+ if (found.line < 0) continue;
3017
+ const start = (lines[found.line]?.source ?? "").slice(0, found.column).trim() === "" ? 0 : found.column;
3016
3018
  return {
3017
- start: (offsets[line] ?? 0) + start,
3019
+ start: (offsets[found.line] ?? 0) + start,
3018
3020
  end: (offsets[close] ?? 0) + end + 2
3019
3021
  };
3020
3022
  }
3021
3023
  }
3022
- //#endregion
3023
- //#region src/core/parsers.ts
3024
+ // src/core/parsers.ts
3024
3025
  /**
3025
3026
  * Parses a `## By concept` manifest table into its {@link ManifestEntry} rows —
3026
3027
  * each row's Concept cell (flattened text), Spec / Tests cells (a single link
@@ -3072,8 +3073,7 @@ function parseManifest(markdown, directory) {
3072
3073
  }
3073
3074
  return entries;
3074
3075
  }
3075
- //#endregion
3076
- //#region src/core/shapers.ts
3076
+ // src/core/shapers.ts
3077
3077
  /**
3078
3078
  * Shapes a {@link SurfaceSymbol} — a documented / exported symbol's `name`
3079
3079
  * paired with its {@link ExportKeyword} and its optional compared `summary`.
@@ -3183,8 +3183,7 @@ var manifestEntryShape = (0, _orkestrel_contract.objectShape)({
3183
3183
  source: (0, _orkestrel_contract.unionShape)((0, _orkestrel_contract.stringShape)(), (0, _orkestrel_contract.arrayShape)((0, _orkestrel_contract.stringShape)())),
3184
3184
  tests: (0, _orkestrel_contract.stringShape)()
3185
3185
  });
3186
- //#endregion
3187
- //#region src/core/Guide.ts
3186
+ // src/core/Guide.ts
3188
3187
  /**
3189
3188
  * Presents a pure, structured view over one parsed guide — the documented
3190
3189
  * projections (`sections` / `tagline` / `surface` / `methods` / `unnamed` / `links` /
@@ -3249,8 +3248,7 @@ var Guide = class {
3249
3248
  return this.#fences;
3250
3249
  }
3251
3250
  };
3252
- //#endregion
3253
- //#region src/core/sources/Source.ts
3251
+ // src/core/sources/Source.ts
3254
3252
  /**
3255
3253
  * Reflects, as a pure `SourceInterface`, a module scope's intentional direct declarations,
3256
3254
  * conventional barrel-reachable surface, and member methods over a consumer-supplied file
@@ -3469,8 +3467,7 @@ var Source = class {
3469
3467
  return declarations;
3470
3468
  }
3471
3469
  };
3472
- //#endregion
3473
- //#region src/core/sources/SourceManager.ts
3470
+ // src/core/sources/SourceManager.ts
3474
3471
  /**
3475
3472
  * Resolves a consumer-owned import-specifier policy into pure source views and
3476
3473
  * caches those views by module, so aliases for one module share one entity.
@@ -3524,8 +3521,7 @@ var SourceManager = class {
3524
3521
  return views;
3525
3522
  }
3526
3523
  };
3527
- //#endregion
3528
- //#region src/core/Parity.ts
3524
+ // src/core/Parity.ts
3529
3525
  /**
3530
3526
  * Composes generic guide-parity inspection and explicit in-memory rewrites over a caller inventory.
3531
3527
  */
@@ -3825,21 +3821,19 @@ var Parity = class Parity {
3825
3821
  files: this.#options.files,
3826
3822
  modules: this.#options.modules
3827
3823
  });
3828
- let compared = false;
3829
- for (const fence of row.guide.fences()) {
3830
- if (fence.language !== this.#options.language) continue;
3831
- for (const imported of extractFenceImports(fence.code)) {
3824
+ if (!Iterator.from(row.guide.fences()).reduce((previous, fence) => {
3825
+ if (fence.language !== this.#options.language) return previous;
3826
+ return Iterator.from(extractFenceImports(fence.code)).reduce((matched, imported) => {
3832
3827
  const source = sources.source(imported.specifier);
3833
- if (source === void 0) continue;
3834
- compared = true;
3828
+ if (source === void 0) return matched;
3835
3829
  const surface = source.surface().map((symbol) => symbol.name);
3836
3830
  for (const name of findMissing(imported.names, surface)) findings.push({
3837
3831
  spec: row.entry.spec,
3838
3832
  text: `${row.entry.spec} imports missing ${name} from ${imported.specifier}.`
3839
3833
  });
3840
- }
3841
- }
3842
- if (!compared) findings.push({
3834
+ return true;
3835
+ }, previous);
3836
+ }, false)) findings.push({
3843
3837
  spec: row.entry.spec,
3844
3838
  text: `${row.entry.spec} has no mapped self import.`
3845
3839
  });
@@ -3941,17 +3935,16 @@ var Parity = class Parity {
3941
3935
  for (const path of selectModuleKeys(inventory, normalizeDirectories(row.entry.source))) {
3942
3936
  const text = files.get(path);
3943
3937
  if (text === void 0) continue;
3944
- let selected;
3945
- for (const key of keys) {
3938
+ const selected = keys.reduce((previous, key) => {
3946
3939
  const span = locateComment(text, key);
3947
- if (span === void 0) continue;
3940
+ if (span === void 0) return previous;
3948
3941
  const example = collectExamples(normalizeComment(text.slice(span.start, span.end)), target.name).find((entry) => entry.title === title);
3949
- if (example === void 0) continue;
3950
- if (selected === void 0 || span.start < selected.span.start) selected = {
3942
+ if (example === void 0) return previous;
3943
+ return previous === void 0 || span.start < previous.span.start ? {
3951
3944
  span,
3952
3945
  example
3953
- };
3954
- }
3946
+ } : previous;
3947
+ }, void 0);
3955
3948
  if (selected !== void 0) return {
3956
3949
  path,
3957
3950
  text,
@@ -3960,8 +3953,7 @@ var Parity = class Parity {
3960
3953
  }
3961
3954
  }
3962
3955
  };
3963
- //#endregion
3964
- //#region src/core/factories.ts
3956
+ // src/core/factories.ts
3965
3957
  /**
3966
3958
  * Creates a structured {@link GuideInterface} view over one guide's markdown
3967
3959
  * source — parses once and caches its `sections` / `surface` / `methods` /
@@ -4147,7 +4139,6 @@ function createMethodGroupContract() {
4147
4139
  function createManifestEntryContract() {
4148
4140
  return (0, _orkestrel_contract.createContract)(manifestEntryShape);
4149
4141
  }
4150
- //#endregion
4151
4142
  exports.DRIFT_CATEGORIES = DRIFT_CATEGORIES;
4152
4143
  exports.EXPORT_KEYWORDS = EXPORT_KEYWORDS;
4153
4144
  exports.EXTERNAL_SCHEMES = EXTERNAL_SCHEMES;