MCPcopy Create free account
hub / github.com/Noumena-Network/code / buildMatrixBlock

Function buildMatrixBlock

src/components/Markdown.robustness.test.tsx:568–679  ·  view source on GitHub ↗
(
  kind:
    | 'paragraph'
    | 'list'
    | 'ordered'
    | 'table'
    | 'diagram'
    | 'fence'
    | 'fencedDiagram'
    | 'blockquote'
    | 'hiddenSystem',
  seed: number,
  index: number,
)

Source from the content-addressed store, hash-verified

566}
567
568function buildMatrixBlock(
569 kind:
570 | 'paragraph'
571 | 'list'
572 | 'ordered'
573 | 'table'
574 | 'diagram'
575 | 'fence'
576 | 'fencedDiagram'
577 | 'blockquote'
578 | 'hiddenSystem',
579 seed: number,
580 index: number,
581): MarkdownMatrixBlock {
582 switch (kind) {
583 case 'paragraph': {
584 const visible = `MATRIX_PARAGRAPH_${seed}_${index}`
585 return {
586 content: `Paragraph probe ${visible} with ordinary prose and client -> api arrows.`,
587 visibleTokens: [visible],
588 hiddenTokens: [],
589 diagramProbes: [],
590 codeProbes: [],
591 }
592 }
593 case 'list': {
594 const visible = `MATRIX_LIST_${seed}_${index}`
595 return {
596 content: [`- ${visible}`, `- continuation_${seed}_${index}`].join('\n'),
597 visibleTokens: [visible, `continuation_${seed}_${index}`],
598 hiddenTokens: [],
599 diagramProbes: [],
600 codeProbes: [],
601 }
602 }
603 case 'ordered': {
604 const visible = `MATRIX_ORDERED_${seed}_${index}`
605 return {
606 content: [`1. ${visible}`, `2. ordered_tail_${seed}_${index}`].join('\n'),
607 visibleTokens: [visible, `ordered_tail_${seed}_${index}`],
608 hiddenTokens: [],
609 diagramProbes: [],
610 codeProbes: [],
611 }
612 }
613 case 'table': {
614 const visible = `MATRIX_TABLE_${seed}_${index}`
615 return {
616 content: [
617 '| Name | Value |',
618 '|------|-------|',
619 `| ${visible} | active |`,
620 ].join('\n'),
621 visibleTokens: [visible, 'active'],
622 hiddenTokens: [],
623 diagramProbes: [],
624 codeProbes: [],
625 }

Callers 1

Calls 2

makeDiagramFunction · 0.85
makeFenceFunction · 0.85

Tested by

no test coverage detected