Skip to content

Commit

Permalink
Use the built-in trim method
Browse files Browse the repository at this point in the history
Fixes #37
  • Loading branch information
simov committed Aug 5, 2018
1 parent 26748bd commit e8f8a69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
.replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]/g, '')
}, '')
// trim leading/trailing spaces
.replace(/^\s+|\s+$/g, '')
.trim()
// convert spaces
.replace(/[-\s]+/g, options.replacement || '-')
// remove trailing separator
Expand Down

0 comments on commit e8f8a69

Please sign in to comment.