UNPKG

@nocobase/plugin-file-manager

Version:

Provides files storage services with files collection template and attachment field.

12 lines (11 loc) 293 B
import { Buffer } from "buffer"; export async function* getDataReadable(data) { for await (const chunk of data) { if (Buffer.isBuffer(chunk) || chunk instanceof Uint8Array) { yield chunk; } else { yield Buffer.from(chunk); } } }