aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils/miscs/miscs.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/core-utils/miscs/miscs.ts')
-rw-r--r--shared/core-utils/miscs/miscs.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/shared/core-utils/miscs/miscs.ts b/shared/core-utils/miscs/miscs.ts
index a3921b568..5de024c08 100644
--- a/shared/core-utils/miscs/miscs.ts
+++ b/shared/core-utils/miscs/miscs.ts
@@ -19,7 +19,17 @@ function compareSemVer (a: string, b: string) {
19 return segmentsA.length - segmentsB.length 19 return segmentsA.length - segmentsB.length
20} 20}
21 21
22function isPromise (value: any) {
23 return value && typeof value.then === 'function'
24}
25
26function isCatchable (value: any) {
27 return value && typeof value.catch === 'function'
28}
29
22export { 30export {
23 randomInt, 31 randomInt,
24 compareSemVer 32 compareSemVer,
33 isPromise,
34 isCatchable
25} 35}