From 2d35cead1e39a8c56dbd320639eae920ab43273e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Fri, 22 Dec 2023 10:47:41 +0100 Subject: [PATCH] Show isCompatibilityMode only if supported --- index.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index fdee523..3e3d0fc 100644 --- a/index.js +++ b/index.js @@ -283,6 +283,16 @@ function parseAdapterInfo(adapterInfo) { ); } +function parseAdapterFlags(adapter) { + const flags = { + 'isFallbackAdapter': adapter.isFallbackAdapter, + }; + if ('isCompatibilityMode' in adapter) { + flags.isCompatibilityMode = adapter.isCompatibilityMode + } + return flags; +} + async function adapterToElements(adapter) { if (!adapter) { return; @@ -303,10 +313,7 @@ async function adapterToElements(adapter) { el('tr', {className: 'section'}, [ el('td', {colSpan: 2}, [createHeading('div', '-', 'flags:')]), ]), - ...mapLikeToTableRows({ - 'isFallbackAdapter': adapter.isFallbackAdapter, - 'isCompatibilityMode': adapter.isCompatibilityMode, - }), + ...mapLikeToTableRows(parseAdapterFlags(adapter)), limitsSectionElem, ...mapLikeToTableRows(markDifferencesInLimits(adapter)), el('tr', {className: 'section'}, [