From 46eec3ec971531591e2e4d860920257d42ce934c Mon Sep 17 00:00:00 2001 From: "moxey.eth" Date: Wed, 6 Mar 2024 21:46:40 +1100 Subject: [PATCH] tweak: support edge runtime --- src/utils/getFrameContext.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/getFrameContext.ts b/src/utils/getFrameContext.ts index acd54d23..15c05d81 100644 --- a/src/utils/getFrameContext.ts +++ b/src/utils/getFrameContext.ts @@ -1,4 +1,3 @@ -import { isAsyncFunction } from 'node:util/types' import type { Context, FrameContext } from '../types/context.js' import type { Env } from '../types/env.js' import { getIntentState } from './getIntentState.js' @@ -68,7 +67,7 @@ export function getFrameContext< if (cycle === 'image') return state as _state const clone = structuredClone(previousState) - if (isAsyncFunction(derive)) + if ((derive as any)[Symbol.toStringTag] === 'AsyncFunction') return (derive(clone as _state) as any).then(() => { previousState = clone return previousState