add stringify formating for bigint

This commit is contained in:
2022-11-15 05:36:04 +01:00
parent accd3d2155
commit 01e49b7d38
3 changed files with 17 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import { stringify } from 'javascript-stringify';
import { MAX_DATA_SIZE } from './app.config';
import { getType } from '@gkucmierz/utils/src/get-type';
const log = console.log;
console.log = (...a) => l(a);
@@ -46,7 +47,10 @@ const throttledPM = (() => {
})();
const l = args => {
const data = args.map(el => stringify(el, null, ' ')).join(', ');
const data = args.map(el => stringify(el, (val, ind, str) => {
if (getType(val) === 'bigint') return `${val}n`;
return val;
}, ' ')).join(', ');
throttledPM(data);
};