Fix lint: expand inline try/catch in KeyComponentCombine; add brace-style rule to AGENTS.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
28cda9bad9
commit
c44873ab3f
@ -52,6 +52,7 @@ This check is for internal development and validation only. APC must never appea
|
||||
- Continuation lines inside `args: [` must be aligned to **23 spaces**
|
||||
- All module-level functions require JSDoc (`jsdoc/require-jsdoc`)
|
||||
- No unused imports
|
||||
- No inline single-line blocks: `try { x; } catch` or `if (x) { y; }` — statement and closing brace must each be on their own line (`brace-style` rule)
|
||||
|
||||
## Payment Operation Maintenance
|
||||
|
||||
|
||||
@ -50,7 +50,9 @@ class KeyComponentCombine extends Operation {
|
||||
let hexComponents;
|
||||
if (trimmed.startsWith("{")) {
|
||||
let parsed;
|
||||
try { parsed = JSON.parse(trimmed); } catch (e) {
|
||||
try {
|
||||
parsed = JSON.parse(trimmed);
|
||||
} catch (e) {
|
||||
throw new Error("Invalid JSON input.");
|
||||
}
|
||||
if (!Array.isArray(parsed.components) || parsed.components.length === 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user