summaryrefslogtreecommitdiff
path: root/lib/helpers/isAxiosError.js
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-08-20 13:31:06 +0200
committerFlorian Dold <florian@dold.me>2021-08-20 13:31:06 +0200
commit3fb2c7a5cd0adb550308fe7db9db69453afd0515 (patch)
treeb83ceffb2f45f86585f3899d0407bc1633256002 /lib/helpers/isAxiosError.js
downloadnode-vendor-3fb2c7a5cd0adb550308fe7db9db69453afd0515.tar.gz
node-vendor-3fb2c7a5cd0adb550308fe7db9db69453afd0515.tar.bz2
node-vendor-3fb2c7a5cd0adb550308fe7db9db69453afd0515.zip
Squashed 'axios/' content from commit a64050a
git-subtree-dir: axios git-subtree-split: a64050a6cfbcc708a55a7dc8030d85b1c78cdf38
Diffstat (limited to 'lib/helpers/isAxiosError.js')
-rw-r--r--lib/helpers/isAxiosError.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/helpers/isAxiosError.js b/lib/helpers/isAxiosError.js
new file mode 100644
index 0000000..29ff41a
--- /dev/null
+++ b/lib/helpers/isAxiosError.js
@@ -0,0 +1,11 @@
+'use strict';
+
+/**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+module.exports = function isAxiosError(payload) {
+ return (typeof payload === 'object') && (payload.isAxiosError === true);
+};