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