babel-plugin-exercize
babel-plugin-exercize copied to clipboard
exercise-type-checker, 发现bug
exercize-type-checker/src/type-checker-entry3.js
function resolveType(targetType) {
const tsTypeAnnotationMap = {
TSStringKeyword: "string",
TSNumberKeyword: "number",
};
switch (targetType.type) {
case "TSTypeAnnotation":
return tsTypeAnnotationMap[targetType.typeAnnotation.type]; // 失效了, 调试发现targetType对象没有TSTypeAnnotation属性
case "NumberTypeAnnotation":
return "number";
case "StringTypeAnnotation":
return "string";
}
}