mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-07 00:42:31 +00:00
Fix percent.match is not a function when percent is a number
This commit is contained in:
committed by
Mikael Sand
parent
c49fc19014
commit
31d0374c64
@@ -9,7 +9,7 @@ import units from "../units";
|
||||
const percentReg = /^([+\-]?\d+(?:\.\d+)?(?:[eE][+\-]?\d+)?)(%?)$/;
|
||||
|
||||
function percentToFloat(percent) {
|
||||
const matched = percent.match(percentReg);
|
||||
const matched = percent.toString().match(percentReg);
|
||||
if (!matched) {
|
||||
console.warn(
|
||||
`\`${percent}\` is not a valid number or percentage string.`,
|
||||
|
||||
Reference in New Issue
Block a user