2 Create a type that represents either the value or the value wrapped in `PromiseLike`.
5 - A function accepts a callback that may either return a value synchronously or may return a promised value.
6 - This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks.
8 Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript.
12 import {Promisable} from 'type-fest';
14 async function logger(getLogEntry: () => Promisable<string>): Promise<void> {
15 const entry = await getLogEntry();
20 logger(() => Promise.resolve('bar'));
23 export type Promisable<T> = T | PromiseLike<T>;