UNPKG

is-constructor

Version:

Check if a value is a constructor function

2 lines (1 loc) 337 B
"use strict";function r(t){if(typeof t!="function"||!t.prototype||t.prototype.constructor!==t)return!1;if(/^class\s/.test(Function.prototype.toString.call(t)))return!0;try{return Reflect.construct(String,[],t),!0}catch{return!1}}typeof module<"u"&&typeof module.exports<"u"&&(module.exports=r,module.exports.default=r);module.exports=r;