Spaces:
Paused
Paused
Download node_modules/@peculiar/utils/build/esm/legacy/buffer-source-converter.js from Leon4gr45/augmenttoolkit: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/Leon4gr45/augmenttoolkit/resolve/main/node_modules/%40peculiar/utils/build/esm/legacy/buffer-source-converter.js
- Command line
-
hf download hf://spaces/Leon4gr45/augmenttoolkit/node_modules/@peculiar/utils/build/esm/legacy/buffer-source-converter.js
-
curl -L -o buffer-source-converter.js https://huggingface.co/spaces/Leon4gr45/augmenttoolkit/resolve/main/node_modules/%40peculiar/utils/build/esm/legacy/buffer-source-converter.js
1.01 kB
| import { concat, equal, isArrayBuffer, isArrayBufferView, isBufferSource, toArrayBuffer, toUint8Array, toView, } from "../bytes/index.js"; | |
| export class BufferSourceConverter { | |
| static isArrayBuffer(data) { | |
| return isArrayBuffer(data); | |
| } | |
| static toArrayBuffer(data) { | |
| return toArrayBuffer(data); | |
| } | |
| static toUint8Array(data) { | |
| return toUint8Array(data); | |
| } | |
| static toView(data, type) { | |
| return toView(data, type); | |
| } | |
| static isBufferSource(data) { | |
| return isBufferSource(data); | |
| } | |
| static isArrayBufferView(data) { | |
| return isArrayBufferView(data); | |
| } | |
| static isEqual(a, b) { | |
| return equal(a, b); | |
| } | |
| static concat(first, second, ...rest) { | |
| if (Array.isArray(first)) { | |
| return typeof second === "function" | |
| ? concat(first, second) | |
| : concat(first); | |
| } | |
| const buffers = [first, second, ...rest].filter(Boolean); | |
| return concat(buffers); | |
| } | |
| } | |