Commit 86c42fd0 authored by nanahira's avatar nanahira

fix

parent 72acb9bc
Pipeline #7366 passed with stages
in 44 seconds
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
"scripts": { "scripts": {
"lint": "eslint --fix .", "lint": "eslint --fix .",
"build": "tsc" "build": "tsc",
"test": "jest"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
......
...@@ -2,10 +2,10 @@ export function isClass(target: any) { ...@@ -2,10 +2,10 @@ export function isClass(target: any) {
if (typeof target !== 'function') { if (typeof target !== 'function') {
return false; return false;
} }
const proto = target.prototype; const proto = target.constructor;
return proto !== Function && proto !== Object; return proto === Function;
} }
export function getClass(target: any): 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