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

12 lines
314 B
TypeScript
Raw Normal View History

2020-11-30 16:21:31 +08:00
/**
* Check if object1 includes object2
* @param object1 Object
* @param object2 Object
*/
export default function objectIncludes(object1: { [key: string ]: any }, object2: { [key: string ]: any }): boolean {
return !!Object
.keys(object2)
.filter(key => object2[key] === object1[key])
.length
}