webrtc: fix typing and variable scope

This commit is contained in:
Koushik Dutta
2025-09-02 12:03:42 -07:00
parent 40a1221f11
commit ea6d404f12
5 changed files with 24 additions and 17 deletions

View File

@@ -52,7 +52,12 @@ export function createZygote<T>(options?: ForkOptions): Zygote<T> {
}
const gen = next();
return () => gen.next().value as PluginFork<T>;
return () => {
const ret = gen.next();
if (ret.done || !ret.value)
throw new Error('Zygote exhausted');
return ret.value;
};
}