Skip to content

feat: add strict replacement option - #228

Open
RamziSayagh wants to merge 1 commit into
simov:masterfrom
RamziSayagh:feat/strict-replace-option
Open

RamziSayagh wants to merge 1 commit into
simov:masterfrom
RamziSayagh:feat/strict-replace-option

Conversation

@RamziSayagh

Copy link
Copy Markdown

Summary

Adds a strictReplace option to replace special characters with the configured replacement character.

Example

slugify('foo_bar. -@-baz!', { strictReplace: true })
// foo-bar-baz

Changes

  • Preserves the existing strict behavior
  • Gives strict precedence when both options are enabled
  • Adds TypeScript typings, documentation, and tests

@Trott Trott left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Similar to the other pull request, this seems to be adding a feature just because we can and not because anyone needs it. This adds maintenance burden and a surface for bugs (or just surprising behaviors) for a feature that is not useful. It negatively affects the developer experience because people have to sort out more options (with similar names--strict vs. strictReplace vs. replace) to find the one they actually want, and in return, we get the aforementioned maintenance burden and surface area for bugs.

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.

2 participants