diff options
Diffstat (limited to 'util.nix')
| -rw-r--r-- | util.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/util.nix b/util.nix new file mode 100644 index 0000000..e783f3b --- /dev/null +++ b/util.nix @@ -0,0 +1,7 @@ +{ lib }: +{ + titleCase = str: with lib.strings; let + firstCharUpper = s: concatStrings [(toUpper (substring 0 1 s)) (substring 1 (stringLength s) s)]; + in + concatStringsSep " " (map firstCharUpper (splitString " " str)); +} |
