Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore readonly properties #195

Merged
merged 4 commits into from
Jun 12, 2024
Merged

Ignore readonly properties #195

merged 4 commits into from
Jun 12, 2024

Conversation

llupa
Copy link
Contributor

@llupa llupa commented Jun 3, 2024

I am opening this PR as a starting point and to address #174

@llupa llupa marked this pull request as ready for review June 3, 2024 13:21
@mnapoli
Copy link
Member

mnapoli commented Jun 6, 2024

What will this code do? It seems like readonly properties would be empty. Shouldn't it contain the value of the original object? (else it's not really cloning)

@llupa
Copy link
Contributor Author

llupa commented Jun 6, 2024

Yes the same value is in both origin and clone objects. The assertion function in this package checks both arguments have equal values but they are not the same object.

I did try it with simple use cases, I can add more tests as a next step.

@mnapoli
Copy link
Member

mnapoli commented Jun 6, 2024

Oh ok awesome thanks! Let's run the CI!

@llupa
Copy link
Contributor Author

llupa commented Jun 7, 2024

I saw the CI failing for all version below 8.1, I think I misunderstood how @requires works. Will update this in the upcoming days!

Edit: @mnapoli I added test fixtures in their new dedicated namespace. I have 2 classes, 1 with 3 sample scalar readonly properties and another one with readonly object property typed from the former class.

I did try this in a test branch and I know it passes. If you think that the assertion does not let this be very transparent, I can also just compare the property values one by one. As you wish

@mnapoli
Copy link
Member

mnapoli commented Jun 12, 2024

It's green 🙌

@mnapoli mnapoli merged commit 3a6b9a4 into myclabs:1.x Jun 12, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants