diff options
Diffstat (limited to 'shared/core-utils/miscs')
-rw-r--r-- | shared/core-utils/miscs/miscs.ts | 12 |
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 | ||
22 | function isPromise (value: any) { | ||
23 | return value && typeof value.then === 'function' | ||
24 | } | ||
25 | |||
26 | function isCatchable (value: any) { | ||
27 | return value && typeof value.catch === 'function' | ||
28 | } | ||
29 | |||
22 | export { | 30 | export { |
23 | randomInt, | 31 | randomInt, |
24 | compareSemVer | 32 | compareSemVer, |
33 | isPromise, | ||
34 | isCatchable | ||
25 | } | 35 | } |