Skip to content

Commit 5db7919

Browse files
committed
Add regex explanations
1 parent 601eba8 commit 5db7919

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/host/app/components/operator-mode/create-file-modal.gts

+3
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,10 @@ export class ${className} extends ${exportName} {
725725
}
726726

727727
function convertToClassName(input) {
728+
// \p{L}: a letter
728729
let invalidLeadingCharactersRemoved = input.replace(/^[^\p{L}_$]+/u, '');
730+
731+
// \p{N}: a number
729732
let invalidCharactersRemoved = invalidLeadingCharactersRemoved.replace(
730733
/[^\p{L}\p{N}_$]+/gu,
731734
'',

0 commit comments

Comments
 (0)