whistle.mock-plugins 1.0.5 → 1.0.6

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.
@@ -117,7 +117,6 @@ const loadInterfaces = () => {
117
117
  // 匹配URL是否符合模式
118
118
  const isUrlMatch = (url, pattern, proxyType, fullUrl) => {
119
119
  if (!pattern) return false;
120
-
121
120
  try {
122
121
  // 针对不同的代理类型采用不同的匹配策略
123
122
 
@@ -151,7 +150,7 @@ const isUrlMatch = (url, pattern, proxyType, fullUrl) => {
151
150
  }
152
151
 
153
152
  // 正则表达式匹配
154
- if (pattern.startsWith('/') && pattern.endsWith('/')) {
153
+ if (pattern.startsWith('/')) {
155
154
  const regexStr = pattern.slice(1, -1);
156
155
  const regex = new RegExp(regexStr);
157
156
  return regex.test(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whistle.mock-plugins",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Whistle 插件,用于快速创建 API 模拟数据",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {