UNPKG

lakutata

Version:

An IoC-based universal application framework.

15 lines (9 loc) 448 B
const t = Object.prototype.toString; const o = Function.prototype.toString; const n = /^\[object .+?Constructor\]$/; const c = RegExp("^" + String(t).replace(/[.*+?^${}()|[\]\/\\]/g, "\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); function e(e) { const r = typeof e; return r == "function" ? c.test(o.call(e)) : e && r == "object" && n.test(t.call(e)) || false; } export { e as IsNativeFunction };