diff --git a/src/stream.ts b/src/stream.ts index 4b36434..177cfce 100644 --- a/src/stream.ts +++ b/src/stream.ts @@ -21,13 +21,13 @@ export async function stream(initOrFn: StreamParamFn | string | any, fn?: Stream } const append = async (output: string | any) => { - const [status, data] = processExecOutput(output) + const { status, output: data } = processExecOutput(output) if (status === "error") error = true send({ type: "stream:append", data }) } const replace = async (output: string | any) => { - const [status, data] = processExecOutput(output) + const { status, output: data } = processExecOutput(output) if (status === "error") error = true send({ type: "stream:replace", data }) } @@ -38,7 +38,7 @@ export async function stream(initOrFn: StreamParamFn | string | any, fn?: Stream if (typeof initOrFn === "function") { func = initOrFn } else { - init = processExecOutput(initOrFn)[1] + init = processExecOutput(initOrFn).output func = fn }