Skip to content

bug: UnionValidator#setValidationEnabled does not make its members respect that  #294

@Qjuh

Description

@Qjuh

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

Found when disabling validation in @discordjs/builders on EmbedBuilder#setDescription() it would still throw a CombinedError with ExpectedValidationError in it.

Steps To Reproduce

import {s} from "@sapphire/shapeshift";

s.string
.lengthGreaterThanOrEqual(10)
.nullish
.setValidationEnabled(false).parse("test");

Expected behavior

It should not throw any Error.

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions