Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Apr 3, 2024
1 parent 7820f2b commit 6d0c52a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/macros/src/babel/macros-babel-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function main(context: typeof Babel): unknown {
let property;
if (specifier.type === 'TemplateLiteral') {
relativePath = specifier.quasis[0].value.cooked!;
property = specifier.expressions[0] as Expression;
property = specifier.expressions[0] as t.Expression;
}
// babel might transform template form `../my-path/${id}` to '../my-path/'.concat(id)
if (
Expand All @@ -140,7 +140,7 @@ export default function main(context: typeof Babel): unknown {
specifier.callee.object.type === 'StringLiteral'
) {
relativePath = specifier.callee.object.value;
property = specifier.arguments[0] as Expression;
property = specifier.arguments[0] as t.Expression;
}
if (property && relativePath && relativePath.startsWith('.')) {
const resolvedPath = resolve(dirname((state as any).filename), relativePath);
Expand Down

0 comments on commit 6d0c52a

Please sign in to comment.