isPromiseLike and resolve partial of Grid.

This commit is contained in:
lchen committed 2026-11-25 17:00:03 +08:00
1 parent ec086e29aa
commit a78ef2df39
7 files changed
+1359 -619

No files matched your search

+14
View File
@@ -22,6 +22,19 @@ function isMobile() {
return /mobile/i.test(navigator.userAgent);
}
/**
* @param {unknown} value
* @returns {value is PromiseLike<unknown>}
*/
function isPromiseLike(value) {
return (
value !== null &&
(typeof value === 'object' || typeof value === 'function') &&
'then' in value &&
typeof value.then === 'function'
);
}
/**
* @template {any[]} TArgs
* @template [TContext=typeof globalThis]
@@ -157,6 +170,7 @@ export {
g as global,
isPositive,
isMobile,
isPromiseLike,
// functions
mergeOptions,
throttle,