Compare commits

..

2 Commits

Author SHA1 Message Date
2fe3a72eaf 7.0.11
Some checks failed
Default (tags) / security (push) Successful in 56s
Default (tags) / test (push) Failing after 1m18s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-28 11:19:45 +00:00
fb7e82557b chore: Remove debug logging from Collection decorator 2025-11-28 11:19:44 +00:00
2 changed files with 1 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@push.rocks/smartdata", "name": "@push.rocks/smartdata",
"version": "7.0.10", "version": "7.0.11",
"private": false, "private": false,
"description": "An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.", "description": "An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.",
"exports": { "exports": {

View File

@@ -93,22 +93,17 @@ export function Collection(dbArg: SmartdataDb | TDelayed<SmartdataDb>) {
// Initialize prototype properties from context.metadata (TC39 decorator metadata) // Initialize prototype properties from context.metadata (TC39 decorator metadata)
// This ensures prototype properties are available before any instance is created // This ensures prototype properties are available before any instance is created
const metadata = context.metadata as any; const metadata = context.metadata as any;
logger.log('debug', `Collection decorator: metadata keys = ${metadata ? Object.keys(metadata).join(', ') : 'null'}`);
logger.log('debug', `Collection decorator: saveableProperties in metadata = ${metadata?.saveableProperties?.length ?? 0}`);
logger.log('debug', `Collection decorator: globalSaveableProperties in metadata = ${metadata?.globalSaveableProperties?.length ?? 0}`);
if (metadata) { if (metadata) {
const proto = decoratedClass.prototype; const proto = decoratedClass.prototype;
// Initialize globalSaveableProperties // Initialize globalSaveableProperties
if (metadata.globalSaveableProperties && !proto.globalSaveableProperties) { if (metadata.globalSaveableProperties && !proto.globalSaveableProperties) {
proto.globalSaveableProperties = [...metadata.globalSaveableProperties]; proto.globalSaveableProperties = [...metadata.globalSaveableProperties];
logger.log('debug', `Collection decorator: initialized globalSaveableProperties with ${proto.globalSaveableProperties.length} properties`);
} }
// Initialize saveableProperties // Initialize saveableProperties
if (metadata.saveableProperties && !proto.saveableProperties) { if (metadata.saveableProperties && !proto.saveableProperties) {
proto.saveableProperties = [...metadata.saveableProperties]; proto.saveableProperties = [...metadata.saveableProperties];
logger.log('debug', `Collection decorator: initialized saveableProperties with ${proto.saveableProperties.length} properties`);
} }
// Initialize uniqueIndexes // Initialize uniqueIndexes