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 'webidl2/package.json';
const ID = 'webidl2';
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage || 'https://github.com/w3c/webidl2.js',
typeProps: new Set(['name', 'type', 'idlType', 'escapedName']),
getNodeName(node) {
if (node.name) {
return node.name + (node.optional ? '?' : '');
} else if (node.type) {
return node.type;
} else if (node.idlType) {
return node.idlType.idlType || node.idlType;
}
},
loadParser(callback) {
require(['webidl2'], callback);
},