mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
clean up the isHex function
This commit is contained in:
parent
d4c0a4949b
commit
d79424e9c0
@ -212,7 +212,8 @@ function readableDate (ms) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isHex (str) {
|
function isHex (str) {
|
||||||
if (str.startsWith('0x')) str = str.replace('0x', '')
|
if (str.startsWith('0x')) {
|
||||||
if (str.match(/[g-zG-Z]/) || str.match(/\W/)) return false
|
return !str.substring(2).match(/([g-zG-Z]|\W)/)
|
||||||
return true
|
}
|
||||||
|
return !str.match(/([g-zG-Z]|\W)/)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user