Feat/sub-route (#38)

* blog subroute support
* docs: update readme and blog

Co-authored-by: mrhut10 <ahut10@gmail.com>
This commit is contained in:
Timothy
2021-05-08 13:58:57 +08:00
committed by GitHub
parent 69a41932e7
commit 735c954e72
14 changed files with 99 additions and 119 deletions

8
lib/utils/kebabCase.js Normal file
View File

@@ -0,0 +1,8 @@
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('-')
export default kebabCase