mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 00:08:37 +01:00
new selfhosted version
This commit is contained in:
13
dashboard/server/utils/debug.ts
Normal file
13
dashboard/server/utils/debug.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
export function getPrettyAggregation(aggregation: any[], indent: number = 0) {
|
||||
const text = JSON.stringify(aggregation, null, indent);
|
||||
const result = text.replace(
|
||||
/"(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)"/g,
|
||||
(match, date) => `ISODate("${date}")`
|
||||
).replace(
|
||||
/"([a-fA-F0-9]{24})"/g,
|
||||
(match, objectId) => `ObjectId("${objectId}")`
|
||||
);
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user