Skip to content

Commit

Permalink
sdk-for-cli initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
imf-ali committed May 28, 2023
1 parent 551cdae commit 8af83b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions templates/cli/lib/parser.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const cliConfig = {
json: false
};

const parse = (data) => {
const parse = (data, child = false) => {
if (cliConfig.json) {
drawJSON(data);
return;
Expand All @@ -23,14 +23,14 @@ const parse = (data) => {
drawJSON(data[key]);
}
} else if (typeof data[key] === 'object') {
if (data[key] && data[key].constructor.name === 'BigNumber') {
console.log(`${chalk.yellow.bold(key)} : ${data[key]}`);
if (data[key] && data[key].constructor?.name === 'BigNumber') {
console.log(`${child ? ' ' : ''}${chalk.yellow.bold(key)} : ${data[key]}`);
} else {
console.log(`${chalk.yellow.bold.underline(key)}`)
parse(data[key]);
parse(data[key], true);
}
} else {
console.log(`${chalk.yellow.bold(key)} : ${data[key]}`);
console.log(`${child ? ' ' : ''}${chalk.yellow.bold(key)} : ${data[key]}`);
}
}
}
Expand Down

0 comments on commit 8af83b5

Please sign in to comment.