MCPcopy Create free account
hub / github.com/arktypeio/arktype / parseJsDocText

Function parseJsDocText

ark/repo/jsdocGen.ts:491–500  ·  view source on GitHub ↗
(text: string | undefined)

Source from the content-addressed store, hash-verified

489}
490
491const parseJsDocText = (text: string | undefined): ParsedJsDocPart[] => {
492 if (!text) return []
493 const sections = text.split(noteDelimiterRegex)
494 // split can't break at index 0, so text after a {@link} may open with a note
495 return sections.map((sectionText, i) =>
496 i === 0 && !noteDelimiterRegex.test(sectionText) ?
497 { kind: "text", value: sectionText }
498 : { kind: "noteStart", value: sectionText.trimStart() }
499 )
500}
501
502const describedLinkRegex = /{@link\s+(https?:\/\/[^\s|}]+)(?:\s*\|\s*([^}]*))?}/
503

Callers 2

parseBlockFunction · 0.85
parseJsDocPartFunction · 0.85

Calls 2

testMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected