From 7b5613a70f6214664c7aa612292b6ce5fb7585e7 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 21 Nov 2018 17:42:43 -0500 Subject: [PATCH] refactor(@embark/debugger): simplify code --- src/lib/modules/debugger/debugger_manager.ts | 7 +++---- src/lib/modules/debugger/index.ts | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lib/modules/debugger/debugger_manager.ts b/src/lib/modules/debugger/debugger_manager.ts index 5d28022a4..d19c231c4 100644 --- a/src/lib/modules/debugger/debugger_manager.ts +++ b/src/lib/modules/debugger/debugger_manager.ts @@ -80,18 +80,17 @@ export default class DebuggerManager { next(); }); }, - ], () => { - }); + ]); } // TODO: this is duplicated in debugger/index.js private simplifyDebuggerVars(data: any) { const newData: any = {}; - for (const key of Object.keys(data)) { + Object.keys(data).forEach((key) => { const field = data[key]; newData[`${key} (${field.type})`] = field.value; - } + }); return newData; } diff --git a/src/lib/modules/debugger/index.ts b/src/lib/modules/debugger/index.ts index 873d312b8..70cf13dec 100644 --- a/src/lib/modules/debugger/index.ts +++ b/src/lib/modules/debugger/index.ts @@ -137,7 +137,7 @@ class TransactionDebugger { res.send({ok: true}); }); this.embark.registerAPICall("post", "/embark-api/debugger/StepOverBackward", (req: any, res: any) => { - if (this.apiDebugger.canGotPrevious()) { + if (this.apiDebugger.canGoPrevious()) { this.apiDebugger.stepOverBack(true); } res.send({ok: true}); @@ -149,7 +149,7 @@ class TransactionDebugger { res.send({ok: true}); }); this.embark.registerAPICall("post", "/embark-api/debugger/StepIntoBackward", (req: any, res: any) => { - if (this.apiDebugger.canGotPrevious()) { + if (this.apiDebugger.canGoPrevious()) { this.apiDebugger.stepIntoBack(true); } res.send({ok: true}); @@ -181,10 +181,10 @@ class TransactionDebugger { private simplifyDebuggerVars(data: any) { const newData: any = {}; - for (const key of Object.keys(data)) { + Object.keys(data).forEach((key) => { const field = data[key]; newData[`${key} (${field.type})`] = field.value; - } + }); return newData; }