Skip to content

Using allow after valid is not working #494

@Pnlvfx

Description

@Pnlvfx

Describe the bug
If you add the allow operator after using the valid it will only pick the valid.

example:

export const ciaoSchema = Joi.string().valid('Ciao').allow(null).meta({className: 'Data'})

will output:

type Data = 'Ciao'

instead of:

type Data = 'Ciao' | null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions