summaryrefslogtreecommitdiff
path: root/alarm/node_modules/axios/lib/platform/browser
diff options
context:
space:
mode:
Diffstat (limited to 'alarm/node_modules/axios/lib/platform/browser')
-rw-r--r--alarm/node_modules/axios/lib/platform/browser/classes/FormData.js3
-rw-r--r--alarm/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js4
-rw-r--r--alarm/node_modules/axios/lib/platform/browser/index.js43
3 files changed, 50 insertions, 0 deletions
diff --git a/alarm/node_modules/axios/lib/platform/browser/classes/FormData.js b/alarm/node_modules/axios/lib/platform/browser/classes/FormData.js
new file mode 100644
index 0000000..4369056
--- /dev/null
+++ b/alarm/node_modules/axios/lib/platform/browser/classes/FormData.js
@@ -0,0 +1,3 @@
+'use strict';
+
+export default FormData;
diff --git a/alarm/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js b/alarm/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
new file mode 100644
index 0000000..b7dae95
--- /dev/null
+++ b/alarm/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
@@ -0,0 +1,4 @@
+'use strict';
+
+import AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';
+export default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
diff --git a/alarm/node_modules/axios/lib/platform/browser/index.js b/alarm/node_modules/axios/lib/platform/browser/index.js
new file mode 100644
index 0000000..80284eb
--- /dev/null
+++ b/alarm/node_modules/axios/lib/platform/browser/index.js
@@ -0,0 +1,43 @@
+import URLSearchParams from './classes/URLSearchParams.js'
+import FormData from './classes/FormData.js'
+
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ *
+ * @returns {boolean}
+ */
+const isStandardBrowserEnv = (() => {
+ let product;
+ if (typeof navigator !== 'undefined' && (
+ (product = navigator.product) === 'ReactNative' ||
+ product === 'NativeScript' ||
+ product === 'NS')
+ ) {
+ return false;
+ }
+
+ return typeof window !== 'undefined' && typeof document !== 'undefined';
+})();
+
+export default {
+ isBrowser: true,
+ classes: {
+ URLSearchParams,
+ FormData,
+ Blob
+ },
+ isStandardBrowserEnv,
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
+};