tiptap/packages/core/src/utilities/isObject.ts

20 lines
303 B
TypeScript
Raw Normal View History

2021-01-20 16:18:49 +08:00
export default function isObject(item: any): boolean {
2021-01-20 22:10:30 +08:00
if (!item) {
return false
}
if (typeof item !== 'object') {
return false
}
if (Array.isArray(item)) {
return false
}
if (item.constructor?.toString().substring(0, 5) === 'class') {
return false
}
return true
2021-01-20 16:18:49 +08:00
}