We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcdd645 commit edc569eCopy full SHA for edc569e
packages/svelte/src/internal/common.js
@@ -10,11 +10,7 @@ export const EMPTY_FUNC = () => {};
10
* @returns {value is PromiseLike<T>}
11
*/
12
export function is_promise(value) {
13
- return (
14
- !!value &&
15
- (typeof value === 'object' || typeof value === 'function') &&
16
- typeof (/** @type {any} */ (value).then) === 'function'
17
- );
+ return typeof value?.then === 'function';
18
}
19
20
/** @param {Array<() => void>} arr */
0 commit comments