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:
J8k3 2026-05-20 22:22:51 -04:00
parent 28cda9bad9
commit c44873ab3f
2 changed files with 4 additions and 1 deletions

View File

@ -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** - Continuation lines inside `args: [` must be aligned to **23 spaces**
- All module-level functions require JSDoc (`jsdoc/require-jsdoc`) - All module-level functions require JSDoc (`jsdoc/require-jsdoc`)
- No unused imports - 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 ## Payment Operation Maintenance

View File

@ -50,7 +50,9 @@ class KeyComponentCombine extends Operation {
let hexComponents; let hexComponents;
if (trimmed.startsWith("{")) { if (trimmed.startsWith("{")) {
let parsed; let parsed;
try { parsed = JSON.parse(trimmed); } catch (e) { try {
parsed = JSON.parse(trimmed);
} catch (e) {
throw new Error("Invalid JSON input."); throw new Error("Invalid JSON input.");
} }
if (!Array.isArray(parsed.components) || parsed.components.length === 0) { if (!Array.isArray(parsed.components) || parsed.components.length === 0) {