Commit 86c42fd0 authored by nanahira's avatar nanahira

fix

parent 72acb9bc
Pipeline #7366 passed with stages
in 44 seconds
......@@ -6,7 +6,8 @@
"typings": "dist/index.d.ts",
"scripts": {
"lint": "eslint --fix .",
"build": "tsc"
"build": "tsc",
"test": "jest"
},
"repository": {
"type": "git",
......
......@@ -2,10 +2,10 @@ export function isClass(target: any) {
if (typeof target !== 'function') {
return false;
}
const proto = target.prototype;
return proto !== Function && proto !== Object;
const proto = target.constructor;
return proto === Function;
}
export function getClass(target: any): Function {
return isClass(target) ? target : target.constructor;
return isClass(target) ? target : getClass(target.constructor);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment