Skip to content

Fix type support for readonly arrays#40

Merged
wooorm merged 1 commit intomainfrom
fix/types
Dec 15, 2025
Merged

Fix type support for readonly arrays#40
wooorm merged 1 commit intomainfrom
fix/types

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Oct 20, 2025

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything or linked relevant results below
  • I made sure the docs are up to date
  • I included tests (or that’s not needed)

Description of changes

close #39

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Oct 20, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes TypeScript type support for readonly arrays by updating the type definition to handle ReadonlyArray<any> instead of just Array<any> and improves array element type access.

  • Updated the Matches type definition to support readonly arrays
  • Changed array element access from Check[keyof Check] to Check[number] for better type inference
  • Added comprehensive test coverage for both mutable and readonly array scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/index.js Updated TypeScript type definition to support readonly arrays and improved array element access
index.test-d.ts Added test cases to verify type behavior with both mutable and readonly arrays

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@glebec
Copy link

glebec commented Dec 12, 2025

@remcohaszing et al – any blockers to getting this merged?

@wooorm wooorm merged commit 639c0e5 into main Dec 15, 2025
6 checks passed
@wooorm wooorm deleted the fix/types branch December 15, 2025 09:26
@github-actions

This comment has been minimized.

@glebec
Copy link

glebec commented Jan 20, 2026

Thanks for the merge @wooorm — can we also get a release? 🙏

@wooorm
Copy link
Member

wooorm commented Jan 22, 2026

right, 5.1.0!

@wooorm wooorm added the 💪 phase/solved Post is done label Jan 22, 2026
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 phase/solved Post is done

Development

Successfully merging this pull request may close these issues.

test type infer is wrong when test is a const array

4 participants