mognoDB bigint support

This commit is contained in:
SPRINX0\prochazka
2025-05-06 12:51:37 +02:00
parent b9d4197b5c
commit a71c4fe7ec
2 changed files with 36 additions and 24 deletions

View File

@@ -590,11 +590,14 @@ export function jsonLinesParse(jsonLines: string): any[] {
.filter(x => x);
}
export function serializeJsTypesForJsonStringify(obj) {
export function serializeJsTypesForJsonStringify(obj, replacer = null) {
return _cloneDeepWith(obj, value => {
if (typeof value === 'bigint') {
return { $bigint: value.toString() };
}
if (replacer) {
return replacer(value);
}
});
}