Skip to content

Commit

Permalink
lib: add capitalize function
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Mar 13, 2024
1 parent df034a7 commit f1754ef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/module/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ with lib; rec {
enabled = { enable = true; };

disabled = { enable = false; };

capitalize = s:
let
len = stringLength s;
in
if len == 0 then "" else
(lib.toUpper (substring 0 1 s)) + (substring 1 len s);
}

0 comments on commit f1754ef

Please sign in to comment.