testdouble
Version:
A minimal test double library for TDD with JavaScript
14 lines (13 loc) • 470 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_1 = require("../../wrap/lodash");
const is_generator_1 = require("../is-generator");
exports.default = (thing) => !(!lodash_1.default.isObject(thing) || isBoxedType(thing) || (0, is_generator_1.default)(thing));
const isBoxedType = (thing) => lodash_1.default.compact([
Boolean,
Date,
Number,
RegExp,
String,
Symbol
]).some(type => thing instanceof type);
;