mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Change regex in isHex function
This commit is contained in:
parent
8326258b58
commit
7d9e295b75
@ -212,8 +212,5 @@ function readableDate (ms) {
|
||||
}
|
||||
|
||||
function isHex (str) {
|
||||
if (str.startsWith('0x')) {
|
||||
return !str.substring(2).match(/([g-zG-Z]|\W)/)
|
||||
}
|
||||
return !str.match(/([g-zG-Z]|\W)/)
|
||||
return Boolean(str.match(/^(0x)?[0-9a-fA-F]+$/))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user