Skip to content

Commit b45247e

Browse files
committed
[Fix] correct error message
1 parent 6686e2a commit b45247e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ module.exports = function toBuffer(data, encoding) {
8282
return Buffer.from(data);
8383
}
8484

85-
throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a TypedArray, or a DataView.');
85+
throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.');
8686
};

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test('other input throws', function (t) {
4040
try {
4141
toBuffer(42);
4242
} catch (err) {
43-
t.deepEqual(err.message, 'The "data" argument must be a string, an Array, a Buffer, a TypedArray, or a DataView.');
43+
t.deepEqual(err.message, 'The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.');
4444
t.end();
4545
}
4646
});

0 commit comments

Comments
 (0)