We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 503c47d commit a5dd15dCopy full SHA for a5dd15d
crates/oxc_transformer/src/typescript/enum.rs
@@ -427,10 +427,9 @@ impl<'a> TypeScriptEnum<'a> {
427
let mut value = StringBuilder::new_in(ctx.ast.allocator);
428
for (quasi, expr) in lit.quasis.iter().zip(&lit.expressions) {
429
value.push_str(&quasi.value.cooked.unwrap_or(quasi.value.raw));
430
- if let ConstantValue::String(str) =
431
- self.evaluate(expr, prev_members, ctx)?
432
- {
433
- value.push_str(&str);
+ match self.evaluate(expr, prev_members, ctx)? {
+ ConstantValue::String(str) => value.push_str(&str),
+ ConstantValue::Number(num) => value.push_str(&num.to_js_string()),
434
}
435
436
Atom::from(value.into_str())
0 commit comments