import { KebabCase } from "type-fest"; //#region src/functions/kebabCase/kebabCase.d.ts /** * Changes the casing of a string to kebab case. * @param string The input string to change the casing of. * @returns A new string with the casing changed to kebab case. * @example * ```ts * kebabCase('fooBar') // 'foo-bar' * kebabCase('foo bar') // 'foo-bar' * kebabCase('foo-bar') // 'foo-bar' * kebabCase('fooBar42') // 'foo-bar42' * ``` */ declare function kebabCase(string: S): KebabCase$1; /** * Changes the casing of a string to kebab case. * @see {@link kebabCase}. */ type KebabCase$1 = TrimDashes>>; /** * Reduces multiple dashes to a single dash. * @param S The input string. * @returns A new string with multiple dashes reduced to a single dash. * @example * ```ts * ReduceDashes<'foo--bar'> // 'foo-bar' * ReduceDashes<'foo-bar'> // 'foo-bar' * ReduceDashes<'foo---bar'> // 'foo-bar' * ``` */ type ReduceDashes = S extends `${infer L}--${infer R}` ? ReduceDashes<`${L}-${R}`> : S extends `${infer L}${infer D}--${infer R}` ? ReduceDashes<`${L}${D}-${R}`> : S; /** * Trims dashes from the start and end of a string. * @param S The input string. * @returns A new string with dashes trimmed from the start and end. * @example * ```ts * TrimDashes<'-foo-bar-'> // 'foo-bar' * TrimDashes<'foo-bar-'> // 'foo-bar' * TrimDashes<'-foo-bar'> // 'foo-bar' * TrimDashes<'foo-bar'> // 'foo-bar' * ``` */ type TrimDashes = S extends `-${infer R}` ? TrimDashes : S extends `${infer L}-` ? TrimDashes : S; //#endregion export { kebabCase as n, KebabCase$1 as t }; //# sourceMappingURL=kebabCase-BWqPXMg8.d.ts.map