MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / groupingCss

Function groupingCss

packages/utils/src/css-helper.ts:16–33  ·  view source on GitHub ↗
(css: string)

Source from the content-addressed store, hash-verified

14
15// 给 css 分组
16function groupingCss(css: string) {
17 let stackLength = 0;
18 let startIndex = 0;
19 const group: string[] = [];
20 css.split('').forEach((char, index) => {
21 if (char === '{') {
22 stackLength++;
23 }
24 if (char === '}') {
25 if (stackLength === 1) {
26 group.push(css.substring(startIndex, index + 1));
27 startIndex = index + 1;
28 }
29 stackLength--;
30 }
31 });
32 return group;
33}
34
35function isString(str: any): str is string {
36 return {}.toString.call(str) === '[object String]';

Callers 1

cssToRuntimeFunction · 0.85

Calls 2

pushMethod · 0.80
forEachMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…