webapp/src/utils/slugify.ts
Igor Lobanov 47d14b0a5d
Fix typography feature, scroll top button fix, slugify fix (#93)
* Fix typography feature, scroll top button fix, slugify fix

* build fix, some lint

* refactoring, lint
2023-05-12 15:03:46 +02:00

8 lines
170 B
TypeScript

import { translit } from './ru2en'
export const slugify = (text) => {
return translit(text.toLowerCase())
.replaceAll(' ', '-')
.replaceAll(/[^\da-z]/g, '')
}