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