better display of ObjectId on JSON view

This commit is contained in:
SPRINX0\prochazka
2025-01-24 14:33:22 +01:00
parent 4944bc4bca
commit e574667651
3 changed files with 11 additions and 0 deletions

View File

@@ -35,6 +35,8 @@
return typeof value.set === 'function' ? JSONIterableMapNode : JSONIterableArrayNode;
case 'MapEntry':
return JSONMapEntryNode;
case 'ObjectId':
return JSONValueNode;
default:
return JSONValueNode;
}
@@ -64,6 +66,8 @@
case 'Function':
case 'Symbol':
return raw => raw.toString();
case 'ObjectId':
return raw => `ObjectId("${raw.$oid}")`;
default:
return () => `<${nodeType}>`;
}