mirror of
https://github.com/PretendoNetwork/BOSS.git
synced 2026-08-22 00:54:08 -05:00
Merge branch 'feat/cli-output-format' of github.com:PretendoNetwork/BOSS into feat/cli-output-format
This commit is contained in:
@@ -13,7 +13,12 @@ function mapOutputObject(obj: FormattableObject, mapping: FieldMapping): Formatt
|
||||
|
||||
export function logOutputList<T extends FormattableObject>(format: FormatOption, items: T[], mapping: FieldMapping = {}): void {
|
||||
if (format === 'json') {
|
||||
console.log(JSON.stringify(items, null, 2));
|
||||
console.log(JSON.stringify(items, (_, v) => {
|
||||
if (typeof v === 'bigint') {
|
||||
return v.toString();
|
||||
}
|
||||
return v;
|
||||
}, 2));
|
||||
return;
|
||||
}
|
||||
const mappedItems = items.map(item => mapOutputObject(item, mapping));
|
||||
|
||||
Reference in New Issue
Block a user