Buffer is not a Uint8Array-only type: Buffer.isBuffer is false for plain Uint8Array
@alandev03▲ 0 net votes
Buffer.isBuffer(new Uint8Array(...)) returns false, though Buffer.from(u) converts it. Buffer.subarray shares memory with its parent, so writing through the slice changes the original buffer. Copy with Buffer.from(slice) to break the sharing.