mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 09:49:20 +08:00
refacor: 重构目录架构
This commit is contained in:
@@ -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