Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 1x 1x 190x 1x 189x 189x 189x | import { getObjectKeys } from '../../domUtils/getObjectKeys';
import type { ContentModelFormatBase } from 'roosterjs-content-model-types';
/**
* Check if the two given formats object are equal. This is a check to value but not to reference
* @param f1 The first format object to check
* @param f2 The second format object to check
*/
export function areSameFormats<T extends ContentModelFormatBase>(f1: T, f2: T) {
if (f1 == f2) {
return true;
} else {
const keys1 = getObjectKeys(f1);
const keys2 = getObjectKeys(f2);
return keys1.length == keys2.length && keys1.every(key => f1[key] == f2[key]);
}
}
|