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

Use a configuration object for optional parameters in replace call #1

Closed
mooeypoo opened this issue Apr 23, 2021 · 0 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@mooeypoo
Copy link
Owner

The replace method is starting to be extremely verbose in terms of the parameters it allows, and there are several future enhancement considerations that may add even more to it.

The call should be replaced to have the optional parameters as part of a configuration options object, which will also allow for more flexibility in the future.

Instead of

replacer.replace(htmlString, keyFrom, keyTo,baseUrl, bothWays);

It should be something like

replacer.replace(html, this.keys[0], this.keys[1], {
  baseUrl: '...',
  bothWays: '...'
});

And then include other upcoming modes.

@mooeypoo mooeypoo added the enhancement New feature or request label Apr 23, 2021
@mooeypoo mooeypoo added this to the v1.0.0 milestone Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant