MCPcopy Create free account
hub / github.com/Effect-TS/effect / skipLeadingIgnoredTrivia

Function skipLeadingIgnoredTrivia

packages/tools/jsdocs/src/Jsdocs.ts:3281–3292  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

3279}
3280
3281function skipLeadingIgnoredTrivia(source: string): number {
3282 let index = source.charCodeAt(0) === 0xfeff ? 1 : 0
3283 while (index < source.length) {
3284 while (index < source.length && /\s/.test(source[index])) index++
3285 if (!source.startsWith("//", index)) return index
3286 const lineEnd = source.indexOf("\n", index)
3287 const end = lineEnd === -1 ? source.length : lineEnd + 1
3288 if (!isSkippableDirectiveComment(source.slice(index, end))) return index
3289 index = end
3290 }
3291 return index
3292}
3293
3294function sourceFileTopLevelJSDoc(sourceFile: ts.SourceFile): ParsedModuleJSDoc | undefined {
3295 const source = sourceFile.text

Callers 1

sourceFileTopLevelJSDocFunction · 0.85

Calls 2

sliceMethod · 0.80

Tested by

no test coverage detected