Fix https://github.com/feross/buffer/issues/173
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
+ if (isArrayBufferView(buf)) {
+ buf = Buffer.from(buf)
+ }
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
t.end()
})
+test('concat() works on Uint8Array instances', function (t) {
+ var result = B.concat([new Uint8Array([1, 2]), new Uint8Array([3, 4])])
+ var expected = Buffer.from([1, 2, 3, 4])
+ t.deepEqual(result, expected)
+ t.end()
+})
+
test('fill', function (t) {
var b = new B(10)
b.fill(2)