transform-to-unocss-core 0.0.64 → 0.0.66
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.
- package/dist/index.cjs +3 -3
- package/dist/index.iife.js +3 -3
- package/dist/index.js +3 -3
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -56,7 +56,7 @@ function getVal(val, transform$1, inClass, prefix = "", dynamicFlag = false) {
|
|
|
56
56
|
}
|
|
57
57
|
function getHundred(n) {
|
|
58
58
|
if (typeof n === "string" && n.endsWith("%")) return +n.slice(0, -1);
|
|
59
|
-
return
|
|
59
|
+
return Math.round(Number(n) * 100);
|
|
60
60
|
}
|
|
61
61
|
function joinWithLine(s) {
|
|
62
62
|
return s.replace(/\s+/g, " ").split(/\s/g).join("-");
|
|
@@ -1714,9 +1714,9 @@ const transformer = {
|
|
|
1714
1714
|
};
|
|
1715
1715
|
function transformStyleToUnocssPre(styles) {
|
|
1716
1716
|
const preTransformedList = [];
|
|
1717
|
-
const styleToObj = styles.split(";").reduce((r, item) => {
|
|
1717
|
+
const styleToObj = styles.split(";").filter(Boolean).reduce((r, item) => {
|
|
1718
1718
|
const [key, value] = item.split(":");
|
|
1719
|
-
if (key.trim() && value.trim()) r[key.trim()] = value.trim();
|
|
1719
|
+
if (key.trim() && (value === null || value === void 0 ? void 0 : value.trim())) r[key.trim()] = value.trim();
|
|
1720
1720
|
return r;
|
|
1721
1721
|
}, {});
|
|
1722
1722
|
for (const key in transformer) {
|
package/dist/index.iife.js
CHANGED
|
@@ -58,7 +58,7 @@ function getVal(val, transform$1, inClass, prefix = "", dynamicFlag = false) {
|
|
|
58
58
|
}
|
|
59
59
|
function getHundred(n) {
|
|
60
60
|
if (typeof n === "string" && n.endsWith("%")) return +n.slice(0, -1);
|
|
61
|
-
return
|
|
61
|
+
return Math.round(Number(n) * 100);
|
|
62
62
|
}
|
|
63
63
|
function joinWithLine(s) {
|
|
64
64
|
return s.replace(/\s+/g, " ").split(/\s/g).join("-");
|
|
@@ -1716,9 +1716,9 @@ const transformer = {
|
|
|
1716
1716
|
};
|
|
1717
1717
|
function transformStyleToUnocssPre(styles) {
|
|
1718
1718
|
const preTransformedList = [];
|
|
1719
|
-
const styleToObj = styles.split(";").reduce((r, item) => {
|
|
1719
|
+
const styleToObj = styles.split(";").filter(Boolean).reduce((r, item) => {
|
|
1720
1720
|
const [key, value] = item.split(":");
|
|
1721
|
-
if (key.trim() && value.trim()) r[key.trim()] = value.trim();
|
|
1721
|
+
if (key.trim() && (value === null || value === void 0 ? void 0 : value.trim())) r[key.trim()] = value.trim();
|
|
1722
1722
|
return r;
|
|
1723
1723
|
}, {});
|
|
1724
1724
|
for (const key in transformer) {
|
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ function getVal(val, transform$1, inClass, prefix = "", dynamicFlag = false) {
|
|
|
54
54
|
}
|
|
55
55
|
function getHundred(n) {
|
|
56
56
|
if (typeof n === "string" && n.endsWith("%")) return +n.slice(0, -1);
|
|
57
|
-
return
|
|
57
|
+
return Math.round(Number(n) * 100);
|
|
58
58
|
}
|
|
59
59
|
function joinWithLine(s) {
|
|
60
60
|
return s.replace(/\s+/g, " ").split(/\s/g).join("-");
|
|
@@ -1712,9 +1712,9 @@ const transformer = {
|
|
|
1712
1712
|
};
|
|
1713
1713
|
function transformStyleToUnocssPre(styles) {
|
|
1714
1714
|
const preTransformedList = [];
|
|
1715
|
-
const styleToObj = styles.split(";").reduce((r, item) => {
|
|
1715
|
+
const styleToObj = styles.split(";").filter(Boolean).reduce((r, item) => {
|
|
1716
1716
|
const [key, value] = item.split(":");
|
|
1717
|
-
if (key.trim() && value.trim()) r[key.trim()] = value.trim();
|
|
1717
|
+
if (key.trim() && (value === null || value === void 0 ? void 0 : value.trim())) r[key.trim()] = value.trim();
|
|
1718
1718
|
return r;
|
|
1719
1719
|
}, {});
|
|
1720
1720
|
for (const key in transformer) {
|
package/dist/index.umd.js
CHANGED
|
@@ -61,7 +61,7 @@ function getVal(val, transform$1, inClass, prefix = "", dynamicFlag = false) {
|
|
|
61
61
|
}
|
|
62
62
|
function getHundred(n) {
|
|
63
63
|
if (typeof n === "string" && n.endsWith("%")) return +n.slice(0, -1);
|
|
64
|
-
return
|
|
64
|
+
return Math.round(Number(n) * 100);
|
|
65
65
|
}
|
|
66
66
|
function joinWithLine(s) {
|
|
67
67
|
return s.replace(/\s+/g, " ").split(/\s/g).join("-");
|
|
@@ -1719,9 +1719,9 @@ const transformer = {
|
|
|
1719
1719
|
};
|
|
1720
1720
|
function transformStyleToUnocssPre(styles) {
|
|
1721
1721
|
const preTransformedList = [];
|
|
1722
|
-
const styleToObj = styles.split(";").reduce((r, item) => {
|
|
1722
|
+
const styleToObj = styles.split(";").filter(Boolean).reduce((r, item) => {
|
|
1723
1723
|
const [key, value] = item.split(":");
|
|
1724
|
-
if (key.trim() && value.trim()) r[key.trim()] = value.trim();
|
|
1724
|
+
if (key.trim() && (value === null || value === void 0 ? void 0 : value.trim())) r[key.trim()] = value.trim();
|
|
1725
1725
|
return r;
|
|
1726
1726
|
}, {});
|
|
1727
1727
|
for (const key in transformer) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "transform-to-unocss-core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.66",
|
|
5
5
|
"description": "A utility to transform CSS to UnoCSS syntax. Supports various CSS properties and custom parsing.",
|
|
6
6
|
"author": "Simon He",
|
|
7
7
|
"license": "MIT",
|