UNPKG

@puq/names

Version:

The library provides a useful function to create all casing variants of a given string value such as title-case, pascal-case, snake-case and so more.

21 lines 1.17 kB
export declare const VALID_NAME_EXP: () => RegExp; export declare const HAS_UPPER_CASE_EXP: () => RegExp; export declare const HAS_LOWER_CASE_EXP: () => RegExp; export declare const HAS_UNDER_SCORE_EXP: () => RegExp; export declare const HAS_DASH_EXP: () => RegExp; export declare function isValidName(name: string): boolean; export declare function isValidNameOrThrow<T extends string>(name: T | never): name is T; export declare function hasUpperCase(name: string): boolean; export declare function hasLowerCase(name: string): boolean; export declare function hasUnderScore(name: string): boolean; export declare function hasDash(name: string): boolean; export declare function hasUpperCaseAndLowerCase(name: string): boolean; export declare function upperCaseFirst(name: string): string; export declare function lowerCaseFirst(name: string): string; /** * Normalize the given {@link name} by transforming into lowercase and replace delimeters with a single space * @param name string * @returns normalized name in the lowercase and space seperated string */ export declare function normalizeName(name: string): string; //# sourceMappingURL=normalize-name.d.ts.map