Skip to content

Commit 814ab45

Browse files
authored
fix: Fix incorrect type check in byteArrayFormat function (#546)
1 parent 65ce1ae commit 814ab45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/InputFormat.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function byteArrayFormat(x: string): string | undefined {
2929
const o = JSON.parse(x);
3030
if (o instanceof Array) {
3131
for (let i = 0; i < o.length; i++) {
32-
if (!(o[i] instanceof Number && o[i] >= 0 && o[i] <= 255)) {
32+
if (typeof o[i] !== "number" || o[i] < 0 || o[i] > 255) {
3333
return "Each entry must be a byte value in [0, 255]";
3434
}
3535
}

0 commit comments

Comments
 (0)