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

Function skipLeadingIgnoredTrivia

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

Source from the content-addressed store, hash-verified

3209}
3210
3211function skipLeadingIgnoredTrivia(source: string): number {
3212 let index = source.charCodeAt(0) === 0xfeff ? 1 : 0
3213 while (index < source.length) {
3214 while (index < source.length && /\s/.test(source[index])) index++
3215 if (!source.startsWith("//", index)) return index
3216 const lineEnd = source.indexOf("\n", index)
3217 const end = lineEnd === -1 ? source.length : lineEnd + 1
3218 if (!isSkippableDirectiveComment(source.slice(index, end))) return index
3219 index = end
3220 }
3221 return index
3222}
3223
3224function sourceFileTopLevelJSDoc(sourceFile: ts.SourceFile): ParsedModuleJSDoc | undefined {
3225 const source = sourceFile.text

Callers 1

sourceFileTopLevelJSDocFunction · 0.85

Calls 1

Tested by

no test coverage detected