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

refactor: ensure immutability to avoid side effects in HTML encoding [HEAD-1162] #416

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

cat2608
Copy link
Contributor

@cat2608 cat2608 commented Dec 19, 2023

Description

Previously, the encoding was done inline using map, which could lead to confusion due to the side effect of mutating the lines objects within exampleCommitFixes. Since map should ideally be used to create a new array without side effects, this was not the advised use of the method.

Screenshots attached showing that this change didn't affect the output.

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots / GIFs

main working branch
main-after refactor-after
main-ui refactor-ui

HEAD-1162

Previously, the encoding was done inline using `map`, which could lead to confusion
due to the side effect of mutating the `lines` objects within `exampleCommitFixes`.
Since `map` should ideally be used to create a new array without side effects, this was not
the advised use of the method.
@cat2608 cat2608 requested a review from a team as a code owner December 19, 2023 17:12
@cat2608 cat2608 changed the title refactor: ensure immutability to avoid side effects in HTML encoding [HEAD-559] refactor: ensure immutability to avoid side effects in HTML encoding [HEAD-1162] Dec 20, 2023
@PeterSchafer PeterSchafer merged commit aadc43c into main Dec 20, 2023
6 checks passed
@PeterSchafer PeterSchafer deleted the refactor/HEAD-559-extract-encode-html branch December 20, 2023 13:07
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