tiptap/packages/core/src/utils/getAllMethodNames.ts
2020-09-24 00:29:05 +02:00

11 lines
244 B
TypeScript

export default function getAllMethodNames(obj: Object) {
const methods = new Set()
while (obj = Reflect.getPrototypeOf(obj)) {
const keys = Reflect.ownKeys(obj)
keys.forEach(k => methods.add(k))
}
return Array.from(methods)
}