chore: prettier code
This commit is contained in:
parent
a9704b5156
commit
aba2aec0d0
30 changed files with 1533 additions and 734 deletions
|
|
@ -4,7 +4,9 @@ const re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g
|
|||
export function slugify (str) {
|
||||
if (typeof str !== 'string') return ''
|
||||
|
||||
let slug = str.toLowerCase().trim()
|
||||
let slug = str
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.replace(/<[^>\d]+>/g, '')
|
||||
.replace(re, '')
|
||||
.replace(/\s/g, '-')
|
||||
|
|
@ -12,7 +14,7 @@ export function slugify (str) {
|
|||
.replace(/^(\d)/, '_$1')
|
||||
let count = cache[slug]
|
||||
|
||||
count = cache.hasOwnProperty(slug) ? (count + 1) : 0
|
||||
count = cache.hasOwnProperty(slug) ? count + 1 : 0
|
||||
cache[slug] = count
|
||||
|
||||
if (count) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue