// package
is-primitive
type: "module"
// preferences
// replacements (1)
snippet::is-primitve
Simple or drop-in replacementThis package is no longer necessary. You can check `typeof` of a value to determine if it's a primitive. Note that `typeof null` is `"object"` so you need to check for `null` separately.
// example
const isPrimitive = (value) =>
value === null ||
(typeof value !== 'function' &&
typeof value !== 'object');