aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorFrankie <frankie.pangilinan@consensys.net>2016-10-22 07:05:39 +0800
committerFrankie <frankie.pangilinan@consensys.net>2016-10-22 07:05:39 +0800
commitd79424e9c04fb409843c3a08b8f6eabc1036b7b6 (patch)
treeead7d04460fd4c5745255cae093e1d156307c9ca /ui/app/util.js
parentd4c0a4949bd8331e965ad17c5ac04af7b6fb90ea (diff)
downloadtangerine-wallet-browser-d79424e9c04fb409843c3a08b8f6eabc1036b7b6.tar
tangerine-wallet-browser-d79424e9c04fb409843c3a08b8f6eabc1036b7b6.tar.gz
tangerine-wallet-browser-d79424e9c04fb409843c3a08b8f6eabc1036b7b6.tar.bz2
tangerine-wallet-browser-d79424e9c04fb409843c3a08b8f6eabc1036b7b6.tar.lz
tangerine-wallet-browser-d79424e9c04fb409843c3a08b8f6eabc1036b7b6.tar.xz
tangerine-wallet-browser-d79424e9c04fb409843c3a08b8f6eabc1036b7b6.tar.zst
tangerine-wallet-browser-d79424e9c04fb409843c3a08b8f6eabc1036b7b6.zip
clean up the isHex function
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index a519ab5b4..72b3af465 100644
--- a/ui/app/util.js
+++ b/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)/)
}