MCPcopy
hub / github.com/aykutkardas/regexlearn.com / applyRegex

Function applyRegex

src/components/CheatsheetDemo.tsx:18–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 const initialContent = data.content;
17
18 const applyRegex = () => {
19 const { regex } = checkRegex(data, { regex: data.regex, flags: 'gmi' });
20
21 if (regex) {
22 setContent(
23 tagWrapper({
24 regex,
25 value: initialContent,
26 attributes: {
27 class:
28 'shadow-sm mx-1 my-[2px] px-1 py-[2px] rounded-md text-white bg-green-500 text-black inline-block',
29 },
30 }),
31 );
32 } else {
33 setContent(initialContent);
34 }
35 };
36
37 // eslint-disable-next-line react-hooks/exhaustive-deps
38 useEffect(applyRegex, []);

Callers

nothing calls this directly

Calls 2

tagWrapperFunction · 0.85
checkRegexFunction · 0.70

Tested by

no test coverage detected