]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/core-utils/common/promises.ts
Refactor video links builders
[github/Chocobozzz/PeerTube.git] / shared / core-utils / common / promises.ts
diff --git a/shared/core-utils/common/promises.ts b/shared/core-utils/common/promises.ts
new file mode 100644 (file)
index 0000000..7ef9d60
--- /dev/null
@@ -0,0 +1,12 @@
+function isPromise (value: any) {
+  return value && typeof value.then === 'function'
+}
+
+function isCatchable (value: any) {
+  return value && typeof value.catch === 'function'
+}
+
+export {
+  isPromise,
+  isCatchable
+}