@jsenv/navi 0.7.2 → 0.7.3
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/jsenv_navi.js +8 -13
- package/package.json +2 -2
package/dist/jsenv_navi.js
CHANGED
|
@@ -823,20 +823,15 @@ const normalizeNumber = (value, context, unit, propertyName) => {
|
|
|
823
823
|
return value;
|
|
824
824
|
}
|
|
825
825
|
if (typeof value === "string") {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
const numericValue = parseFloat(value);
|
|
833
|
-
if (isNaN(numericValue)) {
|
|
834
|
-
console.warn(
|
|
835
|
-
`"${propertyName}": ${value} cannot be converted to number, returning value as-is.`,
|
|
836
|
-
);
|
|
837
|
-
return value;
|
|
826
|
+
// For js context, only convert px values to numbers
|
|
827
|
+
if (unit === "px" && value.endsWith("px")) {
|
|
828
|
+
const numericValue = parseFloat(value);
|
|
829
|
+
if (!isNaN(numericValue)) {
|
|
830
|
+
return numericValue;
|
|
831
|
+
}
|
|
838
832
|
}
|
|
839
|
-
|
|
833
|
+
// Keep all other strings as-is (including %, em, rem, auto, none, etc.)
|
|
834
|
+
return value;
|
|
840
835
|
}
|
|
841
836
|
return value;
|
|
842
837
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/navi",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Library of components including navigation to create frontend applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"prepublishOnly": "npm run build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@jsenv/dom": "0.5.
|
|
37
|
+
"@jsenv/dom": "0.5.3",
|
|
38
38
|
"@jsenv/humanize": "1.6.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|