🐛 (setVariable) Properly parse phone number variables
This commit is contained in:
@@ -6,9 +6,11 @@ export const parseGuessedValueType = (
|
||||
if (value === null) return null
|
||||
if (value === undefined) return undefined
|
||||
if (typeof value !== 'string') return value
|
||||
const isNumberStartingWithZero =
|
||||
const isStartingWithZero =
|
||||
value.startsWith('0') && !value.startsWith('0.') && value.length > 1
|
||||
if (typeof value === 'string' && isNumberStartingWithZero) return value
|
||||
if (typeof value === 'string' && isStartingWithZero) return value
|
||||
const isStartingWithPlus = value.startsWith('+')
|
||||
if (typeof value === 'string' && isStartingWithPlus) return value
|
||||
if (typeof value === 'number') return value
|
||||
if (value === 'true') return true
|
||||
if (value === 'false') return false
|
||||
|
||||
Reference in New Issue
Block a user