ember-codemod-add-component-signatures
Version:
Codemod to add component signatures
15 lines (14 loc) • 435 B
JavaScript
const defaultTsType = 'unknown';
const mapping = new Map([
['BooleanLiteral', 'boolean'],
['NullLiteral', 'null'],
['NumberLiteral', 'number'],
['PathExpression', 'unknown'],
['StringLiteral', 'string'],
['SubExpression', 'unknown'],
['UndefinedLiteral', 'undefined'],
]);
export function getBlockParameterType(recastType) {
const tsType = mapping.get(recastType);
return tsType ?? defaultTsType;
}