(self: string): stringConverts a string to CONFIG_CASE (uppercase with underscores) for configuration keys.
When to use
Use to normalize configuration path segments into environment-variable-like
keys while preserving numeric word groups such as v2.
Details
Unlike constantCase, digit-letter boundaries are not split. For
example, "api-v2 xml" becomes "API_V2_XML".
export const const configCase: (self: string) => stringConverts a string to CONFIG_CASE (uppercase with underscores) for
configuration keys.
When to use
Use to normalize configuration path segments into environment-variable-like
keys while preserving numeric word groups such as v2.
Details
Unlike
constantCase
, digit-letter boundaries are not split. For
example, "api-v2 xml" becomes "API_V2_XML".
configCase: (self: stringself: string) => string = (self: stringself) =>
const normalizeCase: (
input: string,
splitRegExp: ReadonlyArray<RegExp>,
stripRegExp: RegExp,
delimiter: string,
transform: (
part: string,
index: number,
parts: ReadonlyArray<string>
) => string
) => string
normalizeCase(self: stringself, const CONFIG_SPLIT_REGEXP: RegExp[]CONFIG_SPLIT_REGEXP, const STRIP_REGEXP: RegExpSTRIP_REGEXP, "_", const toUpperCase: <S extends string>(
self: S
) => Uppercase<S>
Converts a string to uppercase.
Example (Converting strings to uppercase)
import { pipe, String } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(pipe("a", String.toUpperCase), "A")
assert.deepStrictEqual(String.toUpperCase("hello"), "HELLO")
toUpperCase)