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(yaml): add sanitizeInput() function #5248

Merged
merged 7 commits into from
Jul 2, 2024

Conversation

timreichen
Copy link
Contributor

  • moves code into a dedicated sanitizeInput() function

@timreichen timreichen requested a review from kt3k as a code owner July 2, 2024 09:13
@github-actions github-actions bot added the yaml label Jul 2, 2024
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.10%. Comparing base (832be24) to head (44820fd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5248      +/-   ##
==========================================
- Coverage   95.47%   95.10%   -0.37%     
==========================================
  Files         461      461              
  Lines       38002    38006       +4     
  Branches     5535     5504      -31     
==========================================
- Hits        36281    36146     -135     
- Misses       1679     1818     +139     
  Partials       42       42              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kt3k
Copy link
Member

kt3k commented Jul 2, 2024

sanitizeInput is only used once. I don't see this change reasonable.

@iuioiua
Copy link
Contributor

iuioiua commented Jul 2, 2024

I don't see the purpose of this change either.

@timreichen
Copy link
Contributor Author

sanitizeInput is only used once. I don't see this change reasonable.

I will create a second PR that uses generator functions for documents in loader.ts. Therefore load() and loadDocuments() will need to call sanitizeInput() individually. The gain will be to throw early if there are more than one document in load() instead of parsing all documents and then throw.

yaml/_loader/loader.ts Outdated Show resolved Hide resolved
@iuioiua iuioiua enabled auto-merge (squash) July 2, 2024 10:37
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

@iuioiua iuioiua merged commit 5c65c13 into denoland:main Jul 2, 2024
15 checks passed
@timreichen timreichen deleted the yaml-add-sanitize-input-function branch August 17, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants