refactor: use arrays instead of rest parameters for builders (#7759)

This commit is contained in:
Suneet Tipirneni
2022-04-21 12:56:10 -04:00
committed by GitHub
parent f22245e9d0
commit 29293d7bbb
11 changed files with 66 additions and 69 deletions

View File

@@ -35,7 +35,7 @@ export class SelectMenuBuilder extends UnsafeSelectMenuBuilder {
return super.setDisabled(disabledValidator.parse(disabled));
}
public override addOptions(...options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]) {
public override addOptions(options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]) {
optionsLengthValidator.parse(this.options.length + options.length);
this.options.push(
...options.map((option) =>
@@ -47,7 +47,7 @@ export class SelectMenuBuilder extends UnsafeSelectMenuBuilder {
return this;
}
public override setOptions(...options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]) {
public override setOptions(options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]) {
optionsLengthValidator.parse(options.length);
this.options.splice(
0,