(self: string): stringConverts a string to CONSTANT_CASE (uppercase with underscores).
When to use
Use to normalize words from mixed input formats into uppercase, underscore-separated identifiers.
Source effect/String.ts:13794 lines
export const const constantCase: (
self: string
) => string
Converts a string to CONSTANT_CASE (uppercase with underscores).
When to use
Use to normalize words from mixed input formats into uppercase,
underscore-separated identifiers.
constantCase: (self: stringself: string) => string = const noCase: (options?: {
readonly splitRegExp?: RegExp | ReadonlyArray<RegExp> | undefined;
readonly stripRegExp?: RegExp | ReadonlyArray<RegExp> | undefined;
readonly delimiter?: string | undefined;
readonly transform?: (part: string, index: number, parts: ReadonlyArray<string>) => string;
}) => (self: string) => string (+1 overload)
noCase({
delimiter?: string | undefineddelimiter: "_",
transform?: | ((
part: string,
index: number,
parts: ReadonlyArray<string>
) => string)
| undefined
transform: 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
})