Skip to content

Conversation

@Karnaukhov-kh
Copy link
Member

@Karnaukhov-kh Karnaukhov-kh commented Jun 11, 2025

update, upsert, and toDictionary functions were losing the prototype chain of objects, causing instanceof checks to fail. Spread operator was the cause of it.

Key Changes:

  • Prototype Preservation: Replaced the use of the spread operator with Object.create and Object.assign to preserver prototype chain.
  • Unit Tests: Added unit tests in update.spec.ts, upsert.spec.ts, and toDictionary.spec.ts to verify that class instances maintain the prototype after transform.

Closes #1480

@github-actions github-actions bot added 🛂 Test Unit tests, e2e tests, integration tests, test coverage 🛠️ CDK CDK related labels Jun 11, 2025
@Karnaukhov-kh Karnaukhov-kh requested a review from hoebbelsB June 11, 2025 17:32
@nx-cloud
Copy link

nx-cloud bot commented Jun 11, 2025

View your CI Pipeline Execution ↗ for commit c75f07c.

Command Status Duration Result
nx affected -t lint build test component-test e... ❌ Failed 15s View ↗
nx-cloud record -- npx nx format:check ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-02 18:28:29 UTC

@bjarne-callewaert
Copy link

@Karnaukhov-kh @hoebbelsB
Is anything blocking this PR from being merged?
If there's something I could help with, feel free to reach out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ CDK CDK related 🛂 Test Unit tests, e2e tests, integration tests, test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update transformation looses typing

3 participants