Skip to content

S.optional(S.union(...)) throws #178

@chenglou

Description

@chenglou
import * as S from 'sury'                                                                                                                                          
const schema = S.optional(S.union(['a', 'b', 'c']), 'a')
console.log(S.parseOrThrow(undefined, schema))

Works on 10.0.4, throws on 11.0.0-alpha.4

Which is ok if this is the new behavior, but it doesn't throw for other types such as S.optional(S.number)

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