fix(server): config saving with layout that includes a dash (mart-e) (#5193)

* [FIX] Accept layout with dash

At least seht-drai and ergo-l is not compatible

* add regex

---------

Co-authored-by: Miodec <jack@monkeytype.com>
This commit is contained in:
Martin Trigaux 2024-03-11 20:17:10 +01:00 committed by GitHub
parent 9aeaa31d2c
commit 1bb0bdffb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,7 +77,11 @@ const CONFIG_SCHEMA = joi.object({
keymapLegendStyle: joi
.string()
.valid("lowercase", "uppercase", "blank", "dynamic"),
keymapLayout: joi.string().valid().max(50).token(),
keymapLayout: joi
.string()
.regex(/[\w-_]+/)
.valid()
.max(50),
keymapShowTopRow: joi.string().valid("always", "layout", "never"),
fontFamily: joi
.string()