MCPcopy Create free account
hub / github.com/GCWing/BitFun / extractBlock

Function extractBlock

src/web-ui/src/app/components/NavPanel/NavPanelLayout.test.ts:21–25  ·  view source on GitHub ↗
(stylesheet: string, selector: string)

Source from the content-addressed store, hash-verified

19}
20
21function extractBlock(stylesheet: string, selector: string): string {
22 const escapedSelector = selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
23 const match = stylesheet.match(new RegExp(`${escapedSelector}\\s*\\{(?<body>[\\s\\S]*?)\\n\\s*\\}`));
24 return match?.groups?.body ?? '';
25}
26
27describe('NavPanel layout styles', () => {
28 it('allows navigation list wrappers to shrink instead of inheriting long item widths', () => {

Callers 1

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected