Skip to content

Commit

Permalink
fix(NumberInterface): validation not working if min or max set to 0 (n…
Browse files Browse the repository at this point in the history
  • Loading branch information
newcat authored and starker-xp committed Jan 30, 2024
1 parent 4e11571 commit 5c4bb44
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class BaseNumericInterface extends NodeInterface<number> implements IVali
}

public validate(v: number) {
return (!this.min || v >= this.min) && (!this.max || v <= this.max);
return (this.min === undefined || v >= this.min) && (this.max === undefined || v <= this.max);
}
}

Expand Down

0 comments on commit 5c4bb44

Please sign in to comment.