Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
fix: LEAP-381: Remove excess regexp from BEM module
Browse files Browse the repository at this point in the history
  • Loading branch information
hlomzik committed Dec 20, 2023
1 parent 0d73070 commit c49bca1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils/bem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ const assembleClass = (block: string, elem?: string, mix?: CNMix | CNMix[], mod?
finalClass.push(...Array.from(new Set(mixMap)));
}

const attachNamespace = (cls: string) => {
if (new RegExp(CSS_PREFIX).test(cls)) return cls;
else return `${CSS_PREFIX}${cls}`;
};
const attachNamespace = (cls: string) =>
cls.startsWith(CSS_PREFIX) ? cls : `${CSS_PREFIX}${cls}`;

return finalClass.map(attachNamespace).join(" ");
};
Expand Down

0 comments on commit c49bca1

Please sign in to comment.