1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/patches/ethereumjs-util+7.1.5.patch
2022-10-07 10:24:24 -05:00

49 lines
2.0 KiB
Diff

diff --git a/node_modules/ethereumjs-util/dist.browser/internal.js b/node_modules/ethereumjs-util/dist.browser/internal.js
index 9f3888b..3803958 100644
--- a/node_modules/ethereumjs-util/dist.browser/internal.js
+++ b/node_modules/ethereumjs-util/dist.browser/internal.js
@@ -43,8 +43,9 @@ exports.isHexPrefixed = isHexPrefixed;
* @returns the string without 0x prefix
*/
var stripHexPrefix = function (str) {
- if (typeof str !== 'string')
- throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof str));
+ if (typeof str !== 'string'){
+ return str;
+ }
return isHexPrefixed(str) ? str.slice(2) : str;
};
exports.stripHexPrefix = stripHexPrefix;
diff --git a/node_modules/ethereumjs-util/dist/internal.js b/node_modules/ethereumjs-util/dist/internal.js
index 01a90a0..9f1d8cd 100644
--- a/node_modules/ethereumjs-util/dist/internal.js
+++ b/node_modules/ethereumjs-util/dist/internal.js
@@ -43,8 +43,9 @@ exports.isHexPrefixed = isHexPrefixed;
* @returns the string without 0x prefix
*/
const stripHexPrefix = (str) => {
- if (typeof str !== 'string')
- throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof str}`);
+ if (typeof str !== 'string'){
+ return str;
+ }
return isHexPrefixed(str) ? str.slice(2) : str;
};
exports.stripHexPrefix = stripHexPrefix;
diff --git a/node_modules/ethereumjs-util/src/internal.ts b/node_modules/ethereumjs-util/src/internal.ts
index 52032f5..8f6f5f8 100644
--- a/node_modules/ethereumjs-util/src/internal.ts
+++ b/node_modules/ethereumjs-util/src/internal.ts
@@ -42,8 +42,9 @@ export function isHexPrefixed(str: string): boolean {
* @returns the string without 0x prefix
*/
export const stripHexPrefix = (str: string): string => {
- if (typeof str !== 'string')
- throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof str}`)
+ if (typeof str !== 'string') {
+ return str;
+ }
return isHexPrefixed(str) ? str.slice(2) : str
}