isPromiseLike and resolve partial of Grid.
This commit is contained in:
1 parent
ec086e29aa
commit
a78ef2df39
7 files changed
+1359
-619
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user