Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import defaultParserInterface from '../utils/defaultParserInterface';
import pkg from 'vue-template-compiler/package.json';
const ID = 'vue';
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage,
locationProps: new Set(['start', 'end']),
typeProps: new Set(['tag']),
loadParser(callback) {
require(['vue-template-compiler/browser'], callback);
},
parse(parser, code, options) {
return parser.compile(code, options).ast;
},
nodeToRange(node) {
if (node.type || node.name) {
return [node.start, node.end];
}
},