Skip to content

Commit 8af83b5

Browse files
committed
sdk-for-cli initial commit
1 parent 551cdae commit 8af83b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

templates/cli/lib/parser.js.twig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const cliConfig = {
88
json: false
99
};
1010

11-
const parse = (data) => {
11+
const parse = (data, child = false) => {
1212
if (cliConfig.json) {
1313
drawJSON(data);
1414
return;
@@ -23,14 +23,14 @@ const parse = (data) => {
2323
drawJSON(data[key]);
2424
}
2525
} else if (typeof data[key] === 'object') {
26-
if (data[key] && data[key].constructor.name === 'BigNumber') {
27-
console.log(`${chalk.yellow.bold(key)} : ${data[key]}`);
26+
if (data[key] && data[key].constructor?.name === 'BigNumber') {
27+
console.log(`${child ? ' ' : ''}${chalk.yellow.bold(key)} : ${data[key]}`);
2828
} else {
2929
console.log(`${chalk.yellow.bold.underline(key)}`)
30-
parse(data[key]);
30+
parse(data[key], true);
3131
}
3232
} else {
33-
console.log(`${chalk.yellow.bold(key)} : ${data[key]}`);
33+
console.log(`${child ? ' ' : ''}${chalk.yellow.bold(key)} : ${data[key]}`);
3434
}
3535
}
3636
}

0 commit comments

Comments
 (0)