@prestizni-software/client-dem 0.2.16 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -167,7 +167,11 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
167
167
  public get extractedData(): {
168
168
  [K in keyof InstanceType<T>]: InstanceOf<InstanceType<T>>[K];
169
169
  } {
170
- return structuredClone(this.data) as any as {
170
+ return structuredClone(
171
+ Object.fromEntries(
172
+ Object.entries(this.data).filter(([k, v]) => typeof v !== "function")
173
+ )
174
+ ) as any as {
171
175
  [K in keyof InstanceType<T>]: InstanceOf<InstanceType<T>>[K];
172
176
  };
173
177
  }
@@ -465,15 +469,24 @@ function checkForMissingRefs<C extends Constructor<any>>(
465
469
  !entryKeys.includes(prop.toString()) &&
466
470
  getMetadataRecursive("isRef", classParam.prototype, prop.toString())
467
471
  ) {
468
- (data as any)[prop] = Object.values(autoClassers).find((autoClasser) =>
469
- autoClasser.objectsAsArray.find((object) =>
470
- Object.values(object.extractedData).find((value) =>
471
- Array.isArray(value)
472
- ? value.includes(data._id)
473
- : value === data._id
474
- )
475
- )
476
- );
472
+ findMissingObjectReference(data, prop, autoClassers);
473
+ }
474
+ }
475
+ }
476
+ }
477
+ function findMissingObjectReference(
478
+ data: any,
479
+ prop: any,
480
+ autoClassers: { [key: string]: AutoUpdateManager<any> }
481
+ ) {
482
+ for(const ac of Object.values(autoClassers)){
483
+ for(const obj of ac.objectsAsArray){
484
+ const found = Object.values(obj.extractedData).find((value) =>
485
+ Array.isArray(value) ? value.includes(data._id) : value === data._id
486
+ )
487
+ if(found){
488
+ data[prop] = obj._id;
489
+ return;
477
490
  }
478
491
  }
479
492
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.2.18](https://github.com/Prestizni-Software/client-dem/compare/v0.2.17...v0.2.18) (2025-11-10)
6
+
7
+ ### [0.2.17](https://github.com/Prestizni-Software/client-dem/compare/v0.2.16...v0.2.17) (2025-11-10)
8
+
5
9
  ### [0.2.16](https://github.com/Prestizni-Software/client-dem/compare/v0.2.15...v0.2.16) (2025-11-10)
6
10
 
7
11
  ### [0.2.15](https://github.com/Prestizni-Software/client-dem/compare/v0.2.14...v0.2.15) (2025-11-10)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prestizni-software/client-dem",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "An solution for when making http requests is not a good solution",
5
5
  "keywords": [
6
6
  "websockets"