(attrs: string, host: Language)
| 41 | * Anything else is JavaScript, whose grammar reads JSX (`lang="jsx"`) already. |
| 42 | */ |
| 43 | export 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 |
no outgoing calls
no test coverage detected