15 lines
347 B
JavaScript
15 lines
347 B
JavaScript
function toPascalCase(string) {
|
|
return string.replace(/\p{L}+/gu, function (w) {
|
|
return (
|
|
w[0].toLocaleUpperCase("fr-FR") + w.slice(1).toLocaleLowerCase("fr-FR")
|
|
);
|
|
});
|
|
}
|
|
|
|
function urlToPath(url) {
|
|
return url.replace(window.location.origin, "");
|
|
}
|
|
|
|
const StringUtils = { toPascalCase, urlToPath };
|
|
|
|
export default StringUtils;
|