Skip to content

Commit

Permalink
fix: optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
xhyrom committed Feb 9, 2022
1 parent b9f1e32 commit 37c83bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/structures/arguments/Boolean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export class BooleanType extends MessageArgumentTypeBase {
value;

validate(content: string): boolean {
const yes = truthy.has(content.toLowerCase());
const no = falsy.has(content.toLowerCase());
const yes = truthy.has(content?.toLowerCase());
const no = falsy.has(content?.toLowerCase());

if (!yes && !no) return false;
else {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/structures/arguments/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class UserType extends MessageArgumentTypeBase {
matches;

validate(content: string): boolean {
const matches = content.match(/([0-9]+)/);
const matches = content?.match(/([0-9]+)/);

if (!matches) return false;

Expand Down

0 comments on commit 37c83bd

Please sign in to comment.