edit panel remembering modifications in other tabs
This commit is contained in:
parent
d197447ad6
commit
9df71b4949
9 changed files with 133 additions and 79 deletions
13
src/utils/array.js
Normal file
13
src/utils/array.js
Normal 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
11
src/utils/string.js
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue