Blame view

泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/internal/lint-configs/eslint-config/src/util.ts 235 Bytes
383e20a3   杨鑫   拉取
1
2
3
4
5
6
7
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;
  }