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
+14
@@ -0,0 +1,14 @@
|
||||
var isHexPrefixed = require('is-hex-prefixed');
|
||||
|
||||
/**
|
||||
* Removes '0x' from a given `String` is present
|
||||
* @param {String} str the string value
|
||||
* @return {String|Optional} a string by pass if necessary
|
||||
*/
|
||||
module.exports = function stripHexPrefix(str) {
|
||||
if (typeof str !== 'string') {
|
||||
return str;
|
||||
}
|
||||
|
||||
return isHexPrefixed(str) ? str.slice(2) : str;
|
||||
}
|
||||
Reference in new issue
Block a user