talha-asad / mongoose-url-slugs

Create URL compatiable slugs on mongoose models, ensuring uniqueness.
MIT License
40 stars 22 forks source link

Unnecessary Numbers Bug Fix #36

Closed ralphnajm closed 6 years ago

ralphnajm commented 6 years ago

Fix for a bug that caused adding unnecessary number to links if longer version exists. e.g. creating 'hello-world' then 'hello' would cause 'hello' to have '-2' at the end.

I have done some light testing and seems to be working fine.

talha-asad commented 6 years ago

Looks pretty good, please add a test for this as well so we don't break this corner case again.

talha-asad commented 6 years ago

Okay I put that in, thanks for the good work @ralphnajm