rn-css 1.5.4 → 1.5.5
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 +1 -1
- package/package.json +5 -5
- package/src/convertUnits.ts +1 -1
package/dist/convertUnits.js
CHANGED
|
@@ -6,7 +6,7 @@ const react_native_1 = require("react-native");
|
|
|
6
6
|
/** Take a css value like 12em and return [12, 'em'] */
|
|
7
7
|
function parseValue(value) {
|
|
8
8
|
// Match a single unit
|
|
9
|
-
const unit = value.match(/([+-]?\b\d+(\.\d+)?)([a-z]+\b|%)
|
|
9
|
+
const unit = value.match(/([+-]?\b\d+(\.\d+)?)([a-z]+\b|%)?/i);
|
|
10
10
|
return [parseFloat(unit[1]), unit[3]];
|
|
11
11
|
}
|
|
12
12
|
exports.parseValue = parseValue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rn-css",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"test": "jest",
|
|
6
6
|
"prepare": "tsc",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"html-loader": "^3.0.1",
|
|
40
40
|
"html-webpack-plugin": "^5.5.0",
|
|
41
41
|
"husky": "^7.0.4",
|
|
42
|
-
"jest": "^27.
|
|
42
|
+
"jest": "^27.5.1",
|
|
43
43
|
"lint-staged": "^12.1.2",
|
|
44
|
-
"metro-react-native-babel-preset": "^0.
|
|
44
|
+
"metro-react-native-babel-preset": "^0.70.0",
|
|
45
45
|
"react": "^17.0.2",
|
|
46
46
|
"react-dom": "^17.0.2",
|
|
47
|
-
"react-native": "^0.
|
|
47
|
+
"react-native": "^0.68.0",
|
|
48
48
|
"react-native-typescript-transformer": "^1.2.13",
|
|
49
|
-
"react-native-web": "^0.17.
|
|
49
|
+
"react-native-web": "^0.17.7",
|
|
50
50
|
"react-test-renderer": "17.0.2",
|
|
51
51
|
"release-it": "^14.11.8",
|
|
52
52
|
"ts-jest": "^27.1.1",
|
package/src/convertUnits.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Platform } from 'react-native'
|
|
|
5
5
|
/** Take a css value like 12em and return [12, 'em'] */
|
|
6
6
|
export function parseValue (value: string): [number, string | undefined] {
|
|
7
7
|
// Match a single unit
|
|
8
|
-
const unit = value.match(/([+-]?\b\d+(\.\d+)?)([a-z]+\b|%)
|
|
8
|
+
const unit = value.match(/([+-]?\b\d+(\.\d+)?)([a-z]+\b|%)?/i)
|
|
9
9
|
return [parseFloat(unit![1]), unit![3] as (string | undefined)]
|
|
10
10
|
}
|
|
11
11
|
|