UNPKG

@iimm/shared

Version:

shared utils on browser and react env

13 lines (12 loc) 818 B
/** 字符串是否全为中文字符 */ export declare const isAllChineseWord: (str: string) => boolean; /** 检查字符串中是否包含中文字符 */ export declare const hasChineseWord: (str: string) => boolean; /** 将字符值转换为所有单词(首个单词或空格后面的单词)为首字母大写 */ export declare const capitalize: (word?: string) => string; /** 将字符串转换为大驼峰样式(首字母大写) */ export declare const pascalCase: (str?: string) => string; /** 将字符串转换为驼峰样式(首字母样式不变) */ export declare const camelCase: (str?: string) => string; /** 将驼峰或大驼峰转化为使用分隔符(默认是下划线)间隔的变量(首字母小写) */ export declare const separatorCase: (name?: string, separator?: string) => string;