lib: add upperFirstChar

A util function to capitalize the first character of a string.
This commit is contained in:
Matt Sturgeon 2024-03-17 15:40:10 +00:00
parent 36f2e51b28
commit c16533b3f7
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 42 additions and 0 deletions

View file

@ -113,6 +113,23 @@ let
};
expected = ''{["c"] = { },["d"] = {["g"] = { }}}'';
};
testUpperFirstChar = {
expr = map helpers.upperFirstChar [
"foo"
" foo"
"foo bar"
"UPPER"
"mIxEd"
];
expected = [
"Foo"
" foo"
"Foo bar"
"UPPER"
"MIxEd"
];
};
};
in
if results == [ ] then