fix: non-latin tags don't cause error

This commit is contained in:
Vitaly Baev committed 2021-08-20 18:03:38 +03:00
1 parent 4d6114f8f8
commit 0793b0dbe7
3 files changed
+5 -7

No files matched your search

+3 -6
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