Skip to content

Commit 70158af

Browse files
committed
remove default format in fromTypedArray
1 parent f5901c6 commit 70158af

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { assertTypedArray } from './assert.js'
22

33
const { Buffer } = globalThis // Buffer is optional
44

5-
export function fromTypedArray(arr, format = 'uint8') {
5+
export function fromTypedArray(arr, format) {
66
assertTypedArray(arr)
77
switch (format) {
88
case 'uint8':

tests/array.test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ describe('fromTypedArray', () => {
2424

2525
test('uint8', (t) => {
2626
for (const { buffer, uint8 } of pool) {
27-
t.assert.strictEqual(fromTypedArray(uint8), uint8)
2827
t.assert.strictEqual(fromTypedArray(uint8, 'uint8'), uint8)
29-
const a = fromTypedArray(buffer)
30-
const b = fromTypedArray(buffer, 'uint8')
28+
const a = fromTypedArray(buffer, 'uint8')
3129
t.assert.deepStrictEqual(a, uint8)
3230
t.assert.strictEqual(a.buffer, buffer.buffer)
33-
t.assert.deepStrictEqual(b, uint8)
34-
t.assert.strictEqual(b.buffer, buffer.buffer)
3531
}
3632
})
3733

0 commit comments

Comments
 (0)