1 0
import parseComponent from './parseComponent'
2

3
/**
4
 * Determines if the given code is a VueSfc file
5
 * It does not throw if the code is invalid, just returns `false`
6
 * @param code JavaScript or vue code to analyze
7
 */
8 0
export default function isCodeVueSfc(code: string): boolean {
9 0
	const parts = parseComponent(code)
10 1
	return !!parts.script || !!parts.template
11
}

Read our documentation on viewing source code .

Loading