Assert that a type resolves to a JavaScript primitive type.
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 Copy
type A = AssertPrimitive< string >; // ✓type B = AssertPrimitive< {} >; // ✗ TS error
Assert that a type resolves to a JavaScript primitive type.