UNPKG

charlike

Version:

Small, fast, simple and streaming project scaffolder for myself, but not only. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options

21 lines (17 loc) 574 B
'use strict'; var getPrototypeOf = Object.getPrototypeOf, prototype = Object.prototype , toString = prototype.toString , id = Object().toString(); module.exports = function (value) { var proto, constructor; if (!value || (typeof value !== 'object') || (toString.call(value) !== id)) { return false; } proto = getPrototypeOf(value); if (proto === null) { constructor = value.constructor; if (typeof constructor !== 'function') return true; return (constructor.prototype !== value); } return (proto === prototype) || (getPrototypeOf(proto) === null); };