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 '@glimmer/syntax/package.json';
const ID = 'glimmer';
export default {
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage || 'https://github.com/glimmerjs/glimmer-vm',
defaultParserID: 'glimmer',
loadTransformer(callback) {
require(
['../../../transpilers/babel', '@glimmer/syntax'],
(transpile, glimmer) => callback({ transpile: transpile.default, glimmer }),
);
},
transform({ transpile, glimmer }, transformCode, code) {
transformCode = transpile(transformCode);
const transformModule = compileModule(transformCode);
// allow "export default" instead of "module.exports = "
const transform = transformModule.__esModule ?
import defaultParserInterface from './utils/defaultHandlebarsParserInterface';
import pkg from '@glimmer/syntax/package.json';
const ID = 'glimmer';
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage || 'https://github.com/glimmerjs/glimmer-vm',
loadParser(callback) {
require(['@glimmer/syntax'], (glimmer) => callback(glimmer.preprocess));
},
opensByDefault(node, key) {
return key === 'body';
},
};