Skip to content

Commit

Permalink
fix: remove() should work with multichar strings
Browse files Browse the repository at this point in the history
Fixes: simov#164
  • Loading branch information
Trott committed Aug 18, 2022
1 parent 1d24cf7 commit d4768d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 9 additions & 3 deletions slugify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions test/slugify.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ describe('slugify', () => {
'foo *+~.() bar \'"!:@ baz',
{remove: /[$*_+~.()'"!\-:@]/g}
), 'foo-bar-baz')

t.equal(slugify(
'AFdAFd',
{ remove: /AF/g }
), 'dd')
})

it('options.remove regex without g flag', () => {
Expand Down

0 comments on commit d4768d3

Please sign in to comment.