Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function(fileInfo, api, options) {
const config = new Config(options);
if (shouldSkipFile(fileInfo, config)) {
return fileInfo.source;
}
const ast = glimmer.preprocess(fileInfo.source, {
mode: 'codemod',
parseOptions: { ignoreStandalone: true },
});
const b = glimmer.builders;
/**
* Transform the attributes names & values properly
*/
const transformAttrs = attrs => {
return attrs.map(a => {
let _key = a.key;
let _valueType = a.value.type;
let _value;
if (!isAttribute(a.key)) {
_key = `@${_key}`;
}
if (_valueType === 'PathExpression') {
_value = b.mustache(b.path(a.value.original));
} else if (_valueType === 'SubExpression') {