Repository navigation
fix(front-matter): accept readonly array in test() - #7367
Open
dannyshafer wants to merge 1 commit into
Open
dannyshafer wants to merge 1 commit into
dannyshafer wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7367 +/- ##
==========================================
- Coverage 95.04% 95.02% -0.02%
==========================================
Files 619 618 -1
Lines 52012 51757 -255
Branches 9450 9403 -47
==========================================
- Hits 49434 49184 -250
+ Misses 2031 2022 -9
- Partials 547 551 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test()in@std/front-matternow takesformats?: readonly Format[]instead ofFormat[]. Instead of reassigning the parameter when it is omitted, it iterates overformats ?? EXTRACT_REGEXP_MAP.keys(), so behavior is unchanged.Motivation
Part of #5831.
test()never mutatesformats, so callers holding a readonly array (for example["yaml"] as const) currently get a type error for no reason. Other modules have already been updated the same way (#5832, #5735, #6639, #6911).Test plan
test() accepts readonly formatstofront_matter/test_test.ts. It fails type-checking (TS2345) without the change and passes with it.deno test --doc front_matter/: 45 passed, 0 failed.deno fmt --check front_matter/anddeno lint front_matter/are clean.This PR was prepared with an AI coding agent (Claude Code).