element-plus/packages/utils/strings.ts

13 lines
309 B
TypeScript
Raw Normal View History

export {
camelize,
capitalize,
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')