@symbo.ls/fetch 2.25.3 → 2.27.8
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 +5 -7
- package/dist/esm/index.js +2 -4
- package/package.json +6 -6
package/dist/cjs/index.js
CHANGED
|
@@ -26,14 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var index_exports = {};
|
|
30
|
+
__export(index_exports, {
|
|
31
31
|
fetch: () => fetch,
|
|
32
32
|
fetchProject: () => fetchProject,
|
|
33
33
|
fetchProjectAsync: () => fetchProjectAsync,
|
|
34
34
|
fetchRemote: () => fetchRemote
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
37
|
var utils = __toESM(require("@domql/utils"), 1);
|
|
38
38
|
const { window, overwriteDeep, deepDestringify } = utils;
|
|
39
39
|
const IS_DEVELOPMENT = window && window.location ? window.location.host.includes("dev.") : true;
|
|
@@ -53,10 +53,8 @@ const fetchRemote = async (key, options = defaultOptions) => {
|
|
|
53
53
|
});
|
|
54
54
|
return await response.json();
|
|
55
55
|
} catch (e) {
|
|
56
|
-
if (utils.isFunction(options.onError))
|
|
57
|
-
|
|
58
|
-
else
|
|
59
|
-
console.error(e);
|
|
56
|
+
if (utils.isFunction(options.onError)) return options.onError(e);
|
|
57
|
+
else console.error(e);
|
|
60
58
|
}
|
|
61
59
|
};
|
|
62
60
|
const fetchProject = async (key, options) => {
|
package/dist/esm/index.js
CHANGED
|
@@ -17,10 +17,8 @@ const fetchRemote = async (key, options = defaultOptions) => {
|
|
|
17
17
|
});
|
|
18
18
|
return await response.json();
|
|
19
19
|
} catch (e) {
|
|
20
|
-
if (utils.isFunction(options.onError))
|
|
21
|
-
|
|
22
|
-
else
|
|
23
|
-
console.error(e);
|
|
20
|
+
if (utils.isFunction(options.onError)) return options.onError(e);
|
|
21
|
+
else console.error(e);
|
|
24
22
|
}
|
|
25
23
|
};
|
|
26
24
|
const fetchProject = async (key, options) => {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/fetch",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.8",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"gitHead": "
|
|
5
|
+
"gitHead": "e783fd54228d5c7aaab9d4b5624199a17a6c4713",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"module": "index.js",
|
|
8
8
|
"main": "index.js",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"copy:package:cjs": "cp ../../build/package-cjs.json dist/cjs/package.json",
|
|
25
|
-
"build:esm": "npx esbuild *.js --target=es2017 --format=esm --outdir=dist/esm",
|
|
26
|
-
"build:cjs": "npx esbuild *.js --target=node16 --format=cjs --outdir=dist/cjs",
|
|
27
|
-
"build:iife": "npx esbuild *.js --target=node16 --format=iife --outdir=dist/iife",
|
|
25
|
+
"build:esm": "cross-env NODE_ENV=$NODE_ENV npx esbuild *.js --target=es2017 --format=esm --outdir=dist/esm",
|
|
26
|
+
"build:cjs": "cross-env NODE_ENV=$NODE_ENV npx esbuild *.js --target=node16 --format=cjs --outdir=dist/cjs",
|
|
27
|
+
"build:iife": "cross-env NODE_ENV=$NODE_ENV npx esbuild *.js --target=node16 --format=iife --outdir=dist/iife",
|
|
28
28
|
"build": "rimraf -I dist; npm run build:cjs; npm run build:esm",
|
|
29
29
|
"prepublish": "npm run build; npm run copy:package:cjs"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@domql/utils": "^2.
|
|
32
|
+
"@domql/utils": "^2.27.8"
|
|
33
33
|
}
|
|
34
34
|
}
|