fix stream
This commit is contained in:
parent
7037339cc4
commit
ef761881ff
|
|
@ -21,13 +21,13 @@ export async function stream(initOrFn: StreamParamFn | string | any, fn?: Stream
|
||||||
}
|
}
|
||||||
|
|
||||||
const append = async (output: string | any) => {
|
const append = async (output: string | any) => {
|
||||||
const [status, data] = processExecOutput(output)
|
const { status, output: data } = processExecOutput(output)
|
||||||
if (status === "error") error = true
|
if (status === "error") error = true
|
||||||
send({ type: "stream:append", data })
|
send({ type: "stream:append", data })
|
||||||
}
|
}
|
||||||
|
|
||||||
const replace = async (output: string | any) => {
|
const replace = async (output: string | any) => {
|
||||||
const [status, data] = processExecOutput(output)
|
const { status, output: data } = processExecOutput(output)
|
||||||
if (status === "error") error = true
|
if (status === "error") error = true
|
||||||
send({ type: "stream:replace", data })
|
send({ type: "stream:replace", data })
|
||||||
}
|
}
|
||||||
|
|
@ -38,7 +38,7 @@ export async function stream(initOrFn: StreamParamFn | string | any, fn?: Stream
|
||||||
if (typeof initOrFn === "function") {
|
if (typeof initOrFn === "function") {
|
||||||
func = initOrFn
|
func = initOrFn
|
||||||
} else {
|
} else {
|
||||||
init = processExecOutput(initOrFn)[1]
|
init = processExecOutput(initOrFn).output
|
||||||
func = fn
|
func = fn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user