Added optional padding for equal length.
This commit is contained in:
parent
224bfa19cd
commit
b5430858f4
|
@ -209,6 +209,7 @@
|
|||
.replace(/[^a-z0-9]/g, ' ')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim();
|
||||
// .padEnd(20, '#');
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
|
@ -222,7 +223,7 @@
|
|||
const decoded = base32.decode(codeInput.value);
|
||||
const capitalized = decoded.split(' ').map((word) => `${word.slice(0, 1).toUpperCase()}${word.slice(1)}`).join(' ');
|
||||
|
||||
nameOutput.value = capitalized;
|
||||
nameOutput.value = capitalized.replace(/#+$/, '');
|
||||
}
|
||||
|
||||
nameInput.addEventListener('input', () => getCode());
|
||||
|
|
Loading…
Reference in New Issue