Decode JSON strings automatically.
This commit is contained in:
parent
3cdd930b82
commit
51fd81a082
@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs-extra": "^10.1.0",
|
"fs-extra": "^10.1.0",
|
||||||
"@cerc-io/laconic-sdk": "^0.1.11",
|
"@cerc-io/laconic-sdk": "^0.1.12",
|
||||||
"js-yaml": "^3.14.1",
|
"js-yaml": "^3.14.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"lodash-clean": "^2.2.3",
|
"lodash-clean": "^2.2.3",
|
||||||
|
@ -11,6 +11,12 @@ export const queryOutput = (result: any, output: unknown) => {
|
|||||||
if (output=="json"){
|
if (output=="json"){
|
||||||
console.log(JSON.parse(JSON.stringify(result)));
|
console.log(JSON.parse(JSON.stringify(result)));
|
||||||
} else {
|
} 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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@cerc-io/laconic-sdk@^0.1.11":
|
"@cerc-io/laconic-sdk@^0.1.12":
|
||||||
version "0.1.11"
|
version "0.1.12"
|
||||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flaconic-sdk/-/0.1.11/laconic-sdk-0.1.11.tgz#a93c99c2e80ad7f41bbf69549126234c8690d093"
|
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-whNSXv0K5nZnDJACGMx66QY6Kewq7scaxqrl5/94NRxDfBLGRAVvqJa6z2ZoZjySB6f2T2Dsez7znAHt9x2oUg==
|
integrity sha512-oLkX062ohOmk9RnAoeFYyMAOF/jnBjqYEpBPzJy1A5ukrWTT01Rx94f4UKinQlvrRXgcUqDgjhCGz9zpcUtpoQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@cosmjs/amino" "^0.28.1"
|
"@cosmjs/amino" "^0.28.1"
|
||||||
"@cosmjs/crypto" "^0.28.1"
|
"@cosmjs/crypto" "^0.28.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user