Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to avoid removing repeated replacement #18

Closed
wants to merge 4 commits into from
Closed

Add option to avoid removing repeated replacement #18

wants to merge 4 commits into from

Conversation

rocktimsaikia
Copy link

@rocktimsaikia rocktimsaikia commented Sep 27, 2020

Feature of avoid removing repeated replacement added suggested by the issue #10.

A new option is now available named 'condenseReplacements' as suggested by @sindresorhus on issue #10

filenamify('/path/to/file---name.ext"', {replacement: '-', condenseReplacements: true});
// => path-to-file---name.ext

Test case added along with updated README

// @sindresorhus

Fixes #10

@sindresorhus
Copy link
Owner

The default value should be true, to preserve existing behavior.

Type: `boolean`\
Default: `false`

Preserves the repeated replacements of a given string.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is inconsistent compared to the other ones. And it's also incorrect. It doesn't describe what the option does, but rather what it doesn't do.

@rocktimsaikia
Copy link
Author

rocktimsaikia commented Oct 7, 2020

The default value should be true, to preserve existing behavior.

@sindresorhus Ah, I see. This would be a breaking change then! That's why I hesitated to set it true by default.

@papb
Copy link

papb commented Oct 8, 2020

@rocktimsaikia No; the default value being true is exactly what makes it not a breaking change.

Base automatically changed from master to main January 23, 2021 11:13
@sindresorhus
Copy link
Owner

Bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to avoid removing repeated replacement
3 participants