mirror of
https://github.com/PretendoNetwork/BOSS.git
synced 2026-07-17 18:23:20 -05:00
fix: handle bigints in json cli serialisation
This commit is contained in:
parent
25b871e3b5
commit
d8b2a8dcba
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user