UNPKG

tiny-types

Version:

A tiny library that brings Tiny Types to JavaScript and TypeScript

23 lines 709 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isPlainObject = isPlainObject; const objects_1 = require("../objects"); const Predicate_1 = require("./Predicate"); /** * @desc * Ensures that the `value` is a plain {@link Object}. * Based on Jon Schlinkert's implementation. * * @see https://github.com/jonschlinkert/is-plain-object * * @example * import { ensure, isPlainObject } from 'tiny-types'; * * ensure('plain object', {}, isPlainObject()); * * @returns {Predicate<string>} */ function isPlainObject() { return Predicate_1.Predicate.to(`be a plain object`, (value) => (0, objects_1.isRecord)(value)); } //# sourceMappingURL=isPlainObject.js.map