We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The definition of the problem - https://github.com/type-challenges/type-challenges/tree/main/questions/00697-extreme-tag
It's split into sub-problems:
Tag<B, T extends string>
B
T
GetTags<B>
HasTag<B, T extends string>
HasTags<B, T extends readonly string[]>
HasExactTags<B, T extends readonly string[]>
UnTag<B>
Solutions:
The test cases - https://tsplay.dev/NlKEOw
type-fest has support of the following functions:
type-fest
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What
The definition of the problem - https://github.com/type-challenges/type-challenges/tree/main/questions/00697-extreme-tag
It's split into sub-problems:
Tag<B, T extends string>
that takes a typeB
other than null and undefined and returns a type labeled with the string literal typeT
.GetTags<B>
retrieves a list of all tags of a typeB
.HasTag<B, T extends string>
checks if typeB
is tagged with tagT
(and returns true or false)HasTags<B, T extends readonly string[]>
checks if typeB
is tagged in succession with tags from tupleT
HasExactTags<B, T extends readonly string[]>
checks if the list of all tags of typeB
is exactly equal to theT
tupleUnTag<B>
, which removes all tags from typeB
Solutions:
Examples
The test cases - https://tsplay.dev/NlKEOw
Additional Info
type-fest
has support of the following functions:The text was updated successfully, but these errors were encountered: