UNPKG

object-shape-tester

Version:
11 lines (10 loc) 307 B
import { Symbol } from '@sinclair/typebox'; import { unionShape } from './union.shape.js'; /** * Creates a shape that only allows primitive values. * * @category Shape */ export function primitiveShape(defaultValue) { return unionShape(defaultValue, '', -1, 0n, false, Symbol(), null, undefined); }