refactoring

This commit is contained in:
Philipp Kühn 2021-01-20 16:39:42 +01:00
parent 0d7ce1c9d6
commit 4004ec0ad5
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,7 @@
export default function isClass(item: any): boolean {
if (item.constructor?.toString().substring(0, 5) !== 'class') {
return false
}
return true
}

View File

@ -1,3 +1,5 @@
import isClass from './isClass'
export default function isObject(item: any): boolean {
if (!item) {
return false
@ -11,7 +13,7 @@ export default function isObject(item: any): boolean {
return false
}
if (item.constructor?.toString().substring(0, 5) === 'class') {
if (isClass(item)) {
return false
}