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

breaking: Implement an immutable API. #37

Merged
merged 4 commits into from
Aug 29, 2021
Merged

breaking: Implement an immutable API. #37

merged 4 commits into from
Aug 29, 2021

Conversation

milesj
Copy link
Owner

@milesj milesj commented Aug 29, 2021

I expected this to be more work, but was rather easy. Just had to rework the criteria/validators inheritance.

@@ -34,7 +34,7 @@ export function createArray(value: unknown): unknown[] {
return [];
}

return Array.isArray(value) ? value : [value];
return Array.isArray(value) ? [...(value as unknown[])] : [value];
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spread to break references

@milesj milesj merged commit d1f12ba into master Aug 29, 2021
@milesj milesj deleted the immutable branch August 29, 2021 22:23
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.

1 participant