1
0
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:
Frankie 2016-10-21 16:39:14 -07:00
parent 8326258b58
commit 7d9e295b75

View File

@ -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]+$/))
}