⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
invoice
/
node_modules
/
type-fest
/
source
/
Edit File: promisable.d.ts
/** Create a type that represents either the value or the value wrapped in `PromiseLike`. Use-cases: - A function accepts a callback that may either return a value synchronously or may return a promised value. - This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks. Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript. @example ``` import {Promisable} from 'type-fest'; async function logger(getLogEntry: () => Promisable<string>): Promise<void> { const entry = await getLogEntry(); console.log(entry); } logger(() => 'foo'); logger(() => Promise.resolve('bar')); ``` */ export type Promisable<T> = T | PromiseLike<T>;
Simpan