Ts.Assert.parameters.equiv
Import
import { Ts } from '@wollybeard/kit'
// Access via namespace
Ts.Assert.parameters.equivimport { equiv } from '@wollybeard/kit/ts'Functions
[F] noExcessAs
<$Type>(): DispatchAfterInput<State.SetExpectedType<State.SetRelator<State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>, EquivNoExcessKind>, $Type>>[F] ofAs
<$Type>(): DispatchAfterInput<State.SetExpectedType<State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>, $Type>>Constants
[C] any
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetAllowAny<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>
>,
any
>
>[C] bigint
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
bigint
>
>[C] boolean
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
boolean
>
>[C] Date
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
Date
>
>[C] Error
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
Error
>
>[C] never
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetAllowNever<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>
>,
never
>
>[C] noExcess
InputExpectedAsValueNarrow<
State.SetRelator<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
EquivNoExcessKind
>
>[C] null
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
null
>
>[C] number
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
number
>
>[C] of
InputExpectedAsValueNarrow<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>
>[C] RegExp
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
RegExp
>
>[C] string
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
string
>
>[C] symbol
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
symbol
>
>[C] undefined
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>,
undefined
>
>[C] unknown
InputActualAsValueNarrow<
State.SetExpectedType<
State.SetAllowUnknown<
State.SetRelator<State.AddExtractor<State.Empty, Parameters$>, EquivKind>
>,
unknown
>
>Types
[T] any
type any_<$Actual> = Kind.Apply<
EquivKind,
[any, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for any. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.any<(...args: any[]) => any>
// ✗ Fail
type _ = Assert.parameters.equiv.any<(...args: any[]) => string>[T] bigint
type bigint_<$Actual> = Kind.Apply<
EquivKind,
[bigint, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for bigint. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.bigint<(...args: any[]) => bigint>
// ✗ Fail
type _ = Assert.parameters.equiv.bigint<(...args: any[]) => string>[T] boolean
type boolean_<$Actual> = Kind.Apply<
EquivKind,
[boolean, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for boolean. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.boolean<(...args: any[]) => boolean>
// ✗ Fail
type _ = Assert.parameters.equiv.boolean<(...args: any[]) => string>[T] Date
type Date_<$Actual> = Kind.Apply<
EquivKind,
[Date, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for Date. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.Date<(...args: any[]) => Date>
// ✗ Fail
type _ = Assert.parameters.equiv.Date<(...args: any[]) => string>[T] Error
type Error_<$Actual> = Kind.Apply<
EquivKind,
[Error, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for Error. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.Error<(...args: any[]) => Error>
// ✗ Fail
type _ = Assert.parameters.equiv.Error<(...args: any[]) => string>[T] never
type never_<$Actual> = Kind.Apply<
EquivKind,
[never, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for never. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.never<(...args: any[]) => never>
// ✗ Fail
type _ = Assert.parameters.equiv.never<(...args: any[]) => string>[T] noExcess
type noExcess_<$Expected, $Actual> = Kind.Apply<
EquivNoExcessKind,
[$Expected, Kind.Apply<Path.Parameters$, [$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, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for null. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.null<(...args: any[]) => null>
// ✗ Fail
type _ = Assert.parameters.equiv.null<(...args: any[]) => string>[T] number
type number_<$Actual> = Kind.Apply<
EquivKind,
[number, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for number. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.number<(...args: any[]) => number>
// ✗ Fail
type _ = Assert.parameters.equiv.number<(...args: any[]) => string>[T] of
type of_<$Expected, $Actual> = Kind.Apply<
EquivKind,
[$Expected, Kind.Apply<Path.Parameters$, [$Actual]>]
>parameters + equiv relation matchers.
Extraction: extracts the parameters tuple from a function Relation: mutual assignability (equivalent types)
[T] RegExp
type RegExp_<$Actual> = Kind.Apply<
EquivKind,
[RegExp, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for RegExp. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.RegExp<(...args: any[]) => RegExp>
// ✗ Fail
type _ = Assert.parameters.equiv.RegExp<(...args: any[]) => string>[T] string
type string_<$Actual> = Kind.Apply<
EquivKind,
[string, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for string. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.string<(...args: any[]) => string>
// ✗ Fail
type _ = Assert.parameters.equiv.string<(...args: any[]) => number>[T] symbol
type symbol_<$Actual> = Kind.Apply<
EquivKind,
[symbol, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for symbol. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.symbol<(...args: any[]) => symbol>
// ✗ Fail
type _ = Assert.parameters.equiv.symbol<(...args: any[]) => string>[T] undefined
type undefined_<$Actual> = Kind.Apply<
EquivKind,
[undefined, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for undefined. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.undefined<(...args: any[]) => undefined>
// ✗ Fail
type _ = Assert.parameters.equiv.undefined<(...args: any[]) => string>[T] unknown
type unknown_<$Actual> = Kind.Apply<
EquivKind,
[unknown, Kind.Apply<Path.Parameters$, [$Actual]>]
>Pre-curried matcher for unknown. Extraction chain: (...args: any[]) = T → Parameters
Examples:
// ✓ Pass
type _ = Assert.parameters.equiv.unknown<(...args: any[]) => unknown>
// ✗ Fail
type _ = Assert.parameters.equiv.unknown<(...args: any[]) => string>