@bamboocss/shared 1.11.1 → 1.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/astish.ts
3
+ const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
4
+ const ruleClean = /\/\*[^]*?\*\/| +/g;
5
+ const ruleNewline = /\n+/g;
6
+ const empty = " ";
7
+ const astish = (val, tree = [{}]) => {
8
+ if (!val) return tree[0];
9
+ let block, left;
10
+ while (block = newRule.exec(val.replace(ruleClean, ""))) if (block[4]) tree.shift();
11
+ else if (block[3]) {
12
+ left = block[3].replace(ruleNewline, empty).trim();
13
+ if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
14
+ tree.unshift(tree[0][left] = tree[0][left] || {});
15
+ } else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
16
+ return tree[0];
17
+ };
18
+ //#endregion
19
+ exports.astish = astish;
@@ -0,0 +1,4 @@
1
+ //#region src/astish.d.ts
2
+ declare const astish: (val: string, tree?: any[]) => Record<string, any>;
3
+ //#endregion
4
+ export { astish };
@@ -0,0 +1,4 @@
1
+ //#region src/astish.d.ts
2
+ declare const astish: (val: string, tree?: any[]) => Record<string, any>;
3
+ //#endregion
4
+ export { astish };
package/dist/astish.mjs CHANGED
@@ -1,21 +1,18 @@
1
- // src/astish.ts
2
- var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
3
- var ruleClean = /\/\*[^]*?\*\/| +/g;
4
- var ruleNewline = /\n+/g;
5
- var empty = " ";
6
- var astish = (val, tree = [{}]) => {
7
- if (!val) return tree[0];
8
- let block, left;
9
- while (block = newRule.exec(val.replace(ruleClean, ""))) {
10
- if (block[4]) tree.shift();
11
- else if (block[3]) {
12
- left = block[3].replace(ruleNewline, empty).trim();
13
- if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
14
- tree.unshift(tree[0][left] = tree[0][left] || {});
15
- } else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
16
- }
17
- return tree[0];
18
- };
19
- export {
20
- astish
1
+ //#region src/astish.ts
2
+ const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
3
+ const ruleClean = /\/\*[^]*?\*\/| +/g;
4
+ const ruleNewline = /\n+/g;
5
+ const empty = " ";
6
+ const astish = (val, tree = [{}]) => {
7
+ if (!val) return tree[0];
8
+ let block, left;
9
+ while (block = newRule.exec(val.replace(ruleClean, ""))) if (block[4]) tree.shift();
10
+ else if (block[3]) {
11
+ left = block[3].replace(ruleNewline, empty).trim();
12
+ if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
13
+ tree.unshift(tree[0][left] = tree[0][left] || {});
14
+ } else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
15
+ return tree[0];
21
16
  };
17
+ //#endregion
18
+ export { astish };