2024-10-08 17:29:59 +02:00
|
|
|
function toPascalCase(string) {
|
|
|
|
|
return string.replace(/\p{L}+/gu, function (w) {
|
|
|
|
|
return (
|
|
|
|
|
w[0].toLocaleUpperCase("fr-FR") + w.slice(1).toLocaleLowerCase("fr-FR")
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-19 10:32:48 +01:00
|
|
|
function urlToPath(url) {
|
|
|
|
|
return url.replace(window.location.origin, "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const StringUtils = { toPascalCase, urlToPath };
|
2024-10-14 18:00:39 +02:00
|
|
|
|
|
|
|
|
export default StringUtils;
|