@unicom-cloud/utils 0.1.27 → 0.1.28

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.
Files changed (290) hide show
  1. package/case-name/index.js +1 -1
  2. package/caseName.js +1 -1
  3. package/class-name/index.js +1 -1
  4. package/className.js +1 -1
  5. package/clipboard-copy/index.js +1 -1
  6. package/clipboardCopy.js +1 -1
  7. package/constant/address.js +1 -1
  8. package/constant/chineseCharacters.js +1 -1
  9. package/constant/constellations.js +1 -1
  10. package/constant/domain.js +1 -1
  11. package/constant/emoji.js +1 -1
  12. package/constant/identity.js +1 -1
  13. package/constant/index.js +1 -1
  14. package/constant/keyboardCode.js +1 -1
  15. package/constant/licensePlate.js +1 -1
  16. package/constant/name.js +1 -1
  17. package/constant/platform.js +1 -1
  18. package/constant/protocol.js +1 -1
  19. package/constant/ui.js +1 -1
  20. package/constant.js +1 -1
  21. package/content-disposition/index.js +1 -1
  22. package/contentDisposition.js +1 -1
  23. package/cookie/index.js +1 -1
  24. package/cookie/src/index.js +1 -1
  25. package/cookie.js +1 -1
  26. package/date/convertTime.js +1 -1
  27. package/date/convertToDuration.js +1 -1
  28. package/date/index.js +1 -1
  29. package/date.js +1 -1
  30. package/decimal/decimal.js +1 -1
  31. package/decimal/index.js +1 -1
  32. package/decimal.js +1 -1
  33. package/dom-helpers/LICENSE +20 -0
  34. package/dom-helpers/activeElement.js +1 -1
  35. package/dom-helpers/addClass.js +1 -1
  36. package/dom-helpers/addEventListener.js +1 -1
  37. package/dom-helpers/animate.js +1 -1
  38. package/dom-helpers/animationFrame.js +1 -1
  39. package/dom-helpers/attribute.js +1 -1
  40. package/dom-helpers/camelize.js +1 -1
  41. package/dom-helpers/camelizeStyle.js +1 -1
  42. package/dom-helpers/canUseDOM.js +1 -1
  43. package/dom-helpers/childElements.js +1 -1
  44. package/dom-helpers/childNodes.js +1 -1
  45. package/dom-helpers/clear.js +1 -1
  46. package/dom-helpers/closest.js +1 -1
  47. package/dom-helpers/collectElements.js +1 -1
  48. package/dom-helpers/collectSiblings.js +1 -1
  49. package/dom-helpers/contains.js +1 -1
  50. package/dom-helpers/css.js +1 -1
  51. package/dom-helpers/filterEventHandler.js +1 -1
  52. package/dom-helpers/getComputedStyle.js +1 -1
  53. package/dom-helpers/getScrollAccessor.js +1 -1
  54. package/dom-helpers/hasClass.js +1 -1
  55. package/dom-helpers/height.js +1 -1
  56. package/dom-helpers/hyphenate.js +1 -1
  57. package/dom-helpers/hyphenateStyle.js +1 -1
  58. package/dom-helpers/index.js +1 -1
  59. package/dom-helpers/insertAfter.js +1 -1
  60. package/dom-helpers/isDocument.js +1 -1
  61. package/dom-helpers/isInput.js +1 -1
  62. package/dom-helpers/isTransform.js +1 -1
  63. package/dom-helpers/isVisible.js +1 -1
  64. package/dom-helpers/isWindow.js +1 -1
  65. package/dom-helpers/listen.js +1 -1
  66. package/dom-helpers/matches.js +1 -1
  67. package/dom-helpers/nextUntil.js +1 -1
  68. package/dom-helpers/offset.js +1 -1
  69. package/dom-helpers/offsetParent.js +1 -1
  70. package/dom-helpers/ownerDocument.js +1 -1
  71. package/dom-helpers/ownerWindow.js +1 -1
  72. package/dom-helpers/parents.js +1 -1
  73. package/dom-helpers/position.js +1 -1
  74. package/dom-helpers/prepend.js +1 -1
  75. package/dom-helpers/querySelectorAll.js +1 -1
  76. package/dom-helpers/reflow.js +1 -1
  77. package/dom-helpers/remove.js +1 -1
  78. package/dom-helpers/removeClass.js +1 -1
  79. package/dom-helpers/removeEventListener.js +1 -1
  80. package/dom-helpers/scrollLeft.js +1 -1
  81. package/dom-helpers/scrollParent.js +1 -1
  82. package/dom-helpers/scrollTo.js +1 -1
  83. package/dom-helpers/scrollTop.js +1 -1
  84. package/dom-helpers/scrollbarSize.js +1 -1
  85. package/dom-helpers/siblings.js +1 -1
  86. package/dom-helpers/text.js +1 -1
  87. package/dom-helpers/toggleClass.js +1 -1
  88. package/dom-helpers/transitionEnd.js +1 -1
  89. package/dom-helpers/triggerEvent.js +1 -1
  90. package/dom-helpers/types.js +1 -1
  91. package/dom-helpers/width.js +1 -1
  92. package/domHelpers.js +1 -1
  93. package/emitter/index.js +1 -1
  94. package/emitter/src/index.js +1 -1
  95. package/emitter.js +1 -1
  96. package/file/fileToURL.js +1 -1
  97. package/file/index.js +1 -1
  98. package/file/saveAs.js +1 -1
  99. package/file.js +1 -1
  100. package/filesize/LICENSE +26 -0
  101. package/idb/index.js +1 -1
  102. package/idb.js +1 -1
  103. package/index.js +1 -1
  104. package/invariant/index.js +1 -1
  105. package/invariant.js +1 -1
  106. package/is/index.js +1 -1
  107. package/is.js +1 -1
  108. package/js-cookie/index.js +1 -1
  109. package/js-cookie/src/api.js +1 -1
  110. package/js-cookie/src/assign.js +1 -1
  111. package/js-cookie/src/converter.js +1 -1
  112. package/jsCookie.js +1 -1
  113. package/lodash/LICENSE +47 -0
  114. package/lunar/LICENSE +20 -0
  115. package/lunar/index.js +1 -1
  116. package/lunar/lib/Holiday.js +1 -1
  117. package/lunar/lib/HolidayUtil.js +1 -1
  118. package/lunar/lib/I18n.js +1 -1
  119. package/lunar/lib/JieQi.js +1 -1
  120. package/lunar/lib/Lunar.js +1 -1
  121. package/lunar/lib/LunarMonth.js +1 -1
  122. package/lunar/lib/LunarTime.js +1 -1
  123. package/lunar/lib/LunarUtil.js +1 -1
  124. package/lunar/lib/LunarYear.js +1 -1
  125. package/lunar/lib/ShouXingUtil.js +1 -1
  126. package/lunar/lib/Solar.js +1 -1
  127. package/lunar/lib/SolarHalfYear.js +1 -1
  128. package/lunar/lib/SolarMonth.js +1 -1
  129. package/lunar/lib/SolarSeason.js +1 -1
  130. package/lunar/lib/SolarUtil.js +1 -1
  131. package/lunar/lib/SolarWeek.js +1 -1
  132. package/lunar/lib/SolarYear.js +1 -1
  133. package/lunar/lib/index.js +1 -1
  134. package/lunar.js +1 -1
  135. package/math/index.js +1 -1
  136. package/math.js +1 -1
  137. package/md5/index.js +1 -1
  138. package/md5.js +1 -1
  139. package/mock/MockWebSocket.js +1 -1
  140. package/mock/MockXMLHttpRequest.js +1 -1
  141. package/mock/index.js +1 -1
  142. package/mock.js +1 -1
  143. package/normalize-wheel/ExecutionEnvironment.js +1 -1
  144. package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
  145. package/normalize-wheel/index.js +1 -1
  146. package/normalize-wheel/isEventSupported.js +1 -1
  147. package/normalizeWheel.js +1 -1
  148. package/number-to-chinese/index.js +1 -1
  149. package/numberToChinese.js +1 -1
  150. package/nzh/cn.js +1 -1
  151. package/nzh/hk.js +1 -1
  152. package/nzh/index.js +1 -1
  153. package/nzh/nzh.js +1 -1
  154. package/nzh/src/autoGet.js +1 -1
  155. package/nzh/src/index.js +1 -1
  156. package/nzh/src/langs/cn_b.js +1 -1
  157. package/nzh/src/langs/cn_s.js +1 -1
  158. package/nzh/src/langs/hk_b.js +1 -1
  159. package/nzh/src/langs/hk_s.js +1 -1
  160. package/nzh/src/utils.js +1 -1
  161. package/nzh.js +1 -1
  162. package/object-keys-sort/index.js +1 -1
  163. package/object-prototype-to-string-call/index.js +1 -1
  164. package/objectKeysSort.js +1 -1
  165. package/objectPrototypeToStringCall.js +1 -1
  166. package/package.json +1 -1
  167. package/pinyin/LICENSE +20 -0
  168. package/pinyin/index.d.ts +6 -0
  169. package/pinyin/index.js +1 -1
  170. package/pinyin/simplified.js +1 -1
  171. package/pinyin/src/core.js +62 -62
  172. package/pinyin/src/simplified.js +1 -1
  173. package/pinyin/src/simplified_dict.js +2 -2
  174. package/pinyin/src/traditional.js +1 -1
  175. package/pinyin/src/traditional_dict.js +1 -1
  176. package/pinyin/traditional.js +1 -1
  177. package/pinyin.js +1 -1
  178. package/query-string/LICENSE +20 -0
  179. package/query-string/base.js +1 -1
  180. package/query-string/index.js +1 -1
  181. package/query-string/splitOnFirst.js +1 -1
  182. package/queryString.js +1 -1
  183. package/random/address.js +1 -1
  184. package/random/constellation.js +1 -1
  185. package/random/image.js +1 -1
  186. package/random/index.js +1 -1
  187. package/random/licensePlate.js +1 -1
  188. package/random/name.js +1 -1
  189. package/random/number.js +1 -1
  190. package/random/text.js +1 -1
  191. package/random/time.js +1 -1
  192. package/random/web.js +1 -1
  193. package/random.js +1 -1
  194. package/screenfull/index.js +1 -1
  195. package/screenfull.js +1 -1
  196. package/sleep/index.js +1 -1
  197. package/sleep.js +1 -1
  198. package/snapdom/LICENSE +20 -0
  199. package/snapdom/index.js +1 -1
  200. package/snapdom/src/api/preCache.js +1 -1
  201. package/snapdom/src/api/snapdom.js +1 -1
  202. package/snapdom/src/core/cache.js +1 -1
  203. package/snapdom/src/core/capture.js +1 -1
  204. package/snapdom/src/core/clone.js +1 -1
  205. package/snapdom/src/core/context.js +1 -1
  206. package/snapdom/src/core/plugins.js +1 -1
  207. package/snapdom/src/core/prepare.js +1 -1
  208. package/snapdom/src/exporters/download.js +1 -1
  209. package/snapdom/src/exporters/toBlob.js +1 -1
  210. package/snapdom/src/exporters/toCanvas.js +1 -1
  211. package/snapdom/src/exporters/toImg.js +1 -1
  212. package/snapdom/src/modules/CSSVar.js +1 -1
  213. package/snapdom/src/modules/background.js +1 -1
  214. package/snapdom/src/modules/changeCSS.js +1 -1
  215. package/snapdom/src/modules/counter.js +1 -1
  216. package/snapdom/src/modules/fonts.js +1 -1
  217. package/snapdom/src/modules/iconFonts.js +1 -1
  218. package/snapdom/src/modules/images.js +1 -1
  219. package/snapdom/src/modules/lineClamp.js +1 -1
  220. package/snapdom/src/modules/pseudo.js +1 -1
  221. package/snapdom/src/modules/rasterize.js +1 -1
  222. package/snapdom/src/modules/snapFetch.js +1 -1
  223. package/snapdom/src/modules/styles.js +1 -1
  224. package/snapdom/src/modules/svgDefs.js +1 -1
  225. package/snapdom/src/utils/browser.js +1 -1
  226. package/snapdom/src/utils/css.js +1 -1
  227. package/snapdom/src/utils/helpers.js +1 -1
  228. package/snapdom/src/utils/image.js +1 -1
  229. package/snapdom.js +1 -1
  230. package/string/index.js +7 -0
  231. package/string.js +5 -0
  232. package/tinycolor/index.js +1 -1
  233. package/tinycolor/src/conversion.js +1 -1
  234. package/tinycolor/src/css-color-names.js +1 -1
  235. package/tinycolor/src/format-input.js +1 -1
  236. package/tinycolor/src/from-ratio.js +1 -1
  237. package/tinycolor/src/index.js +1 -1
  238. package/tinycolor/src/random.js +1 -1
  239. package/tinycolor/src/readability.js +1 -1
  240. package/tinycolor/src/to-ms-filter.js +1 -1
  241. package/tinycolor/src/utils.js +1 -1
  242. package/tinycolor.js +1 -1
  243. package/tree/index.js +1 -1
  244. package/tree/search/index.js +1 -1
  245. package/tree.js +1 -1
  246. package/tween/index.js +1 -1
  247. package/tween/src/easing.js +1 -1
  248. package/tween/src/tween.js +1 -1
  249. package/tween.js +1 -1
  250. package/types/string/index.d.ts +8 -0
  251. package/types/xlsx/index.d.ts +2 -0
  252. package/types/xlsx/xlsx.d.ts +224 -0
  253. package/ui-color/compareColorByRange.js +1 -1
  254. package/ui-color/index.js +1 -1
  255. package/uiColor.js +1 -1
  256. package/url-toolkit/index.js +1 -1
  257. package/url-toolkit/src/url-toolkit.js +1 -1
  258. package/urlToolkit.js +1 -1
  259. package/validate/index.js +1 -1
  260. package/validate/src/index.js +1 -1
  261. package/validate/src/locale/en-US.js +1 -1
  262. package/validate/src/locale/zh-CN.js +1 -1
  263. package/validate/src/message.js +1 -1
  264. package/validate/src/rules/array.js +1 -1
  265. package/validate/src/rules/base.js +1 -1
  266. package/validate/src/rules/boolean.js +1 -1
  267. package/validate/src/rules/custom.js +1 -1
  268. package/validate/src/rules/number.js +1 -1
  269. package/validate/src/rules/object.js +1 -1
  270. package/validate/src/rules/string.js +1 -1
  271. package/validate/src/rules/type.js +1 -1
  272. package/validate/src/utils.js +1 -1
  273. package/validate.js +1 -1
  274. package/version/index.js +1 -1
  275. package/version.js +1 -1
  276. package/xlsx/LICENSE +189 -0
  277. package/xlsx/index.d.ts +1139 -0
  278. package/xlsx/index.js +23 -0
  279. package/xlsx/xlsx.js +28329 -0
  280. package/xlsx.js +23 -0
  281. package/axios/chunk/BJvTEV6n.js +0 -253
  282. package/axios/chunk/CB3wlosT.js +0 -64
  283. package/axios/index.d.ts +0 -796
  284. package/axios/index.js +0 -43
  285. package/axios/lib/axios.js +0 -1635
  286. package/axios/lib/utils.js +0 -5
  287. package/axios/mock-adapter/index.d.ts +0 -59
  288. package/axios/mock-adapter/index.js +0 -205
  289. package/axios/mock-adapter/request.js +0 -50
  290. package/axios/mock-adapter/utils.js +0 -130
