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

sanitize doesn't work well with nested objects in intersections #21

Open
troyvgw opened this issue Nov 14, 2022 · 0 comments
Open

sanitize doesn't work well with nested objects in intersections #21

troyvgw opened this issue Nov 14, 2022 · 0 comments

Comments

@troyvgw
Copy link

troyvgw commented Nov 14, 2022

Source code in question: https://github.com/yortus/rtti/blob/main/src/operations/sanitize.ts#L30-L40

This current implementation works for simple intersections of objects, but not nested objects. It basically removes all properties of nested objects except those defined in the last member of the intersection.

To rectify this, it should do a 'deep' intersection of nested properties first, and then delegate to object sanitisation.

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

No branches or pull requests

1 participant