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/defaultESTreeParserInterface';
import pkg from 'recast/package.json';
import flowParser, * as flowSettings from './flow';
import babylon6Parser, * as babylon6Settings from './babylon6';
import babylon7Parser, * as babylon7Settings from './babylon7';
const ID = 'recast';
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage,
locationProps: new Set(['range', 'loc', 'start', 'end']),
loadParser(callback) {
require(
['recast', 'babel5', 'babylon6', 'babylon7', 'flow-parser', 'recast/parsers/typescript'],
(recast, babelCore, babylon6, babylon7, flow, typescript) => {
callback({
recast,
parsers: {
'babel5': babelCore,
babylon6,
babylon7,
flow,
typescript,
},
});