(self: string): stringConverts a PascalCase string to snake_case.
Example (Converting PascalCase to snake_case)
import { String } from "effect"
console.log(String.pascalToSnake("HelloWorld")) // "hello_world"
console.log(String.pascalToSnake("FooBarBaz")) // "foo_bar_baz"transforming
Source effect/String.ts:11462 lines
export const const pascalToSnake: (
self: string
) => string
Converts a PascalCase string to snake_case.
Example (Converting PascalCase to snake_case)
import { String } from "effect"
console.log(String.pascalToSnake("HelloWorld")) // "hello_world"
console.log(String.pascalToSnake("FooBarBaz")) // "foo_bar_baz"
pascalToSnake = (self: stringself: string): string =>
(self: stringself.String.slice(start?: number, end?: number): stringReturns a section of a string.
slice(0, 1) + self: stringself.String.slice(start?: number, end?: number): stringReturns a section of a string.
slice(1).String.replace(searchValue: {
[Symbol.replace](string: string, replaceValue: string): string;
}, replaceValue: string): string (+3 overloads)
Passes a string and
{@linkcode
replaceValue
}
to the [Symbol.replace] method on
{@linkcode
searchValue
}
. This method is expected to implement its own replacement algorithm.
replace(/([A-Z])/g, "_$1")).String.toLowerCase(): stringConverts all the alphabetic characters in a string to lowercase.
toLowerCase()