diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2020-05-17 12:56:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-17 18:56:22 +0200 |
commit | a054250a2cd709f74a3c9984af0cb74b7adde3bd (patch) | |
tree | 881ac3330f587a2532535db23942665fe917c841 /cli/doc/ts_type.rs | |
parent | e16eb9e10841d3b63bfe50db9849ae9a2d7c20f3 (diff) |
Update to dprint 0.18.3 and the latest version of swc (#5509)
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 { |