UNPKG

207 BJavaScriptView Raw
1/**
2 * Returns true if `x` is a string, number or boolean.
3 *
4 * @param x -
5 */
6export const isPrimitive = (x) => {
7 const t = typeof x;
8 return t === "string" || t === "number" || t === "boolean";
9};