1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02: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) { function isHex (str) {
if (str.startsWith('0x')) { return Boolean(str.match(/^(0x)?[0-9a-fA-F]+$/))
return !str.substring(2).match(/([g-zG-Z]|\W)/)
}
return !str.match(/([g-zG-Z]|\W)/)
} }