styling.ts: Avoir errors when calling capitalise on 0-length strings

This commit is contained in:
glacambre 2018-06-15 07:15:39 +02:00
parent 3649f692d6
commit 96ebe82149
No known key found for this signature in database
GPG key ID: B9625DB1767553AC

View file

@ -8,6 +8,7 @@ const logger = new Logging.Logger("styling")
const THEMES = ["dark", "greenmat", "shydactyl", "quake"]
function capitalise(str) {
if (str === "") return str
return str[0].toUpperCase() + str.slice(1)
}