From d555c64e5ce12d716925786d914510415c19a0db Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 22 Sep 2020 13:00:04 +0900 Subject: Use destructuring-assignment instead of delete operator Operands for delete must be optional on TypeScript 4.0. When using the delete operator in strictNullChecks, the operand must now be any, unknown, never, or be optional (in that it contains undefined in the type). Otherwise, use of the delete operator is an error. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#operands-for-delete-must-be-optional --- src/shared/SettingData.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/shared/SettingData.ts b/src/shared/SettingData.ts index a7bdf80..0d72874 100644 --- a/src/shared/SettingData.ts +++ b/src/shared/SettingData.ts @@ -51,10 +51,9 @@ export class FormKeymaps { const data: { [op: string]: string } = {}; for (const key of Object.keys(json)) { const op = json[key]; - const args = { ...op }; - delete args.type; + const { type, ...args } = op; - let name = op.type; + let name = type; if (Object.keys(args).length > 0) { name += "?" + JSON.stringify(args); } -- cgit v1.2.3