Update isHex check & toHex with shortening (#129)

* Update isHex check & toHex with shortening

* Basic cleanups
This commit is contained in:
Jaco Greeff
2018-05-24 15:00:59 +02:00
committed by GitHub
parent d51bb240d5
commit f1c7553a4f
14 changed files with 74 additions and 90 deletions
+1 -1
View File
@@ -18,5 +18,5 @@ const isHex = require('../is/hex');
*/
module.exports = function hexHasPrefix (value: ?string): boolean {
// flowlint-next-line sketchy-null-string:off
return !!(value && isHex(value) && value.substr(0, 2) === '0x');
return !!(value && isHex(value, -1, true) && value.substr(0, 2) === '0x');
};