mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-05-01 12:38:12 +08:00
7 lines
236 B
TypeScript
7 lines
236 B
TypeScript
import type { Awaitable } from '@pengzhanbo/utils'
|
|
|
|
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
|
|
}
|