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 ability to use suffixes in the match string, e.g. @@env.css.darkStyle@@ #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rrabb
Copy link

@rrabb rrabb commented May 6, 2019

Hello, I'm using your library as part of the gulp replace task and find it very useful. It is being added to node_modules via npm install.
However, I've encountered an issue with using json object pattern matching.

It's necessary to use suffix sometimes when there are unintended partial matches due to missing json keys in the pattern json object.
For example, be able to replace matches like @@env.css.darkStyle@@ instead of just @@env.css.darkStyle. This is needed to avoid erroneously substituting a partial match like @@env.css.darkStyle.headerColor with the @@env.css.darkStyle match (which is a serialized json object) when property "headerColor" is not found in the pattern json object under env.css.darkStyle.

rrabb added 3 commits May 6, 2019 18:32
For example, replace matches like @@env.css.darkStyle@@ instead of just @@env.css.darkStyle. This is needed to avoid erroneously substituting a partial match like @@env.css.darkStyle_header with the @@env.css.darkStyle when darkStyle_header is not found in json.
It's necessary to use suffix sometimes when there are unintended partial matches due to missing json keys in the pattern json object. 
For example, be able to replace matches like @@env.css.darkStyle@@ instead of just @@env.css.darkStyle. This is needed to avoid erroneously substituting a partial match like @@env.css.darkStyle_header with the @@env.css.darkStyle match when darkStyle_header is not found in the pattern json.
5793b26
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.

1 participant