[FIX] web: regex syntax unsupported by Webkit

Positive Lookbehind regex syntax is currently not supported yet by
Webkit, and thus Safari (both on macOS and iOS) resulting into a crash
as the syntax is not recognized.

This issue affects both frontend and backend.

This commit fixes it by reimplementing the feature without using this
syntax.

closes odoo/odoo#112985

Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
This commit is contained in:
Pierre Paridans
2023-02-18 04:36:32 +01:00
parent ca56549d7a
commit ba7b9975c5
@@ -107,10 +107,7 @@ const elCache = {};
* @returns {string}
*/
function camelToKebab(str) {
return str.replaceAll(
/(?<=.)[A-Z]|[A-Z]/g,
(match, prev) => `${prev ? "-" : ""}${match.toLowerCase()}`
);
return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
}
/**