@metreeca/blue - v0.12.0
    Preparing search index...

    Function boolean

    Creates a boolean shape.

    • Creates a boolean shape.

      Admits true and false and nothing else, closed to the single enumerated value where the constraints state one; the domain is closed by the kind alone, so the constraints cannot be contradictory.

      Type Parameters

      Parameters

      Returns BooleanShape<{ inferred from <C> }>

      An immutable shape admitting truth values, narrowed to the value the constraints enumerate

    • Creates a boolean shape admitting a single value.

      Reads a bare truth value as the enumeration closing the domain to it, so that a tag telling the alternatives of a union apart is stated as boolean(true) rather than as boolean({ in: true }).

      Type Parameters

      • const V extends boolean

        The value the shape admits

      Parameters

      • value: V

        The single admitted truth value

      Returns BooleanShape<V>

      An immutable shape admitting value alone