Doubter - v5.1.1-next.e4e15ab
    Preparing search index...

    Class DenyShape<BaseShape, DeniedValue>

    The shape that prevents both input and output from being equal to a denied value.

    Type Parameters

    • BaseShape extends AnyShape

      The shape that parses the input without the denied value.

    • DeniedValue

      The denied value.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    _options: undefined | IssueOptions | Message

    The constraint options or an issue message.

    annotations: Dict = {}

    The dictionary of shape annotations.

    baseShape: BaseShape

    The shape that parses the input without the denied value.

    deniedValue: DeniedValue

    The dined value.

    inputs: readonly unknown[]

    The array of unique input types and values that are accepted by the shape.

    isAsync: boolean

    true if the shape allows only Shape.parseAsync and throws an error if Shape.parse is called, or false if the shape can be used in both sync and async contexts.

    operations: readonly Operation[] = []

    The array of operations that are applied to the shape output.

    Methods

    • Returns input types and literal values that this shape can accept as an input.

      Returns readonly unknown[]

    • Must return true if the shape must be used in async context only, otherwise the shape can be used in both sync and async contexts. Override this method to implement a custom shape.

      Returns boolean

    • Returns true if the shape accepts given input type or value, or false otherwise.

      Parameters

      • input: unknown

        The type or value that must be checked.

      Returns boolean

    • Adds annotations to the shape.

      Parameters

      • annotations: ReadonlyDict

        Annotations to add.

      Returns this

      The clone of the shape with the updated annotations.

    • Returns a sub-shape that describes a value associated with the given property name, or null if there's no such sub-shape.

      Parameters

      • _key: unknown

        The key for which the sub-shape must be retrieved.

      Returns null | AnyShape

      The sub-shape or null if there's no such key in the shape.

    • Synchronously parses the value.

      Parameters

      • input: unknown

        The value to parse.

      • Optionaloptions: ParseOptions

        Parsing options.

      Returns ExcludeLiteral

      The value that conforms the output type of the shape.

      Error if the shape doesn't support the sync parsing, see Shape.isAsync.

      ValidationError if any issues occur during parsing.