Skip to content

Commit c31fc54

Browse files
authored
fix: add Babel 7 backwards compatibility (#181)
1 parent 045d574 commit c31fc54

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/fake-js.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,9 @@ export function createFakeJsPlugin({
522522
node.typeParameters?.type === 'TSTypeParameterDeclaration'
523523
) {
524524
typeParams.push(
525-
...node.typeParameters.params.map((param) => param.name),
525+
...node.typeParameters.params.map(({ name }) =>
526+
typeof name === 'string' ? t.identifier(name) : name,
527+
),
526528
)
527529
}
528530
},

0 commit comments

Comments
 (0)