devtypes - v2.0.0
    Preparing search index...

    Type Alias AssertPrimitive<T>

    AssertPrimitive: T

    Assert that a type resolves to a JavaScript primitive type.

    Type Parameters

    • T extends Primitive

      Type that must be a primitive

    Produces a compiler error if the provided type does not belong to these types: string | number | boolean | symbol | null | undefined

    type A = AssertPrimitive< string >;  // ✓
    type B = AssertPrimitive< {} >; // ✗ TS error