Files
starface-outlook-sync-addin/node_modules/@griffel/core/renderer/safeInsertRule.cjs.js
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

27 lines
919 B
JavaScript

'use strict';
/**
* Suffixes to be ignored in case of error
*/
const ignoreSuffixes = /*#__PURE__*/['-moz-placeholder', '-moz-focus-inner', '-moz-focusring', '-ms-input-placeholder', '-moz-read-write', '-moz-read-only'].join('|');
const ignoreSuffixesRegex = /*#__PURE__*/new RegExp(`:(${ignoreSuffixes})`);
/**
* @internal
*
* Calls `sheet.insertRule` and catches errors related to browser prefixes.
*/
function safeInsertRule(sheet, ruleCSS) {
try {
sheet.insertRule(ruleCSS);
} catch (e) {
// We've disabled these warnings due to false-positive errors with browser prefixes
if (process.env.NODE_ENV !== 'production' && !ignoreSuffixesRegex.test(ruleCSS)) {
// eslint-disable-next-line no-console
console.error(`There was a problem inserting the following rule: "${ruleCSS}"`, e);
}
}
}
exports.safeInsertRule = safeInsertRule;
//# sourceMappingURL=safeInsertRule.cjs.js.map