@symbo.ls/fetch 2.10.251 → 2.10.259
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -42,13 +42,13 @@ const SERVER_URL = window && window.location && window.location.host.includes("l
|
|
|
42
42
|
const defaultOptions = {
|
|
43
43
|
endpoint: SERVER_URL
|
|
44
44
|
};
|
|
45
|
-
const fetch =
|
|
45
|
+
const fetch = globalThis.fetch;
|
|
46
46
|
const fetchRemote = async (key, options = defaultOptions) => {
|
|
47
47
|
const baseUrl = `https://${options.endpoint || SERVER_URL}/`;
|
|
48
48
|
const route = options.serviceRoute || "";
|
|
49
49
|
let response;
|
|
50
50
|
try {
|
|
51
|
-
response = await
|
|
51
|
+
response = await fetch(baseUrl + route, {
|
|
52
52
|
method: "GET",
|
|
53
53
|
headers: { "Content-Type": "application/json", "X-AppKey": key }
|
|
54
54
|
});
|
package/index.js
CHANGED
|
@@ -16,7 +16,7 @@ const defaultOptions = {
|
|
|
16
16
|
endpoint: SERVER_URL
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export const fetch =
|
|
19
|
+
export const fetch = globalThis.fetch
|
|
20
20
|
|
|
21
21
|
export const fetchRemote = async (key, options = defaultOptions) => {
|
|
22
22
|
const baseUrl = `https://${options.endpoint || SERVER_URL}/`
|
|
@@ -24,7 +24,7 @@ export const fetchRemote = async (key, options = defaultOptions) => {
|
|
|
24
24
|
|
|
25
25
|
let response
|
|
26
26
|
try {
|
|
27
|
-
response = await
|
|
27
|
+
response = await fetch(baseUrl + route, {
|
|
28
28
|
method: 'GET',
|
|
29
29
|
headers: { 'Content-Type': 'application/json', 'X-AppKey': key }
|
|
30
30
|
})
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/fetch",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.259",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"gitHead": "
|
|
5
|
+
"gitHead": "c454826279438617c85a5f8d8e7b3a6938d94dea",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"module": "index.js",
|
|
8
8
|
"main": "index.js",
|