mirror of https://github.com/embarklabs/embark.git
refactor(@embark/debugger): simplify code
This commit is contained in:
parent
6e5fe85695
commit
7b5613a70f
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue