Skip to content

Commit

Permalink
fix: Fix incorrect type check in byteArrayFormat function
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsimka authored Dec 22, 2024
1 parent cd4fb77 commit d4b6773
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/InputFormat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function byteArrayFormat(x: string): string | undefined {
const o = JSON.parse(x);
if (o instanceof Array) {
for (let i = 0; i < o.length; i++) {
if (!(o[i] instanceof Number && o[i] >= 0 && o[i] <= 255)) {
if (typeof o[i] !== "number" || o[i] < 0 || o[i] > 255) {
return "Each entry must be a byte value in [0, 255]";
}
}
Expand Down

0 comments on commit d4b6773

Please sign in to comment.