UNPKG
speechkit
Version:
latest (0.1.0)
0.1.0
0.0.1
AI-read audio for your news posts
github.com/bukinoshita/speechkit
bukinoshita/speechkit
speechkit
/
lib
/
slugify.js
13 lines
(11 loc)
•
224 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict'
module
.
exports
=
text
=>
{
return
text .
toString
() .
toLowerCase
() .
replace
(
/\s+/g
,
'-'
) .
replace
(
/[^\w\-]+/g
,
''
) .
replace
(
/\-\-+/g
,
'-'
) .
replace
(
/^-+/
,
''
) .
replace
(
/-+$/
,
''
) }