@hi-ui/type-assertion
Advanced tools
Comparing version 4.0.0-alpha.11 to 4.0.0-alpha.12
@@ -25,2 +25,10 @@ /** @LICENSE | ||
/** | ||
* Assert is Undefined | ||
*/ | ||
var isUndef = function isUndef(arg) { | ||
return arg === undefined; | ||
}; | ||
/** | ||
* Assert is Nullish | ||
@@ -64,3 +72,3 @@ */ | ||
var isPromise = function isPromise(arg) { | ||
return (isObjectLike(arg) || typeof arg === 'function') && typeof arg.then === 'function'; | ||
return isObjectLike(arg) && isFunction(arg.then); | ||
}; | ||
@@ -113,5 +121,7 @@ /** | ||
exports.isObject = isObject; | ||
exports.isObjectLike = isObjectLike; | ||
exports.isPromise = isPromise; | ||
exports.isString = isString; | ||
exports.isUndef = isUndef; | ||
exports.isUndefined = isUndefined; | ||
//# sourceMappingURL=index.js.map |
@@ -20,2 +20,10 @@ import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
/** | ||
* Assert is Undefined | ||
*/ | ||
var isUndef = function isUndef(arg) { | ||
return arg === undefined; | ||
}; | ||
/** | ||
* Assert is Nullish | ||
@@ -59,3 +67,3 @@ */ | ||
var isPromise = function isPromise(arg) { | ||
return (isObjectLike(arg) || typeof arg === 'function') && typeof arg.then === 'function'; | ||
return isObjectLike(arg) && isFunction(arg.then); | ||
}; | ||
@@ -101,3 +109,3 @@ /** | ||
export { isArray, isArrayNonEmpty, isElement, isFunction, isNullish, isNumeric, isObject, isPromise, isString, isUndefined }; | ||
export { isArray, isArrayNonEmpty, isElement, isFunction, isNullish, isNumeric, isObject, isObjectLike, isPromise, isString, isUndef, isUndefined }; | ||
//# sourceMappingURL=index.js.map |
@@ -9,2 +9,6 @@ export declare type Dict<T = any> = Record<string, T>; | ||
/** | ||
* Assert is Undefined | ||
*/ | ||
export declare const isUndef: (arg: unknown) => arg is void | undefined; | ||
/** | ||
* Assert is Nullish | ||
@@ -14,2 +18,7 @@ */ | ||
/** | ||
* Assert is an objectLike | ||
* TODO: Assert the return type | ||
*/ | ||
export declare const isObjectLike: (arg: unknown) => arg is any; | ||
/** | ||
* Assert is an object | ||
@@ -16,0 +25,0 @@ */ |
{ | ||
"name": "@hi-ui/type-assertion", | ||
"version": "4.0.0-alpha.11", | ||
"version": "4.0.0-alpha.12", | ||
"description": "A sub-package for @hi-ui/utils.", | ||
@@ -48,3 +48,3 @@ "keywords": [], | ||
}, | ||
"gitHead": "734a594a67ed76aa6e36772532e67b53048f2dae" | ||
"gitHead": "37cbc875cd26474cfc9ddbd1eeb0abd797a31835" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11609
235