@@ -1,5 +0,0 @@
1
- /* 2025-11-07 13:23:48 */
2
- import { A as f } from "../chunk/BJvTEV6n.js";
3
- export {
4
- f as default
5
- };
@@ -1,59 +0,0 @@
1
- import type {
2
- AxiosAdapter,
3
- AxiosInstance,
4
- AxiosRequestConfig,
5
- } from '../index.js';
6
-
7
- type CallbackResponseSpecFunc = (
8
- config: AxiosRequestConfig,
9
- ) => any[] | Promise<any[]>;
10
-
11
- type ResponseSpecFunc = (
12
- statusOrCallback: number | CallbackResponseSpecFunc,
13
- data?: any,
14
- headers?: any,
15
- ) => MockAdapter;
16
-
17
- interface RequestHandler {
18
- reply: ResponseSpecFunc;
19
- replyOnce: ResponseSpecFunc;
20
-
21
- passThrough(): void;
22
- networkError(): void;
23
- timeout(): void;
24
- }
25
-
26
- interface MockAdapterOptions {
27
- delayResponse?: number;
28
- onNoMatch?: 'passthrough' | 'throwException';
29
- }
30
-
31
- interface RequestDataMatcher {
32
- [index: string]: any;
33
- params?: {
34
- [index: string]: any;
35
- };
36
- }
37
-
38
- type RequestMatcherFunc = (
39
- matcher?: string | RegExp,
40
- body?: string | RequestDataMatcher,
41
- ) => RequestHandler;
42
-
43
- declare class MockAdapter {
44
- constructor(axiosInstance: AxiosInstance, options?: MockAdapterOptions);
45
-
46
- adapter(): AxiosAdapter;
47
- reset(): void;
48
- restore(): void;
49
-
50
- onGet: RequestMatcherFunc;
51
- onPost: RequestMatcherFunc;
52
- onPut: RequestMatcherFunc;
53
- onHead: RequestMatcherFunc;
54
- onDelete: RequestMatcherFunc;
55
- onPatch: RequestMatcherFunc;
56
- onAny: RequestMatcherFunc;
57
- }
58
-
59
- export default MockAdapter;
@@ -1,205 +0,0 @@
1
- /* 2025-11-07 13:23:48 */
2
- import { A as E } from "../chunk/BJvTEV6n.js";
3
- import { request as w } from "./request.js";
4
- import i from "./utils.js";
5
- const A = [
6
- "get",
7
- "post",
8
- "head",
9
- "delete",
10
- "patch",
11
- "put",
12
- "options",
13
- "list",
14
- "link",
15
- "unlink"
16
- ];
17
- function m() {
18
- const r = [];
19
- return A.forEach(function(e) {
20
- Object.defineProperty(r, e, {
21
- get() {
22
- return r.filter(function(n) {
23
- return !n.method || n.method === e;
24
- });
25
- }
26
- });
27
- }), r;
28
- }
29
- class N {
30
- constructor(e, n = {
31
- delayResponse: 27,
32
- onNoMatch: "passthrough"
33
- }) {
34
- if (this.reset(), e)
35
- this.axiosInstance = e, this.axiosInstanceWithoutInterceptors = e.create ? e.create() : void 0, this.originalAdapter = e.defaults.adapter, this.delayResponse = n.delayResponse > 0 ? n.delayResponse : null, this.onNoMatch = n.onNoMatch || null, e.defaults.adapter = this.adapter();
36
- else
37
- throw new Error("Please provide an instance of axios to mock");
38
- }
39
- adapter() {
40
- return (e) => w(this, e);
41
- }
42
- restore() {
43
- this.axiosInstance && (this.axiosInstance.defaults.adapter = this.originalAdapter, this.axiosInstance = void 0);
44
- }
45
- reset() {
46
- this.resetHandlers(), this.resetHistory();
47
- }
48
- resetHandlers() {
49
- this.handlers ? this.handlers.length = 0 : this.handlers = m();
50
- }
51
- resetHistory() {
52
- this.history ? this.history.length = 0 : this.history = m();
53
- }
54
- }
55
- const R = [
56
- "any",
57
- "get",
58
- "delete",
59
- "head",
60
- "options"
61
- ];
62
- function T(r, e, n) {
63
- return R.includes(r) ? O(r, e || {}) : O(r, Object.assign({}, n, { data: e }));
64
- }
65
- const C = ["headers", "params", "data"];
66
- function O(r, e) {
67
- for (const n in e)
68
- if (!C.includes(n))
69
- throw new Error(
70
- `Invalid config property ${JSON.stringify(
71
- n
72
- )} provided to ${g(r)}. Config: ${JSON.stringify(
73
- e
74
- )}`
75
- );
76
- return e;
77
- }
78
- function g(r) {
79
- return `on${r.charAt(0).toUpperCase()}${r.slice(1)}`;
80
- }
81
- A.concat("any").forEach(function(r) {
82
- N.prototype[g(r)] = function(e, n, a) {
83
- const s = this;
84
- let d;
85
- e = e === void 0 ? /.*/ : e;
86
- const o = T(r, n, a);
87
- function c(t, u, p) {
88
- const h = {
89
- url: e,
90
- method: r === "any" ? void 0 : r,
91
- params: o.params,
92
- data: o.data,
93
- headers: o.headers,
94
- replyOnce: !1,
95
- delay: d,
96
- response: E.isFunction(t) ? t : [t, u, p]
97
- };
98
- return y(r, s.handlers, h), s;
99
- }
100
- function x(t) {
101
- d = t;
102
- const u = f.reply.bind(f);
103
- return Object.assign(u, f), u;
104
- }
105
- function l(t, u, p) {
106
- const h = {
107
- url: e,
108
- method: r === "any" ? void 0 : r,
109
- params: o.params,
110
- data: o.data,
111
- headers: o.headers,
112
- replyOnce: !0,
113
- delay: d,
114
- response: E.isFunction(t) ? t : [t, u, p]
115
- };
116
- return y(r, s.handlers, h), s;
117
- }
118
- const f = {
119
- reply: c,
120
- replyOnce: l,
121
- withDelayInMs: x,
122
- passThrough() {
123
- const t = {
124
- passThrough: !0,
125
- method: r === "any" ? void 0 : r,
126
- url: e,
127
- params: o.params,
128
- data: o.data,
129
- headers: o.headers
130
- };
131
- return y(r, s.handlers, t), s;
132
- },
133
- abortRequest() {
134
- return c(async function(t) {
135
- throw i.createAxiosError(
136
- "Request aborted",
137
- t,
138
- void 0,
139
- "ECONNABORTED"
140
- );
141
- });
142
- },
143
- abortRequestOnce() {
144
- return l(async function(t) {
145
- throw i.createAxiosError(
146
- "Request aborted",
147
- t,
148
- void 0,
149
- "ECONNABORTED"
150
- );
151
- });
152
- },
153
- networkError() {
154
- return c(async function(t) {
155
- throw i.createAxiosError("Network Error", t);
156
- });
157
- },
158
- networkErrorOnce() {
159
- return l(async function(t) {
160
- throw i.createAxiosError("Network Error", t);
161
- });
162
- },
163
- timeout() {
164
- return c(async function(t) {
165
- throw i.createAxiosError(
166
- t.timeoutErrorMessage || `timeout of ${t.timeout}ms exceeded`,
167
- t,
168
- void 0,
169
- t.transitional && t.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED"
170
- );
171
- });
172
- },
173
- timeoutOnce() {
174
- return l(async function(t) {
175
- throw i.createAxiosError(
176
- t.timeoutErrorMessage || `timeout of ${t.timeout}ms exceeded`,
177
- t,
178
- void 0,
179
- t.transitional && t.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED"
180
- );
181
- });
182
- }
183
- };
184
- return f;
185
- };
186
- });
187
- function M(r, e) {
188
- let n = -1;
189
- for (let a = 0; a < r.length; a += 1) {
190
- const s = r[a], d = s.url instanceof RegExp && e.url instanceof RegExp ? String(s.url) === String(e.url) : s.url === e.url;
191
- (!s.method || s.method === e.method) && d && i.isEqual(s.params, e.params) && i.isEqual(s.data, e.data) && i.isEqual(s.headers, e.headers) && !s.replyOnce && (n = a);
192
- }
193
- return n;
194
- }
195
- function y(r, e, n) {
196
- if (r === "any")
197
- e.push(n);
198
- else {
199
- const a = M(e, n);
200
- a > -1 && !n.replyOnce ? e.splice(a, 1, n) : e.push(n);
201
- }
202
- }
203
- export {
204
- N as default
205
- };
@@ -1,50 +0,0 @@
1
- /* 2025-11-07 13:23:48 */
2
- import { A as l } from "../chunk/BJvTEV6n.js";
3
- import a from "./utils.js";
4
- function u(s, e) {
5
- let t = e.baseURL;
6
- return t && !/^https?:/.test(t) && (t = void 0), l.isFunction(s.originalAdapter) ? s.originalAdapter(e) : s.axiosInstanceWithoutInterceptors(
7
- Object.assign({}, e, {
8
- baseURL: t,
9
- // Use the original adapter, not the mock adapter
10
- adapter: s.originalAdapter,
11
- // The request transformation runs on the original axios handler already
12
- transformRequest: [],
13
- transformResponse: []
14
- })
15
- );
16
- }
17
- function n(s, e) {
18
- return l.isNumber(e.delay) ? e.delay : s.delayResponse;
19
- }
20
- async function i(s, e) {
21
- let t = e.url || "";
22
- e.baseURL && t.substr(0, e.baseURL.length) === e.baseURL && (t = t.slice(e.baseURL.length)), delete e.adapter, s.history.push(e);
23
- const r = a.findHandler(
24
- s.handlers,
25
- e.method,
26
- t,
27
- e.data,
28
- e.params,
29
- e.headers && e.headers.constructor.name === "AxiosHeaders" ? Object.assign({}, e.headers.toJSON()) : e.headers,
30
- e.baseURL
31
- );
32
- if (r)
33
- return r.replyOnce && a.purgeIfReplyOnce(s, r), r.passThrough ? u(s, e) : a.settle(
34
- e,
35
- r.response,
36
- n(s, r)
37
- );
38
- switch (s.onNoMatch) {
39
- case "passthrough":
40
- return u(s, e);
41
- case "throwException":
42
- throw a.createCouldNotFindMockError(e);
43
- default:
44
- return a.settle(e, { status: 404 }, s.delayResponse);
45
- }
46
- }
47
- export {
48
- i as default,
49
- i as request
50
- };
@@ -1,130 +0,0 @@
1
- /* 2025-11-07 13:23:48 */
2
- import O from "lodash/isArrayBuffer.js";
3
- import b from "lodash/isBuffer.js";
4
- import d from "lodash/isEqual.js";
5
- import { A as m } from "../chunk/CB3wlosT.js";
6
- import { A as o } from "../chunk/BJvTEV6n.js";
7
- function p(t, r) {
8
- const n = t.length;
9
- for (let i = 0; i < n; i++) {
10
- const e = t[i];
11
- if (r(e)) return e;
12
- }
13
- }
14
- function w(t) {
15
- return o.isStream(t);
16
- }
17
- function N(t) {
18
- return o.isBlob(t);
19
- }
20
- function l(t, r) {
21
- return t ? `${t.replace(/\/+$/, "")}/${r.replace(/^\/+/, "")}` : r;
22
- }
23
- function E(t, r, n, i, e, c, a) {
24
- return p(t[r.toLowerCase()], function(s) {
25
- let u = !1;
26
- return o.isString(s.url) ? u = h(n, s.url) || h(l(a, n), s.url) : s.url instanceof RegExp && (u = s.url.test(n) || s.url.test(l(a, n))), u && S(i, e, s) && f(c, s.headers);
27
- });
28
- }
29
- function h(t, r) {
30
- const n = t[0] === "/" ? t.substr(1) : t, i = r[0] === "/" ? r.substr(1) : r;
31
- return n === i;
32
- }
33
- function S(t, r, n) {
34
- return f(r, n.params) && y(t, n.data);
35
- }
36
- function f(t, r) {
37
- return r === void 0 ? !0 : o.isFunction(r.asymmetricMatch) ? r.asymmetricMatch(t) : d(t, r);
38
- }
39
- function y(t, r) {
40
- if (r === void 0)
41
- return !0;
42
- let n;
43
- try {
44
- n = JSON.parse(t);
45
- } catch (i) {
46
- console.error(i);
47
- }
48
- return f(n || t, r);
49
- }
50
- function M(t, r) {
51
- const n = t.handlers.indexOf(r);
52
- n > -1 && t.handlers.splice(n, 1);
53
- }
54
- function A(t) {
55
- return O(t) || o.isBuffer(t) || w(t) || N(t) ? t : o.isObject(t) ? JSON.parse(JSON.stringify(t)) : t;
56
- }
57
- async function B(t, r) {
58
- o.isFunction(t) && (t = await t(r));
59
- const n = t.status || t[0], i = A(t.data || t[1]), e = t.headers || t[2];
60
- return t.config && (r = t.config), {
61
- status: n,
62
- data: i,
63
- headers: e,
64
- config: r,
65
- request: { responseURL: r.url }
66
- };
67
- }
68
- async function J(t, r, n) {
69
- n > 0 && await new Promise((e) => setTimeout(e, n));
70
- const i = await B(r, t);
71
- if (!i.config.validateStatus || i.config.validateStatus(i.status))
72
- return i;
73
- throw g(
74
- `Request failed with status code ${i.status}`,
75
- i.config,
76
- i
77
- );
78
- }
79
- function g(t, r, n, i) {
80
- if (o.isFunction(m))
81
- return m.from(new Error(t), i, r, null, n);
82
- const e = new Error(t);
83
- return e.isAxiosError = !0, e.config = r, n !== void 0 && (e.response = n), i !== void 0 && (e.code = i), e.toJSON = function() {
84
- return {
85
- // Standard
86
- message: this.message,
87
- name: this.name,
88
- // Microsoft
89
- description: this.description,
90
- number: this.number,
91
- // Mozilla
92
- fileName: this.fileName,
93
- lineNumber: this.lineNumber,
94
- columnNumber: this.columnNumber,
95
- stack: this.stack,
96
- // Axios
97
- config: this.config,
98
- code: this.code
99
- };
100
- }, e;
101
- }
102
- function k(t) {
103
- const r = `Could not find mock for:
104
- ${JSON.stringify(
105
- {
106
- method: t.method,
107
- url: t.url,
108
- params: t.params,
109
- headers: t.headers
110
- },
111
- null,
112
- 2
113
- )}`, n = new Error(r);
114
- return n.isCouldNotFindMockError = !0, n.url = t.url, n.method = t.method, n;
115
- }
116
- const U = {
117
- createAxiosError: g,
118
- createCouldNotFindMockError: k,
119
- find: p,
120
- findHandler: E,
121
- isBlob: N,
122
- isBodyOrParametersMatching: S,
123
- isBuffer: b,
124
- isEqual: d,
125
- purgeIfReplyOnce: M,
126
- settle: J
127
- };
128
- export {
129
- U as default
130
- };