sindresorhus / slugify

Slugify a string
MIT License
2.56k stars 81 forks source link

Add leading underscore option #43

Closed dgaussr closed 4 years ago

dgaussr commented 4 years ago

[Fixes #39] I created a new leading underscore parameter for the function as false at default. But, when it's true, it changes the current regexp to accept the leading underscore:

Example:

slugify("_foo bar", { leadingUnderscore: true })

Output: _foo-bar
sindresorhus commented 4 years ago

You need to write in the PR description what issue the PR fixes in the form: Fixes #123.

sindresorhus commented 4 years ago

You also need to document it in index.d.ts.

sindresorhus commented 4 years ago

You need to write in the PR description what issue the PR fixes in the form: Fixes #123.

The description, not title.

sindresorhus commented 4 years ago

Thanks :)