You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
A subpattern that can be composed with P.intersect, or P.union. .when(x=>x.length) could handle this, but it doesn't guarantee string type.
the other alternative, P.intersection(P.string.minLength(len), P.string.maxLength(len)) could be equivalent, and also can be done with APIs we already have, but it's very cumbersome and the boundaries of those min and maxes(includes or not) are confusing.
Describe the solution you'd like
Add P.string.length(len: number), which matches the given value's type is string and its length is same as given len
Describe alternatives you've considered
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
A subpattern that can be composed with P.intersect, or P.union. .when(x=>x.length) could handle this, but it doesn't guarantee string type.
the other alternative, P.intersection(P.string.minLength(len), P.string.maxLength(len)) could be equivalent, and also can be done with APIs we already have, but it's very cumbersome and the boundaries of those min and maxes(includes or not) are confusing.
Describe the solution you'd like
Add P.string.length(len: number), which matches the given value's type is string and its length is same as given
len
Describe alternatives you've considered
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: