initial implementation of terranix for zitadel. SUPER HAPPY, SUPER COOL!!!
Some checks failed
Test action / kaas (push) Failing after 1s

This commit is contained in:
Chris Kruining 2025-10-22 23:26:47 +02:00
parent 81e1574023
commit 1873bb7170
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
5 changed files with 368 additions and 31 deletions

17
lib/strings/default.nix Normal file
View file

@ -0,0 +1,17 @@
{ lib, ...}:
let
inherit (builtins) isString typeOf;
inherit (lib) throwIfNot concatStringsSep splitStringBy toLower map;
in
{
strings = {
toSnakeCase =
str:
throwIfNot (isString str) "toSnakeCase only accepts string values, but got ${typeOf str}" (
str
|> splitStringBy (prev: curr: builtins.match "[a-z]" prev != null && builtins.match "[A-Z]" curr != null) true
|> map (p: toLower p)
|> concatStringsSep "_"
);
};
}