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