rn-css 1.6.15 → 1.6.16
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/convertUnits.js +2 -2
- package/package.json +1 -1
- package/src/convertUnits.ts +1 -1
package/dist/convertUnits.js
CHANGED
|
@@ -50,8 +50,8 @@ function convertValue(key, value, units) {
|
|
|
50
50
|
const convertedValue = value.replace(/(\b\d+(\.\d+)?)([a-z]+\b|%)/ig, occ => {
|
|
51
51
|
const [val, unit] = parseValue(occ);
|
|
52
52
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
53
|
-
if (['deg', 'rad', 'turn'].includes(unit))
|
|
54
|
-
return occ; // We don't want to convert deg
|
|
53
|
+
if (['deg', 'rad', 'turn', 's'].includes(unit))
|
|
54
|
+
return occ; // We don't want to convert deg, rad, turn, second units
|
|
55
55
|
return val * (finalUnits[unit || 'px']) + '';
|
|
56
56
|
});
|
|
57
57
|
// We handle extra calculations (calc, min, max, parsing...)
|
package/package.json
CHANGED
package/src/convertUnits.ts
CHANGED
|
@@ -41,7 +41,7 @@ export function convertValue (key: keyof PartialStyle | keyof Transform, value:
|
|
|
41
41
|
const convertedValue = value.replace(/(\b\d+(\.\d+)?)([a-z]+\b|%)/ig, occ => {
|
|
42
42
|
const [val, unit] = parseValue(occ)
|
|
43
43
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
44
|
-
if (['deg', 'rad', 'turn'].includes(unit!)) return occ // We don't want to convert deg
|
|
44
|
+
if (['deg', 'rad', 'turn', 's'].includes(unit!)) return occ // We don't want to convert deg, rad, turn, second units
|
|
45
45
|
return val * (finalUnits[unit as keyof Units || 'px']!) + ''
|
|
46
46
|
})
|
|
47
47
|
|