You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In parse.ts file, the blow code snippet returns a promise.
if(!wasm)// actually returns a promise if init hasn't resolved (not type safe).// casting to avoid a breaking type change.returninit.then(()=>parse(source))asunknownasReturnType<typeofparse>;
This type hack causes issues on the consumption side. We call the parse function without awaiting as it's indicated by type system. However, we figured that parse may return Promise in the run time.
The text was updated successfully, but these errors were encountered:
The function is supposed to be synchronous if you've awaited init, but if you haven't awaited init it should be async.
I think this was changed in the TypeScript migration. I personally like having the sync version, so would suggest we change the code to match the types like:
In parse.ts file, the blow code snippet returns a promise.
This type hack causes issues on the consumption side. We call the parse function without awaiting as it's indicated by type system. However, we figured that parse may return Promise in the run time.
The text was updated successfully, but these errors were encountered: