From aaf5f2452fd89e8b57ae9ff752c4b53e84493469 Mon Sep 17 00:00:00 2001 From: Shigma Date: Sat, 27 Jan 2024 01:40:48 +0800 Subject: [PATCH] fix(commands): remove unnecessary write backs --- plugins/commands/src/index.ts | 6 +++--- plugins/commands/tests/index.spec.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/commands/src/index.ts b/plugins/commands/src/index.ts index 74c6843e..516b9bb9 100644 --- a/plugins/commands/src/index.ts +++ b/plugins/commands/src/index.ts @@ -25,8 +25,8 @@ const Override: Schema = Schema.object({ aliases: Schema.union([ Schema.dict(Schema.union([ Schema.object({ - args: Schema.array(null), - options: Schema.dict(null), + args: Schema.array(null).default(null), + options: Schema.dict(null).default(null), filter: Schema.any(), }), Schema.transform(false, () => ({ filter: false })), @@ -35,7 +35,7 @@ const Override: Schema = Schema.object({ return Object.fromEntries(aliases.map((name) => [name, {}])) }), ]), - options: Schema.dict(null), + options: Schema.dict(null).default(null), config: Schema.any(), }) diff --git a/plugins/commands/tests/index.spec.ts b/plugins/commands/tests/index.spec.ts index 0cdf9184..05eac00d 100644 --- a/plugins/commands/tests/index.spec.ts +++ b/plugins/commands/tests/index.spec.ts @@ -75,7 +75,6 @@ describe('@koishijs/plugin-commands', () => { aliases: { baz: {}, }, - options: {}, }, })