Skip to content

Commit

Permalink
fix: remove option renamed hint
Browse files Browse the repository at this point in the history
TypeScript and other TypeErrors are still helpful
  • Loading branch information
EdJoPaTo committed Feb 6, 2024
1 parent 522cca1 commit 8583bfe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 97 deletions.
20 changes: 0 additions & 20 deletions source/menu-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ export class MenuTemplate<Context> {
action: string,
options: InteractionOptions<Context>,
): void {
if ('doFunc' in options) {
throw new TypeError('doFunc was renamed to do');
}

if (typeof options.do !== 'function') {
throw new TypeError(
'You have to specify `do` in order to have an interaction for this button. If you only want to navigate use `menuTemplate.navigate(…)` instead.',
Expand Down Expand Up @@ -318,10 +314,6 @@ export class MenuTemplate<Context> {
choices: ConstOrContextFunc<Context, Choices>,
options: ChooseOptions<Context>,
): void {
if ('doFunc' in options) {
throw new TypeError('doFunc was renamed to do');
}

if (typeof options.do !== 'function') {
throw new TypeError(
'You have to specify `do` in order to have an interaction for the buttons.',
Expand Down Expand Up @@ -441,12 +433,6 @@ export class MenuTemplate<Context> {
choices: ConstOrContextFunc<Context, Choices>,
options: SelectOptions<Context>,
): void {
if ('setFunc' in options || 'isSetFunc' in options) {
throw new TypeError(
'setFunc and isSetFunc were renamed to set and isSet',
);
}

if (
typeof options.set !== 'function'
|| typeof options.isSet !== 'function'
Expand Down Expand Up @@ -562,12 +548,6 @@ export class MenuTemplate<Context> {
actionPrefix: string,
options: ToggleOptions<Context>,
): void {
if ('setFunc' in options || 'isSetFunc' in options) {
throw new TypeError(
'setFunc and isSetFunc were renamed to set and isSet',
);
}

if (
typeof options.set !== 'function'
|| typeof options.isSet !== 'function'
Expand Down
77 changes: 0 additions & 77 deletions test/menu-template/javascript-renamed.ts

This file was deleted.

0 comments on commit 8583bfe

Please sign in to comment.