Skip to content

Commit b3762ac

Browse files
committed
Merge branch 'frontend-no-param-reassign'
2 parents ac8c3a0 + 88a0559 commit b3762ac

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

frontends/web/eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default tseslint.config(
2222
}
2323
},
2424
'rules': {
25+
'no-param-reassign': ['error'],
2526
'brace-style': ['error', '1tbs'],
2627
'comma-spacing': ['error', { 'before': false, 'after': true }],
2728
'curly': 'error',

frontends/web/src/utils/walletconnect.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,21 @@ export const rejectMessage = (id: number) => {
108108
};
109109

110110
export const decodeEthMessage = (hex: string) => {
111-
hex = hex.trim();
112-
if (hex.startsWith('0x')) {
113-
hex = hex.substring(2);
111+
let message = hex.trim();
112+
if (message.startsWith('0x')) {
113+
message = message.substring(2);
114114
}
115115

116116
// Validate input.
117-
if (hex.length % 2 !== 0 || !/^[0-9a-fA-F]*$/.test(hex)) {
117+
if (message.length % 2 !== 0 || !/^[0-9a-fA-F]*$/.test(message)) {
118118
console.error('Invalid hex string');
119119
return null;
120120
}
121121

122122
// Create a Uint8Array from the hex string.
123-
const bytes = new Uint8Array(hex.length / 2);
123+
const bytes = new Uint8Array(message.length / 2);
124124
for (let i = 0; i < bytes.length; i++) {
125-
const byte = parseInt(hex.substring(i * 2, i * 2 + 2), 16);
125+
const byte = parseInt(message.substring(i * 2, i * 2 + 2), 16);
126126
if (isNaN(byte)) {
127127
console.error('Invalid byte in hex string');
128128
return null;

0 commit comments

Comments
 (0)