Ts.Assert.sub
Import
import { Ts } from '@wollybeard/kit'
// Access via namespace
Ts.Assert.subimport { sub } from '@wollybeard/kit/ts'Functions
[F] noExcessAs
<$Type>(): DispatchAfterInput<State.SetExpectedType<State.SetRelator<State.SetRelator<State.Empty, SubKind>, SubNoExcessKind>, $Type>>[F] ofAs
<$Type>(): DispatchAfterInput<State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, $Type>>Constants
[C] any
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetAllowAny<State.SetRelator<State.Empty, SubKind>>,
any
>
>[C] bigint
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, bigint>
>[C] boolean
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, boolean>
>[C] Date
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, Date>
>[C] Error
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, Error>
>[C] false
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, false>
>[C] never
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetAllowNever<State.SetRelator<State.Empty, SubKind>>,
never
>
>[C] noExcess
InputExpectedAsValueNarrow<
State.SetRelator<State.SetRelator<State.Empty, SubKind>, SubNoExcessKind>
>[C] null
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, null>
>[C] number
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, number>
>[C] of
InputExpectedAsValueNarrow<State.SetRelator<State.Empty, SubKind>>[C] RegExp
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, RegExp>
>[C] string
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, string>
>[C] symbol
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, symbol>
>[C] true
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, true>
>[C] undefined
InputActualAsValueNarrow<
State.SetExpectedType<State.SetRelator<State.Empty, SubKind>, undefined>
>[C] unknown
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetAllowUnknown<State.SetRelator<State.Empty, SubKind>>,
unknown
>
>Types
[T] any
type any_<$Actual> = Kind.Apply<SubKind, [any, $Actual]>Pre-curried matcher for any.
Examples:
// ✓ Pass
type _ = Assert.sub.any<any>
// ✗ Fail
type _ = Assert.sub.any<string>[T] bigint
type bigint_<$Actual> = Kind.Apply<SubKind, [bigint, $Actual]>Pre-curried matcher for bigint.
Examples:
// ✓ Pass
type _ = Assert.sub.bigint<bigint>
// ✗ Fail
type _ = Assert.sub.bigint<string>[T] boolean
type boolean_<$Actual> = Kind.Apply<SubKind, [boolean, $Actual]>Pre-curried matcher for boolean.
Examples:
// ✓ Pass
type _ = Assert.sub.boolean<boolean>
// ✗ Fail
type _ = Assert.sub.boolean<string>[T] Date
type Date_<$Actual> = Kind.Apply<SubKind, [Date, $Actual]>Pre-curried matcher for Date.
Examples:
// ✓ Pass
type _ = Assert.sub.Date<Date>
// ✗ Fail
type _ = Assert.sub.Date<string>[T] Error
type Error_<$Actual> = Kind.Apply<SubKind, [Error, $Actual]>Pre-curried matcher for Error.
Examples:
// ✓ Pass
type _ = Assert.sub.Error<Error>
// ✗ Fail
type _ = Assert.sub.Error<string>[T] false
type false_<$Actual> = Kind.Apply<SubKind, [false, $Actual]>Pre-curried matcher for false literal.
Examples:
// ✓ Pass
type _ = Assert.sub.false<false>
// ✗ Fail
type _ = Assert.sub.false<true>[T] never
type never_<$Actual> = Kind.Apply<SubKind, [never, $Actual]>Pre-curried matcher for never.
Examples:
// ✓ Pass
type _ = Assert.sub.never<never>
// ✗ Fail
type _ = Assert.sub.never<string>[T] noExcess
type noExcess_<$Expected, $Actual> = Kind.Apply<
SubNoExcessKind,
[$Expected, $Actual]
>No-excess variant of sub relation. Checks that actual has no excess properties beyond expected.
[T] null
type null_<$Actual> = Kind.Apply<SubKind, [null, $Actual]>Pre-curried matcher for null.
Examples:
// ✓ Pass
type _ = Assert.sub.null<null>
// ✗ Fail
type _ = Assert.sub.null<string>[T] number
type number_<$Actual> = Kind.Apply<SubKind, [number, $Actual]>Pre-curried matcher for number.
Examples:
// ✓ Pass
type _ = Assert.sub.number<number>
// ✗ Fail
type _ = Assert.sub.number<string>[T] of
type of_<$Expected, $Actual> = Kind.Apply<SubKind, [$Expected, $Actual]>base + sub relation matchers.
Direct type assertion Relation: subtype relation (extends)
[T] RegExp
type RegExp_<$Actual> = Kind.Apply<SubKind, [RegExp, $Actual]>Pre-curried matcher for RegExp.
Examples:
// ✓ Pass
type _ = Assert.sub.RegExp<RegExp>
// ✗ Fail
type _ = Assert.sub.RegExp<string>[T] string
type string_<$Actual> = Kind.Apply<SubKind, [string, $Actual]>Pre-curried matcher for string.
Examples:
// ✓ Pass
type _ = Assert.sub.string<string>
// ✗ Fail
type _ = Assert.sub.string<number>[T] symbol
type symbol_<$Actual> = Kind.Apply<SubKind, [symbol, $Actual]>Pre-curried matcher for symbol.
Examples:
// ✓ Pass
type _ = Assert.sub.symbol<symbol>
// ✗ Fail
type _ = Assert.sub.symbol<string>[T] true
type true_<$Actual> = Kind.Apply<SubKind, [true, $Actual]>Pre-curried matcher for true literal.
Examples:
// ✓ Pass
type _ = Assert.sub.true<true>
// ✗ Fail
type _ = Assert.sub.true<false>[T] undefined
type undefined_<$Actual> = Kind.Apply<SubKind, [undefined, $Actual]>Pre-curried matcher for undefined.
Examples:
// ✓ Pass
type _ = Assert.sub.undefined<undefined>
// ✗ Fail
type _ = Assert.sub.undefined<string>[T] unknown
type unknown_<$Actual> = Kind.Apply<SubKind, [unknown, $Actual]>Pre-curried matcher for unknown.
Examples:
// ✓ Pass
type _ = Assert.sub.unknown<unknown>
// ✗ Fail
type _ = Assert.sub.unknown<string>