Beta 7 with some repo names changed.
This commit is contained in:
1 parent
0f7b40cca7
commit
963c19493a
3408 files changed
+462217
-15516
No files matched your search
+13
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Returns a `Boolean` on whether or not the a `String` starts with '0x'
|
||||
* @param {String} str the string input value
|
||||
* @return {Boolean} a boolean if it is or is not hex prefixed
|
||||
* @throws if the str input is not a string
|
||||
*/
|
||||
module.exports = function isHexPrefixed(str) {
|
||||
if (typeof str !== 'string') {
|
||||
throw new Error("[is-hex-prefixed] value must be type 'string', is currently type " + (typeof str) + ", while checking isHexPrefixed.");
|
||||
}
|
||||
|
||||
return str.slice(0, 2) === '0x';
|
||||
}
|
||||
Reference in new issue
Block a user