Skip to content

Commit

Permalink
fix(ts): fix lost question issues
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 15, 2022
1 parent e064477 commit 8718727
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chapi-ast-typescript/src/main/antlr/TypeScriptParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ typeMember
| indexSignature
| methodSignature ('=>' type_)?
| enumSignature
| '[' typeReference In (Keyof | Typeof)* typeReference ']' typeAnnotation
| '[' typeReference In (Keyof | Typeof)* typeReference ']' '?'? typeAnnotation
;

arrayType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,8 @@ export class DemoComponent implements OnInit, ControlValueAccessor {
fun type_definition() {
val code = """export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };"""
TypeScriptAnalyser().analysis(code, "index.tsx")

val code2 = """export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };"""
TypeScriptAnalyser().analysis(code2, "index.tsx")
}
}

0 comments on commit 8718727

Please # to comment.