Skip to content

Commit

Permalink
do not accept special characters in palette key
Browse files Browse the repository at this point in the history
  • Loading branch information
AprilSylph committed Feb 22, 2022
1 parent 192b905 commit 4784fb9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/options/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const dateTimeFormat = new Intl.DateTimeFormat(undefined, {
});

const toCamelCase = string => string
.replace(/\W/g, ' ')
.replace(/\s+\D/g, match => match.trim().toUpperCase())
.replace(/\s+/g, '')
.replace(/^[A-Z]/, match => match.toLowerCase())
Expand Down

0 comments on commit 4784fb9

Please sign in to comment.