-
Notifications
You must be signed in to change notification settings - Fork 40
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
🐛 Fixed a replace bug that insert match string in replacement value #1261
Conversation
cf36eb8
to
a688169
Compare
integrity sha512-bWTlaXUy/rq0BBtYShc/jArYfBPjEV95euvZ8JVtO43oQExEN/WquoqpufFjNu4kSpi5cy5kMbNvzztWDfv1Jg== | ||
version "1.0.30001488" | ||
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001488.tgz" | ||
integrity sha512-NORIQuuL4xGpIy6iCCQGN4iFjlBXtfKWIenlUuyZJumLRIindLb7wXM+GO8erEhb7vXfcnf4BAg2PrSDN5TNLQ== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing this? Lets not commit this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its printing warning in tests + its only dependency of @babel/preset-env
which is a dev-dependency of cli [ so safe to upgrade ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
…1261) * Fixed replace bug that insert match in return val * Updated test to use withExample
…1261) * Fixed replace bug that insert match in return val * Updated test to use withExample
We have a js bug in replace. [ bug for us, its a functionality of replace ]By default js replace function considers everything as regex replace. so as per docs
if we do
reason being
$&
inserts the match string in the place => in "dog cats" we have match dog which we want to replace with&$cats
=> replace withdogcats
=> final outputdogcats cats
.The reason it was breaking because we do
and innerHTML of client dom contains $& in many urls [ and so it was getting replaced with ]
So we are using replacer function that does not trigger this inserts