dodo / node-slug

slugifies even utf-8 chars!
MIT License
1.08k stars 92 forks source link

Add flag for forcing lowercase slugs #7

Closed jaketrent closed 11 years ago

jaketrent commented 11 years ago

Added flag for forcing lowercase slugs.

Syntax:

slug('FOO-Bar-baZ', true)
# or
slug('FOO-Bar-baZ', '_', true)

And added tests to match. All passing.

thom4parisot commented 10 years ago

It would be better to keep the second argument as:

slug("My String", { lowerCase: true, separator: '_', … });

Otherwise you end up with implicit arguments, making any further extension complicated.

dodo commented 10 years ago

@oncletom thats how it's implemented. but in the end i removed the lowerCase option since slug('str', {…}).toLowerCase() is less code and same result.

thom4parisot commented 10 years ago

:+1: