/** * Case Conversion Utilities * * Canonical implementations of string case conversion functions * shared across the monorepo. All packages should import from * @fjall/util rather than maintaining local copies. */ /** * Convert hyphenated/underscored names to PascalCase. * e.g., "my-app" -> "MyApp", "my_app" -> "MyApp" */ export declare function toPascalCase(str: string): string; /** * Convert any case (PascalCase, camelCase, kebab-case, snake_case) to kebab-case. * Three-pass regex: split acronyms, split camel boundaries, replace separators. * e.g., "MyApp" -> "my-app", "AWSLambda" -> "aws-lambda", "myApp" -> "my-app" */ export declare function toKebab(str: string): string; /** * Convert a name to a valid RDS database name (snake_case). * RDS API allows letters, numbers, and underscores for PostgreSQL/MySQL DatabaseName. * Hyphens are rejected, so convert them to underscores. */ export declare function toValidDatabaseName(name: string): string; /** * Convert any case (PascalCase, camelCase, kebab-case, snake_case) to * SCREAMING_SNAKE_CASE. Used for environment-variable name derivation. * e.g., "MyApp" -> "MY_APP", "data-platform" -> "DATA_PLATFORM". */ export declare function toScreamingSnake(str: string): string; /** * Capitalise the first character of a string. */ export declare function capitalise(str: string): string; /** * Strip dots from a zone name to produce a safe string for construct IDs. * e.g., "example.com" -> "examplecom" */ export declare function getSafeZoneName(zoneName: string): string; /** * Normalise an account name to its canonical construct key: lowercase with every * non-alphanumeric character stripped. Single source of truth for case- and * separator-insensitive account identity; matched to the SQL expression in the * `ConnectedAwsAccount_org_normalised_name_unique` functional unique index — the two * MUST move together. * * The two normalisers are identical **for ASCII input**, where JS `toLowerCase()` * and PostgreSQL `lower()` agree regardless of collation. They are NOT guaranteed * identical for non-ASCII input: `lower()` depends on the database `lc_ctype` / * collation provider. Empirically (PG 17, 2026-05-30) the deployed RDS default * (`en_US.UTF-8`, libc provider) agrees with JS on every tested candidate, but the * `C`/`POSIX` locale diverges — e.g. Turkish dotted `İ` (U+0130) folds to `i` in JS * but is left intact (then stripped) by `lower()` under `C`. Use * `hasAsciiStableConstructKey` at write boundaries to keep the two engines in * lock-step regardless of the deployed collation. * * Pure — never throws; empty-key rejection lives in the consumers. * e.g., "My-Prod" -> "myprod", "My Prod" -> "myprod", "Production" -> "production" */ export declare function accountConstructKey(name: string): string; /** * True when an account name's construct key is drawn only from ASCII alphanumerics — * i.e. JS `toLowerCase()` and SQL `lower()` are guaranteed to produce the same key * regardless of the database collation, so the `@fjall/util` normaliser and the * `ConnectedAwsAccount_org_normalised_name_unique` SQL index cannot diverge on this * name. Also rejects names whose construct key is empty. * * Rejects only genuinely divergent names (e.g. Kelvin sign U+212A or Turkish `İ` as * the sole alnum source) — names like "Café-Prod" still pass, because the `é` is * stripped identically by `[^a-z0-9]` on both sides * (`accountConstructKey("Café-Prod") === "cafprod"`). */ export declare function hasAsciiStableConstructKey(name: string): boolean;