Merge pull request #330 from rsipakov/patch-1

chore: ability to use the 'cyrillic' alphabet
This commit is contained in:
Timothy 2022-01-09 22:46:57 +08:00 committed by GitHub
commit de8752b8f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,5 @@
const kebabCase = (str) =>
str &&
str
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
.map((x) => x.toLowerCase())
.join('-')
import { slug } from 'github-slugger'
const kebabCase = (str) => slug(str)
export default kebabCase