hifun-tools 1.3.19 → 1.3.21

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.
@@ -198,25 +198,17 @@ export function filterSmartLines(list1, list2, groupType, tenant) {
198
198
  throw new Error("前两个参数必须是数组");
199
199
  }
200
200
  const currentBrowser = detectBrowser();
201
- // 1. 浏览器过滤
202
201
  let result = list1.filter((item) => {
203
202
  const checks = item.browserCheck || [];
204
203
  const blocked = checks.some((checkItem) => matchBrowser(checkItem, currentBrowser));
205
204
  return !blocked;
206
205
  });
207
- // 2. tenant 过滤(如果有传值)
208
206
  if (tenant) {
209
207
  result = result.filter((item) => item.tenant === tenant);
210
208
  }
211
- // 3. 按 groupType 过滤
212
209
  if (groupType) {
213
210
  result = result.filter((item) => item.lineGroup === groupType);
214
211
  }
215
- // 4. 提取 lines
216
212
  const lines = result.map((item) => toStandardUrl(item.line));
217
- // 5. list2 求交集
218
- const set = new Set(lines);
219
- console.log("list2.map(toStandardUrl)", list2.map(toStandardUrl));
220
- console.log(lines, "==", set);
221
- return list2.map(toStandardUrl).filter((v) => set.has(toStandardUrl(v)));
213
+ return list2.map(toStandardUrl).filter((v) => isDomainMatch(lines, v)); // ✨ 使用域名匹配
222
214
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hifun-tools",
3
- "version": "1.3.19",
3
+ "version": "1.3.21",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",