aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils/common/promises.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/core-utils/common/promises.ts')
-rw-r--r--shared/core-utils/common/promises.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/shared/core-utils/common/promises.ts b/shared/core-utils/common/promises.ts
new file mode 100644
index 000000000..7ef9d60b6
--- /dev/null
+++ b/shared/core-utils/common/promises.ts
@@ -0,0 +1,12 @@
1function isPromise (value: any) {
2 return value && typeof value.then === 'function'
3}
4
5function isCatchable (value: any) {
6 return value && typeof value.catch === 'function'
7}
8
9export {
10 isPromise,
11 isCatchable
12}