Skip to content

Commit

Permalink
fix: replace includes check with instanceof RegExp
Browse files Browse the repository at this point in the history
fix: replace includes check with instanceof RegExp
  • Loading branch information
xiaohuoni authored Nov 5, 2024
2 parents fdfa51b + 0749935 commit ea5a355
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wicked-walls-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@alita/plugins': patch
---

replace includes check with instanceof RegExp
2 changes: 1 addition & 1 deletion packages/plugins/src/hd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default (api: AlitaApi) => {
// 将正则转成字符串
selectorDoubleList: px2remConfig.selectorDoubleRemList.map(
(i: string) => {
if (!i.includes('/')) return i;
if (!(i instanceof RegExp)) return i;
const reStr = `${i}`.replaceAll('/', '');
if (hasMagicChars(reStr)) {
return reStr;
Expand Down

0 comments on commit ea5a355

Please sign in to comment.