@visulima/string
Version:
Functions for manipulating strings.
32 lines (31 loc) • 1.06 kB
TypeScript
import { b as CaseOptions, K as KebabCase } from "../packem_shared/types.d-fhe030jX.js";
import "../packem_shared/types.d-CmNvyl4l.js";
interface KebabCaseOptions extends CaseOptions {
/**
* String used to join words together in kebab case format.
* @default "-"
*/
joiner?: string;
/**
* Whether to convert the result to uppercase.
* @default false
*/
toUpperCase?: boolean;
}
/**
* Converts a string to kebab-case.
* @param value The string to convert to kebab-case.
* @param options Configuration options for kebab-case conversion.
* @returns The converted kebab-case string.
* @example
* ```typescript
* kebabCase("fooBar") // => "foo-bar"
* kebabCase("foo bar") // => "foo-bar"
* kebabCase("foo_bar") // => "foo-bar"
* kebabCase("XMLHttpRequest") // => "xml-http-request"
* kebabCase("AJAXRequest") // => "ajax-request"
* kebabCase("QueryXML123String") // => "query-xml-123-string"
* ```
*/
declare const kebabCase: <T extends string = string>(value?: T, options?: KebabCaseOptions) => KebabCase<T>;
export { KebabCaseOptions, kebabCase };