{
  "version": 3,
  "sources": ["../src/is-format-equal.js"],
  "sourcesContent": ["/** @typedef {import('./types').RichTextFormat} RichTextFormat */\n\n/**\n * Optimised equality check for format objects.\n *\n * @param {?RichTextFormat} format1 Format to compare.\n * @param {?RichTextFormat} format2 Format to compare.\n *\n * @return {boolean} True if formats are equal, false if not.\n */\nexport function isFormatEqual( format1, format2 ) {\n\t// Both not defined.\n\tif ( format1 === format2 ) {\n\t\treturn true;\n\t}\n\n\t// Either not defined.\n\tif ( ! format1 || ! format2 ) {\n\t\treturn false;\n\t}\n\n\tif ( format1.type !== format2.type ) {\n\t\treturn false;\n\t}\n\n\tconst attributes1 = format1.attributes;\n\tconst attributes2 = format2.attributes;\n\n\t// Both not defined.\n\tif ( attributes1 === attributes2 ) {\n\t\treturn true;\n\t}\n\n\t// Either not defined.\n\tif ( ! attributes1 || ! attributes2 ) {\n\t\treturn false;\n\t}\n\n\tconst keys1 = Object.keys( attributes1 );\n\tconst keys2 = Object.keys( attributes2 );\n\n\tif ( keys1.length !== keys2.length ) {\n\t\treturn false;\n\t}\n\n\tconst length = keys1.length;\n\n\t// Optimise for speed.\n\tfor ( let i = 0; i < length; i++ ) {\n\t\tconst name = keys1[ i ];\n\n\t\tif ( attributes1[ name ] !== attributes2[ name ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,SAAS,cAAe,SAAS,SAAU;AAEjD,MAAK,YAAY,SAAU;AAC1B,WAAO;AAAA,EACR;AAGA,MAAK,CAAE,WAAW,CAAE,SAAU;AAC7B,WAAO;AAAA,EACR;AAEA,MAAK,QAAQ,SAAS,QAAQ,MAAO;AACpC,WAAO;AAAA,EACR;AAEA,QAAM,cAAc,QAAQ;AAC5B,QAAM,cAAc,QAAQ;AAG5B,MAAK,gBAAgB,aAAc;AAClC,WAAO;AAAA,EACR;AAGA,MAAK,CAAE,eAAe,CAAE,aAAc;AACrC,WAAO;AAAA,EACR;AAEA,QAAM,QAAQ,OAAO,KAAM,WAAY;AACvC,QAAM,QAAQ,OAAO,KAAM,WAAY;AAEvC,MAAK,MAAM,WAAW,MAAM,QAAS;AACpC,WAAO;AAAA,EACR;AAEA,QAAM,SAAS,MAAM;AAGrB,WAAU,IAAI,GAAG,IAAI,QAAQ,KAAM;AAClC,UAAM,OAAO,MAAO,CAAE;AAEtB,QAAK,YAAa,IAAK,MAAM,YAAa,IAAK,GAAI;AAClD,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;",
  "names": []
}
