UNPKG

@thisisagile/easy

Version:

Straightforward library for building domain-driven microservice architectures

8 lines (5 loc) 295 B
import { isIn } from './Is'; export type Primitive = string | number | bigint | boolean | symbol | null | undefined; export const isPrimitive = (v?: unknown): v is Primitive => { return v === null || v === undefined || isIn(typeof v, ['string', 'number', 'bigint', 'boolean', 'symbol']); };