Download next.js/packages/next/src/shared/lib/is-thenable.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 370 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/shared/lib/is-thenable.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/shared/lib/is-thenable.ts
-
curl -L -o is-thenable.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/shared/lib/is-thenable.ts
370 Bytes
| /** | |
| * Check to see if a value is Thenable. | |
| * | |
| * @param promise the maybe-thenable value | |
| * @returns true if the value is thenable | |
| */ | |
| export function isThenable<T = unknown>( | |
| promise: Promise<T> | T | |
| ): promise is Promise<T> { | |
| return ( | |
| promise !== null && | |
| typeof promise === 'object' && | |
| 'then' in promise && | |
| typeof promise.then === 'function' | |
| ) | |
| } | |