mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
c4d0c6f90a
Co-authored-by: 三咲智子 <sxzz@sxzz.moe>
17 lines
565 B
TypeScript
17 lines
565 B
TypeScript
import { capitalize as toCapitalize } from '@vue/shared'
|
|
export {
|
|
camelize,
|
|
hyphenate,
|
|
hyphenate as kebabCase, // alias
|
|
} from '@vue/shared'
|
|
|
|
/**
|
|
* fork from {@link https://github.com/sindresorhus/escape-string-regexp}
|
|
*/
|
|
export const escapeStringRegexp = (string = '') =>
|
|
string.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d')
|
|
|
|
// NOTE: improve capitalize types. Restore previous code after the [PR](https://github.com/vuejs/core/pull/6212) merge
|
|
export const capitalize = <T extends string>(str: T) =>
|
|
toCapitalize(str) as Capitalize<T>
|