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

fix: fragment encoding #23

Merged
merged 4 commits into from
Feb 5, 2022
Merged

fix: fragment encoding #23

merged 4 commits into from
Feb 5, 2022

Conversation

zekth
Copy link
Member

@zekth zekth commented Feb 4, 2022

[Draft]
currently having issue with fragment encoding like:

  • #/$defs/stringMap
  • #/$defs/string%20Map

Checklist

}
if (parsed.fragment !== undefined && parsed.fragment.length) {
parsed.fragment = escape(parsed.fragment)
parsed.fragment = encodeURI(decodeURI(parsed.fragment))
Copy link
Member

Choose a reason for hiding this comment

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

I miss the escape usage.
There is any reason to prefer it over encodeURI and decodeURI?

This fix could impact the performance.. need to try it

Copy link
Member Author

Choose a reason for hiding this comment

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

Iirc i switched to escape because it was faster. I'll have to run some benchmarks. But at the moment i switched i cleaned up a lot the parse flow. Going to check

@coveralls

This comment was marked as spam.

@coveralls

This comment was marked as off-topic.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@zekth zekth marked this pull request as ready for review February 5, 2022 11:30
@zekth
Copy link
Member Author

zekth commented Feb 5, 2022

@mcollina @Eomm using encode/decode is not impacting that much, still a bit but not crazy high overhead. I'd land this as a patch and we can take care of the whole encoding flow issue in another PR.
Sorry when i refactored it i might have missed some spots and got lost at some point.

@zekth zekth merged commit fc3eb31 into main Feb 5, 2022
@zekth zekth deleted the fix-encoding-parse branch February 5, 2022 12:30
@zekth zekth mentioned this pull request Feb 5, 2022
2 tasks
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1798853620

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 86.509%

Totals Coverage Status
Change from base Build 1755439380: 0.0%
Covered Lines: 339
Relevant Lines: 371

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 16, 2024

Pull Request Test Coverage Report for Build 1799258259

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 86.509%

Totals Coverage Status
Change from base Build 1755439380: 0.0%
Covered Lines: 339
Relevant Lines: 371

💛 - Coveralls

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.

4 participants