[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:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user