Skip to content

Commit

Permalink
fix(es/decorator): Fix type detection for template literal types (#6786)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Closes #6682.
  • Loading branch information
kdy1 committed Jan 11, 2023
1 parent eddf8fd commit bbfa97a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
@@ -0,0 +1,8 @@
function decorator(): PropertyDecorator {
return () => null
}

class Example {
@decorator()
value?: `prefix${string}`;
}
@@ -0,0 +1,10 @@
function decorator(): PropertyDecorator {
return ()=>null;
}
class Example {
value?: `prefix${string}`;
}
__decorate([
decorator(),
__metadata("design:type", String)
], Example.prototype, "value", void 0);
Expand Up @@ -511,7 +511,7 @@ fn get_type_ann_of_pat(p: &Pat) -> Option<&TsTypeAnn> {
fn is_str(ty: &TsType) -> bool {
match ty {
TsType::TsLitType(TsLitType {
lit: TsLit::Str(..),
lit: TsLit::Str(..) | TsLit::Tpl(..),
..
})
| TsType::TsKeywordType(TsKeywordType {
Expand Down

0 comments on commit bbfa97a

Please sign in to comment.