ember-codemod-add-component-signatures
Version:
Codemod to add component signatures
12 lines (11 loc) • 423 B
JavaScript
import { join } from 'node:path';
export function getTemplatePath(componentName, extensions, options) {
const { componentStructure, src } = options;
const filePath = componentStructure === 'nested'
? join(src, componentName, 'index')
: join(src, componentName);
if (!extensions.has('.hbs')) {
throw new RangeError('extensions must include `.hbs`');
}
return `${filePath}.hbs`;
}