Skip to content

Commit

Permalink
refactor: remove unnecessary conditional check
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommytrg committed Feb 2, 2024
1 parent c721db3 commit 880cf9e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/argument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ export class Argument {
this.context = context
this.value = argument
if (
this.argumentInfo?.type === MirArgumentType.Boolean ||
this.argumentInfo?.type === MirArgumentType.Float ||
this.argumentInfo?.type === MirArgumentType.Integer ||
this.argumentInfo?.type === MirArgumentType.String
this.argumentInfo.type === MirArgumentType.Boolean ||
this.argumentInfo.type === MirArgumentType.Float ||
this.argumentInfo.type === MirArgumentType.Integer ||
this.argumentInfo.type === MirArgumentType.String
) {
this.argument = null
} else if (this.argumentInfo?.type === MirArgumentType.FilterFunction) {
} else if (this.argumentInfo.type === MirArgumentType.FilterFunction) {
// Check if it's custom filter to know if contains a subscript or a filter function
if (Array.isArray(argument) && Array.isArray(argument[1])) {
this.argument = new Argument(
Expand All @@ -60,13 +60,13 @@ export class Argument {
(argument as [Filter, boolean | string | number])[1]
)
}
} else if (this.argumentInfo?.type === MirArgumentType.ReducerFunction) {
} else if (this.argumentInfo.type === MirArgumentType.ReducerFunction) {
this.argument = new Argument(
this.context,
{ name: 'by', optional: false, type: MirArgumentType.String },
argument as Reducer
)
} else if (this.argumentInfo?.type === MirArgumentType.Subscript) {
} else if (this.argumentInfo.type === MirArgumentType.Subscript) {
this.argument = new Script(
this.context,
argument as MirScript,
Expand Down

0 comments on commit 880cf9e

Please sign in to comment.