UNPKG

pragmatic-fp-ts

Version:

Opinionated functional programming library with easy use in mind

11 lines (9 loc) 334 B
import { isArray } from "./isArray.ts"; import { isFunction } from "./isFunction.ts"; import { isNotNil } from "./isNil.ts"; import { values } from "./values.ts"; export const isPlainObject = (x: unknown): boolean => isNotNil(x) && typeof x === "object" && !isArray(x) && values(x as any).every((prop) => !isFunction(prop));