@m4l/core 0.0.42 → 0.1.1
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/external/axios.js +52 -11
- package/dist/hooks/useFlags/index.js +3 -1
- package/dist/jest.d.ts +1 -0
- package/dist/vite-env.d.ts +1 -0
- package/package.json +8 -12
- package/README.md +0 -0
package/dist/external/axios.js
CHANGED
|
@@ -410,7 +410,13 @@ var settle$1 = function settle(resolve, reject, response) {
|
|
|
410
410
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
411
411
|
resolve(response);
|
|
412
412
|
} else {
|
|
413
|
-
reject(new AxiosError$4(
|
|
413
|
+
reject(new AxiosError$4(
|
|
414
|
+
"Request failed with status code " + response.status,
|
|
415
|
+
[AxiosError$4.ERR_BAD_REQUEST, AxiosError$4.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
416
|
+
response.config,
|
|
417
|
+
response.request,
|
|
418
|
+
response
|
|
419
|
+
));
|
|
414
420
|
}
|
|
415
421
|
};
|
|
416
422
|
var utils$b = utils$h;
|
|
@@ -648,7 +654,12 @@ var xhr = function xhrAdapter(config) {
|
|
|
648
654
|
if (config.timeoutErrorMessage) {
|
|
649
655
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
650
656
|
}
|
|
651
|
-
reject(new AxiosError$2(
|
|
657
|
+
reject(new AxiosError$2(
|
|
658
|
+
timeoutErrorMessage,
|
|
659
|
+
transitional3.clarifyTimeoutError ? AxiosError$2.ETIMEDOUT : AxiosError$2.ECONNABORTED,
|
|
660
|
+
config,
|
|
661
|
+
request2
|
|
662
|
+
));
|
|
652
663
|
request2 = null;
|
|
653
664
|
};
|
|
654
665
|
if (utils$7.isStandardBrowserEnv()) {
|
|
@@ -838,21 +849,43 @@ function throwIfCancellationRequested(config) {
|
|
|
838
849
|
var dispatchRequest$1 = function dispatchRequest(config) {
|
|
839
850
|
throwIfCancellationRequested(config);
|
|
840
851
|
config.headers = config.headers || {};
|
|
841
|
-
config.data = transformData2.call(
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
852
|
+
config.data = transformData2.call(
|
|
853
|
+
config,
|
|
854
|
+
config.data,
|
|
855
|
+
config.headers,
|
|
856
|
+
config.transformRequest
|
|
857
|
+
);
|
|
858
|
+
config.headers = utils$4.merge(
|
|
859
|
+
config.headers.common || {},
|
|
860
|
+
config.headers[config.method] || {},
|
|
861
|
+
config.headers
|
|
862
|
+
);
|
|
863
|
+
utils$4.forEach(
|
|
864
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
865
|
+
function cleanHeaderConfig(method) {
|
|
866
|
+
delete config.headers[method];
|
|
867
|
+
}
|
|
868
|
+
);
|
|
846
869
|
var adapter = config.adapter || defaults$1.adapter;
|
|
847
870
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
848
871
|
throwIfCancellationRequested(config);
|
|
849
|
-
response.data = transformData2.call(
|
|
872
|
+
response.data = transformData2.call(
|
|
873
|
+
config,
|
|
874
|
+
response.data,
|
|
875
|
+
response.headers,
|
|
876
|
+
config.transformResponse
|
|
877
|
+
);
|
|
850
878
|
return response;
|
|
851
879
|
}, function onAdapterRejection(reason) {
|
|
852
880
|
if (!isCancel2(reason)) {
|
|
853
881
|
throwIfCancellationRequested(config);
|
|
854
882
|
if (reason && reason.response) {
|
|
855
|
-
reason.response.data = transformData2.call(
|
|
883
|
+
reason.response.data = transformData2.call(
|
|
884
|
+
config,
|
|
885
|
+
reason.response.data,
|
|
886
|
+
reason.response.headers,
|
|
887
|
+
config.transformResponse
|
|
888
|
+
);
|
|
856
889
|
}
|
|
857
890
|
}
|
|
858
891
|
return Promise.reject(reason);
|
|
@@ -952,11 +985,19 @@ validators$1.transitional = function transitional2(validator2, version, message)
|
|
|
952
985
|
}
|
|
953
986
|
return function(value, opt, opts) {
|
|
954
987
|
if (validator2 === false) {
|
|
955
|
-
throw new AxiosError(
|
|
988
|
+
throw new AxiosError(
|
|
989
|
+
formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
|
|
990
|
+
AxiosError.ERR_DEPRECATED
|
|
991
|
+
);
|
|
956
992
|
}
|
|
957
993
|
if (version && !deprecatedWarnings[opt]) {
|
|
958
994
|
deprecatedWarnings[opt] = true;
|
|
959
|
-
console.warn(
|
|
995
|
+
console.warn(
|
|
996
|
+
formatMessage(
|
|
997
|
+
opt,
|
|
998
|
+
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
999
|
+
)
|
|
1000
|
+
);
|
|
960
1001
|
}
|
|
961
1002
|
return validator2 ? validator2(value, opt, opts) : true;
|
|
962
1003
|
};
|
|
@@ -7,7 +7,9 @@ const useFlags = () => {
|
|
|
7
7
|
return context;
|
|
8
8
|
};
|
|
9
9
|
function isFlagsPresent(compareFlags, flags) {
|
|
10
|
-
const filterFlags = compareFlags.filter(
|
|
10
|
+
const filterFlags = compareFlags.filter(
|
|
11
|
+
(findFlag) => flags.findIndex((sFlag) => sFlag === findFlag) !== -1
|
|
12
|
+
);
|
|
11
13
|
return filterFlags.length === compareFlags.length;
|
|
12
14
|
}
|
|
13
15
|
const useFlagsPresent = (compareFlags) => {
|
package/dist/jest.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
package/dist/vite-env.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/core",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.0.42",
|
|
3
|
+
"version": "0.1.1",
|
|
5
4
|
"license": "UNLICENSED",
|
|
6
5
|
"author": "M4L Team",
|
|
7
6
|
"scripts": {
|
|
@@ -24,6 +23,7 @@
|
|
|
24
23
|
"react": ">=18"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
26
|
+
"@testing-library/dom": "^8.17.1",
|
|
27
27
|
"@testing-library/jest-dom": "^5.16.4",
|
|
28
28
|
"@testing-library/react": "^13.3.0",
|
|
29
29
|
"@testing-library/user-event": "^14.2.1",
|
|
@@ -53,26 +53,23 @@
|
|
|
53
53
|
"react": "^18.2.0",
|
|
54
54
|
"react-dom": "^18.2.0",
|
|
55
55
|
"react-toastify": "^9.0.5",
|
|
56
|
+
"rollup": "^2.79.0",
|
|
56
57
|
"rollup-plugin-terser": "^7.0.2",
|
|
57
58
|
"snakecase-keys": "^5.4.2",
|
|
58
59
|
"typescript": "^4.6.3",
|
|
59
|
-
"vite": "
|
|
60
|
+
"vite": "2.9.9",
|
|
60
61
|
"vite-plugin-dts": "^1.2.0",
|
|
61
|
-
"vite-plugin-mkcert": "^1.
|
|
62
|
-
"vitest": "^0.
|
|
62
|
+
"vite-plugin-mkcert": "^1.9.0",
|
|
63
|
+
"vitest": "^0.17.1"
|
|
63
64
|
},
|
|
64
65
|
"files": [
|
|
65
66
|
"dist"
|
|
66
67
|
],
|
|
68
|
+
"source": "src/index.ts",
|
|
67
69
|
"main": "./dist/index.js",
|
|
68
70
|
"module": "./dist/index.js",
|
|
69
71
|
"type": "module",
|
|
70
|
-
"types": "./
|
|
71
|
-
"exports": {
|
|
72
|
-
".": {
|
|
73
|
-
"import": "./dist/index.js"
|
|
74
|
-
}
|
|
75
|
-
},
|
|
72
|
+
"types": "./src/index.d.ts",
|
|
76
73
|
"sideEffects": false,
|
|
77
74
|
"publishConfig": {
|
|
78
75
|
"access": "public"
|
|
@@ -80,5 +77,4 @@
|
|
|
80
77
|
"engines": {
|
|
81
78
|
"node": ">=12.0.0"
|
|
82
79
|
}
|
|
83
|
-
|
|
84
80
|
}
|
package/README.md
DELETED
|
File without changes
|