diff options
Diffstat (limited to 'cli/doc/ts_type.rs')
-rw-r--r-- | cli/doc/ts_type.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/doc/ts_type.rs b/cli/doc/ts_type.rs index b5f5a8807..ec1a5e7e9 100644 --- a/cli/doc/ts_type.rs +++ b/cli/doc/ts_type.rs @@ -69,6 +69,21 @@ impl Into<TsTypeDef> for &TsLitType { boolean: None, }, ), + TsLit::Tpl(tpl) => { + // A template literal in a type is not allowed to have + // expressions, so there will only be one quasi. + let quasi = tpl.quasis.get(0).expect("Expected tpl to have a quasi."); + let text = quasi.raw.value.to_string(); + ( + text.clone(), + LiteralDef { + kind: LiteralDefKind::String, // semantically the same + number: None, + string: Some(text), + boolean: None, + }, + ) + } TsLit::Bool(bool_) => ( bool_.value.to_string(), LiteralDef { |