Skip to content

feat(yaml): pass depth to sortKeys callback in stringify#7001

Merged
bartlomieju merged 2 commits intodenoland:mainfrom
tomas-zijdemans:yaml-depth
Mar 26, 2026
Merged

feat(yaml): pass depth to sortKeys callback in stringify#7001
bartlomieju merged 2 commits intodenoland:mainfrom
tomas-zijdemans:yaml-depth

Conversation

@tomas-zijdemans
Copy link
Copy Markdown
Contributor

Resolves: #6898

I'm not sure if this is a fix or a feat 🤷

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.39%. Comparing base (432d3f3) to head (14a667a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7001   +/-   ##
=======================================
  Coverage   94.39%   94.39%           
=======================================
  Files         629      629           
  Lines       50262    50263    +1     
  Branches     8870     8870           
=======================================
+ Hits        47443    47445    +2     
  Misses       2251     2251           
+ Partials      568      567    -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Clean, minimal change. Two notes:

  1. This is additive functionality (new parameter), not a bug fix — should be feat(yaml) rather than fix(yaml), since it's a semver-minor change for a stable package.
  2. The type signature change from (a: string, b: string) => number to (a: string, b: string, depth: number) => number is backwards-compatible at runtime (extra args are ignored), but TypeScript users with explicitly typed callbacks may notice the signature difference. Minor concern.

Implementation and test look good.

@tomas-zijdemans tomas-zijdemans changed the title fix(yaml): pass depth to sortKeys callback in stringify feat(yaml): pass depth to sortKeys callback in stringify Mar 25, 2026
@tomas-zijdemans
Copy link
Copy Markdown
Contributor Author

Title updated as requested

@bartlomieju bartlomieju merged commit fe650df into denoland:main Mar 26, 2026
19 checks passed
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.

@std/yaml: sortKeys doesn't take depth into account

2 participants