UNPKG

payload-is

Version:

A comprehensive TypeScript/JavaScript type checking library providing functions to check data types, collections, primitives, and built-in objects

9 lines (6 loc) 249 B
// primitive import type { PrimitiveType } from "./type.ts"; export function isPrimitive(payload: unknown): payload is PrimitiveType { const result = typeof payload; return payload === null || (result !== "object" && result !== "function"); }