summaryrefslogtreecommitdiff
path: root/school/node_modules/graphql/jsutils/isPromise.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'school/node_modules/graphql/jsutils/isPromise.mjs')
-rw-r--r--school/node_modules/graphql/jsutils/isPromise.mjs8
1 files changed, 8 insertions, 0 deletions
diff --git a/school/node_modules/graphql/jsutils/isPromise.mjs b/school/node_modules/graphql/jsutils/isPromise.mjs
new file mode 100644
index 0000000..2d9079b
--- /dev/null
+++ b/school/node_modules/graphql/jsutils/isPromise.mjs
@@ -0,0 +1,8 @@
+/**
+ * Returns true if the value acts like a Promise, i.e. has a "then" function,
+ * otherwise returns false.
+ */
+// eslint-disable-next-line no-redeclare
+export default function isPromise(value) {
+ return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function';
+}