tiptap/packages/core/src/utils/getAllMethodNames.ts

10 lines
241 B
TypeScript
Raw Normal View History

2020-03-30 02:36:57 +08:00
export default function getAllMethodNames(obj: Object) {
let methods = new Set()
while (obj = Reflect.getPrototypeOf(obj)) {
let keys = Reflect.ownKeys(obj)
keys.forEach((k) => methods.add(k))
}
return Array.from(methods)
}