use custom kebabcase function
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import fs from 'fs'
|
||||
import matter from 'gray-matter'
|
||||
import path from 'path'
|
||||
import kebabCase from 'just-kebab-case'
|
||||
import { kebabCase } from './utils'
|
||||
|
||||
const root = process.cwd()
|
||||
|
||||
|
6
lib/utils.js
Normal file
6
lib/utils.js
Normal file
@ -0,0 +1,6 @@
|
||||
export 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('-')
|
Reference in New Issue
Block a user