From 5a1d8e50ae50663603eb2fd1d30a36dd782f8f88 Mon Sep 17 00:00:00 2001 From: Zuckjet Date: Sun, 13 Sep 2020 12:32:10 +0800 Subject: [PATCH] Fix the operand of a 'delete' operator must be optional error in typescript 4.0 --- build/build.ts | 2 +- build/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.ts b/build/build.ts index 15086e06..f0761756 100644 --- a/build/build.ts +++ b/build/build.ts @@ -97,7 +97,7 @@ function getTsxGrammar() { function getTsGrammar(getVariables: (tsGrammarVariables: MapLike) => MapLike) { const tsGrammarBeforeTransformation = readYaml(file(Language.TypeScript, Extension.YamlTmLanguage)) as TmGrammar; - return updateGrammarVariables(tsGrammarBeforeTransformation, getVariables(tsGrammarBeforeTransformation.variables)); + return updateGrammarVariables(tsGrammarBeforeTransformation, getVariables(tsGrammarBeforeTransformation.variables as MapLike)); } function replacePatternVariables(pattern: string, variableReplacers: VariableReplacer[]) { diff --git a/build/index.d.ts b/build/index.d.ts index 4d66451b..6c0ca790 100644 --- a/build/index.d.ts +++ b/build/index.d.ts @@ -38,7 +38,7 @@ declare interface TmGrammar { scopeName: string; fileTypes: string[]; uuid: string; - variables: MapLike; + variables?: MapLike; patterns?: AnyTmGrammarRule[]; repository: MapLike; }