@yeepay/client-utils 3.0.1 → 3.0.2

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 (2) hide show
  1. package/dist/index.js +1 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -16,9 +16,6 @@ function longestCommonPrefix(strs) {
16
16
  }
17
17
  return prefix;
18
18
  }
19
- function escapeRegExp(string) {
20
- return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
21
- }
22
19
  function setupMockAdapter(axiosInstance, mockModules) {
23
20
  if (!mockModules) return;
24
21
  const mock = new AxiosMockAdapter(axiosInstance);
@@ -29,7 +26,7 @@ function setupMockAdapter(axiosInstance, mockModules) {
29
26
  const dotIndex = path.lastIndexOf(".");
30
27
  const uri = path.slice(longestPrefixIndex, dotIndex);
31
28
  const registerMock = (mod) => {
32
- mock.onAny(/* @__PURE__ */ new RegExp(`^${escapeRegExp(uri)}$`)).reply(200, mod);
29
+ mock.onAny(new RegExp(uri)).reply(200, mod);
33
30
  };
34
31
  if (typeof mockModules[path] === "function") mockModules[path]().then(registerMock).catch((error) => {
35
32
  console.error(`@yeepay/client-utils mock trying to loading ${path} failed`, error);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yeepay/client-utils",
3
3
  "type": "module",
4
- "version": "3.0.1",
4
+ "version": "3.0.2",
5
5
  "description": "shared utilities for yeepay client packages",
6
6
  "author": "Yong Yang",
7
7
  "homepage": "http://gitlab.yeepay.com/ued/client-utils#readme",