Skip to content

isPrimitive

@tsed/core

Usage ​

typescript
import { isPrimitive } from "@tsed/core";

See /packages/core/src/utils/isPrimitive.ts.

Overview ​

ts
function isPrimitive(target: any): boolean;

Description ​

Checks if a value is a primitive type (string, number, or boolean).

Constructors (String, Number, Boolean) and boxed values are not accepted. Use {@link isPrimitiveOrPrimitiveClass} to accept them.

Released under the MIT License.