Skip to content

Conversation

@Milly
Copy link
Collaborator

@Milly Milly commented Apr 14, 2024

Fixes #68

It's close to the functionality of the old AllOf.

Questions

Allow only one element?

const isMyObj = is.IntersectionOf([
  is.ObjectOf({a: is.String}),
]);

Currently...

  • The type allows only one or more elements.
  • The implementation also works with 0 elements.
    • In that case, the Predicate will always return true.

Copy link
Member

@lambdalisue lambdalisue left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot 🎉

@lambdalisue lambdalisue merged commit d4f1d1d into jsr-core:main Apr 14, 2024
@Milly Milly deleted the intersectionof branch April 14, 2024 11:15
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.

Type mismatch on intersection of object and union

2 participants