Skip to content

Commit

Permalink
change name.
Browse files Browse the repository at this point in the history
  • Loading branch information
dojyorin committed Jan 26, 2024
1 parent 2e839c2 commit 7780ca8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pure/byte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ export async function blobConvert<T extends keyof BlobType>(blob:Blob, type:T):P
* const byte = byteConcat(new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]));
* ```
*/
export function byteConcat(...parts:BufferSource[]):Uint8Array{
const output = new Uint8Array(parts.reduce((n, {byteLength}) => n + byteLength , 0));
export function byteConcat(...sources:BufferSource[]):Uint8Array{
const output = new Uint8Array(sources.reduce((n, {byteLength}) => n + byteLength , 0));

let i = 0;
for(const part of parts){
output.set(new Uint8Array("buffer" in part ? part.buffer : part), i);
i += part.byteLength;
for(const source of sources){
output.set(new Uint8Array("buffer" in source ? source.buffer : source), i);
i += source.byteLength;
}

return output;
Expand Down

0 comments on commit 7780ca8

Please sign in to comment.