fix: Upgrade unbuild to resolve console warning issues and also deal with post-upgrade compatibility issues (#4009)
This commit is contained in:
8
internal/lint-configs/eslint-config/src/util.ts
Normal file
8
internal/lint-configs/eslint-config/src/util.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export type Awaitable<T> = Promise<T> | T;
|
||||
|
||||
export async function interopDefault<T>(
|
||||
m: Awaitable<T>,
|
||||
): Promise<T extends { default: infer U } ? U : T> {
|
||||
const resolved = await m;
|
||||
return (resolved as any).default || resolved;
|
||||
}
|
Reference in New Issue
Block a user