mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 06:03:22 +08:00
refactoring
This commit is contained in:
parent
0d7ce1c9d6
commit
4004ec0ad5
7
packages/core/src/utilities/isClass.ts
Normal file
7
packages/core/src/utilities/isClass.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export default function isClass(item: any): boolean {
|
||||
if (item.constructor?.toString().substring(0, 5) !== 'class') {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user