clean up the isHex function

feature/default_network_editable
Frankie 8 years ago
parent d4c0a4949b
commit d79424e9c0
  1. 7
      ui/app/util.js

@ -212,7 +212,8 @@ function readableDate (ms) {
}
function isHex (str) {
if (str.startsWith('0x')) str = str.replace('0x', '')
if (str.match(/[g-zG-Z]/) || str.match(/\W/)) return false
return true
if (str.startsWith('0x')) {
return !str.substring(2).match(/([g-zG-Z]|\W)/)
}
return !str.match(/([g-zG-Z]|\W)/)
}

Loading…
Cancel
Save