MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / sfcScriptLanguage

Function sfcScriptLanguage

src/extraction/sfc-script.ts:43–47  ·  view source on GitHub ↗
(attrs: string, host: Language)

Source from the content-addressed store, hash-verified

41 * Anything else is JavaScript, whose grammar reads JSX (`lang="jsx"`) already.
42 */
43export function sfcScriptLanguage(attrs: string, host: Language): Language {
44 if (TS_LANG_ATTR.test(attrs)) return 'typescript';
45 if (host === 'vue' && TSX_LANG_ATTR.test(attrs)) return 'tsx';
46 return 'javascript';
47}
48
49/**
50 * A `<script>` element of a Vue, Svelte or Astro file: group 1 its opening

Callers 4

processScriptBlocksMethod · 0.90
extractScriptBlocksMethod · 0.90
extractScriptBlocksMethod · 0.90
syntaxRegionsForFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected