Skip to content

Commit

Permalink
Decode JSON strings automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
telackey committed Dec 13, 2023
1 parent 3cdd930 commit 51fd81a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"fs-extra": "^10.1.0",
"@cerc-io/laconic-sdk": "^0.1.11",
"@cerc-io/laconic-sdk": "^0.1.12",
"js-yaml": "^3.14.1",
"lodash": "^4.17.21",
"lodash-clean": "^2.2.3",
Expand Down
8 changes: 7 additions & 1 deletion src/util/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export const queryOutput = (result: any, output: unknown) => {
if (output=="json"){
console.log(JSON.parse(JSON.stringify(result)));
} else {
console.log(JSON.stringify(result,undefined,2));
console.log(JSON.stringify(result, (key, value) => {
try {
return JSON.parse(value)
} catch (e) {
return value;
}
}, 2));
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@cerc-io/laconic-sdk@^0.1.11":
version "0.1.11"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flaconic-sdk/-/0.1.11/laconic-sdk-0.1.11.tgz#a93c99c2e80ad7f41bbf69549126234c8690d093"
integrity sha512-whNSXv0K5nZnDJACGMx66QY6Kewq7scaxqrl5/94NRxDfBLGRAVvqJa6z2ZoZjySB6f2T2Dsez7znAHt9x2oUg==
"@cerc-io/laconic-sdk@^0.1.12":
version "0.1.12"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flaconic-sdk/-/0.1.12/laconic-sdk-0.1.12.tgz#1507526b95ebdb6827fc569f83a2da3cca17a41d"
integrity sha512-oLkX062ohOmk9RnAoeFYyMAOF/jnBjqYEpBPzJy1A5ukrWTT01Rx94f4UKinQlvrRXgcUqDgjhCGz9zpcUtpoQ==
dependencies:
"@cosmjs/amino" "^0.28.1"
"@cosmjs/crypto" "^0.28.1"
Expand Down

0 comments on commit 51fd81a

Please sign in to comment.