//#region src/functions/startCase/startCase.d.ts /** * Converts a string to start case (first letter of each word capitalized, joined by spaces). * @param string The input string to convert to start case. * @returns A new string converted to start case. * @example * ```ts * startCase('--foo-bar--') // 'Foo Bar' * startCase('fooBar') // 'Foo Bar' * startCase('__FOO_BAR__') // 'FOO BAR' * ``` */ declare function startCase(string: S): StartCase; type IsUpperLetter = C extends Uppercase ? (C extends Lowercase ? false : true) : false; type TrimTrailingSpaces = S extends `${infer L} ` ? TrimTrailingSpaces : S; type StartCaseImpl = S extends `${infer C}${infer Rest}` ? C extends '-' | '_' | ' ' ? `${AtWordStart extends true ? '' : ' '}${StartCaseImpl}` : AtWordStart extends true ? `${Uppercase}${StartCaseImpl, false>}` : IsUpperLetter extends true ? PrevIsUpper extends true ? Rest extends `${infer Next}${string}` ? Next extends '-' | '_' | ' ' ? `${C}${StartCaseImpl}` : IsUpperLetter extends true ? `${C}${StartCaseImpl}` : ` ${C}${StartCaseImpl}` : `${C}${StartCaseImpl}` : ` ${C}${StartCaseImpl}` : `${C}${StartCaseImpl}` : ''; /** * Converts a string to start case at the type level. * @see {@link startCase}. */ type StartCase = TrimTrailingSpaces>; //#endregion export { startCase as n, StartCase as t }; //# sourceMappingURL=startCase-CcCLrLny.d.cts.map