Skip to content

Commit 7f0ad72

Browse files
authored
fix: utf-32 error message: "even number of bytes" → "multiple of 4" (#45)
1 parent 92012d2 commit 7f0ad72

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*~
22
node_modules
3+
package-lock.json
34
coverage
45
doc
56
playground

utf32.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ function decode(input, loose = false, format = 'uint32') {
3232
break
3333
case 'uint8-le':
3434
if (!(input instanceof Uint8Array)) throw new TypeError('Expected an Uint8Array')
35-
if (input.byteLength % 4 !== 0) throw new TypeError('Expected even number of bytes')
35+
if (input.byteLength % 4 !== 0) throw new TypeError('Expected length to be a multiple of 4')
3636
u32 = js.to32input(input, true)
3737
break
3838
case 'uint8-be':
3939
if (!(input instanceof Uint8Array)) throw new TypeError('Expected an Uint8Array')
40-
if (input.byteLength % 4 !== 0) throw new TypeError('Expected even number of bytes')
40+
if (input.byteLength % 4 !== 0) throw new TypeError('Expected length to be a multiple of 4')
4141
u32 = js.to32input(input, false)
4242
break
4343
default:

0 commit comments

Comments
 (0)