Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import compileModule from '../../../utils/compileModule';
import pkg from 'regexp-tree/package.json';
const ID = 'regexp-tree';
export default {
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage,
defaultParserID: ID,
loadTransformer(callback) {
require([
'../../../transpilers/babel',
'regexp-tree',
], (transpile, regexpTree) => callback({ transpile: transpile.default, regexpTree }));
},
transform({ transpile, regexpTree }, transformCode, code) {
transformCode = transpile(transformCode);
let handler = compileModule( // eslint-disable-line no-shadow
transformCode,
);
import defaultParserInterface from '../utils/defaultParserInterface';
import pkg from 'regexp-tree/package.json';
const ID = 'regexp-tree';
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage,
locationProps: new Set(['loc']),
loadParser(callback) {
require(['regexp-tree'], (regexpTree) => {
callback(regexpTree);
});
},
parse(regexpTree, code, options={}) {
regexpTree
.parser
.setOptions(options);
return regexpTree.parse(code);
},