Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

question: How can I validate a union of strings? #2356

Closed
stefan-bc-ts opened this issue Jan 8, 2024 · 1 comment
Closed

question: How can I validate a union of strings? #2356

stefan-bc-ts opened this issue Jan 8, 2024 · 1 comment
Labels
type: question Questions about the usage of the library.

Comments

@stefan-bc-ts
Copy link

stefan-bc-ts commented Jan 8, 2024

I was trying to...
use export type ValidateValues = ‘val1’ | ‘val2’ | ‘val3’;
with @type to make sure the values are correct

The problem:

@Type((_) => ValidateValues)
'ValidateValues' only refers to a type, but is being used as a value here

PS: I was trying to avoid using a enum

@stefan-bc-ts stefan-bc-ts added the type: question Questions about the usage of the library. label Jan 8, 2024
@braaar
Copy link
Member

braaar commented Jan 11, 2024

I'm moving this to the discussion tab, as we are trying to keep the issue count low. Please see this issue for an explanation.

@typestack typestack locked and limited conversation to collaborators Jan 11, 2024
@braaar braaar converted this issue into discussion #2362 Jan 11, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
type: question Questions about the usage of the library.
Development

No branches or pull requests

2 participants