Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import defaultParserInterface from './utils/defaultESTreeParserInterface';
import pkg from 'meriyah/package.json';
const ID = pkg.name;
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage,
loadParser(callback) {
require(['meriyah'], callback);
},
parse(parser, code, options) {
return parser.parse(code, options);
},
nodeToRange(node) {
if (typeof node.start === 'number') {
return [node.start, node.end];
}
},
getDefaultOptions() {
renderSettings(parserSettings, onChange) {
return (
<div>
<p>
<a rel="noopener noreferrer" href="{pkg.homepage}">
Option descriptions
</a>
</p>
{defaultParserInterface.renderSettings.call(
this,
parserSettings,
onChange,
)}
</div>
);
},
};