Skip to content

fix(path): accept readonly array in common() - #7365

Open
dannyshafer wants to merge 1 commit into
denoland:mainfrom
dannyshafer:path-common-readonly
Open

dannyshafer wants to merge 1 commit into
denoland:mainfrom
dannyshafer:path-common-readonly

Conversation

@dannyshafer

Copy link
Copy Markdown

Summary

common() in @std/path (and the posix and windows variants, plus the internal _common/common.ts helper) now takes readonly string[] instead of string[].

Motivation

Part of #5831. common() never mutates its paths argument, so callers holding a readonly array (for example one declared 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

  • Added common() accepts readonly arrays to path/common_test.ts, covering common(), posix.common() and windows.common(). It fails type-checking (TS2345) without the change and passes with it.
  • deno test path/: all common tests pass. The only failure was isGlob works with the input that includes large number of open brackets, a timing test that timed out in the (slow) environment this was run in and is unrelated to this change.
  • deno fmt --check path/ and deno lint path/ are clean.

This PR was prepared with an AI coding agent (Claude Code).

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the path label Oct 19, 2026
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.04%. Comparing base (f834d02) to head (607c6d4).

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #7365    +/-   ##
========================================
  Coverage   95.04%   95.04%            
========================================
  Files         619      618     -1     
  Lines       52012    51757   -255     
  Branches     9450     9401    -49     
========================================
- Hits        49434    49192   -242     
+ Misses       2031     2022     -9     
+ Partials      547      543     -4     

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
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