edit panel remembering modifications in other tabs

This commit is contained in:
isUnknown 2024-10-14 18:00:39 +02:00
parent d197447ad6
commit 9df71b4949
9 changed files with 133 additions and 79 deletions

13
src/utils/array.js Normal file
View file

@ -0,0 +1,13 @@
function toggle(array, element) {
const index = array.indexOf(element);
if (index === -1) {
array.push(element);
} else {
array.splice(index, 1);
}
}
const ArrayUtils = { toggle };
export default ArrayUtils;

11
src/utils/string.js Normal file
View file

@ -0,0 +1,11 @@
function toPascalCase(string) {
return string.replace(/\p{L}+/gu, function (w) {
return (
w[0].toLocaleUpperCase("fr-FR") + w.slice(1).toLocaleLowerCase("fr-FR")
);
});
}
const StringUtils = { toPascalCase };
export default StringUtils;