Skip to content

fix: MaybeArray with readonly array#24

Merged
fratzinger merged 1 commit intomainfrom
fix/maybe-array-readonly
Mar 6, 2026
Merged

fix: MaybeArray with readonly array#24
fratzinger merged 1 commit intomainfrom
fix/maybe-array-readonly

Conversation

@fratzinger
Copy link
Member

This pull request improves support for readonly arrays in utility types and functions, and adds a corresponding test to ensure correct handling. The main focus is on enhancing type safety and compatibility with readonly arrays in the codebase.

Readonly array support:

  • Updated the MaybeArray<T> type and toArray utility function in src/internal.utils.ts to accept both mutable and readonly arrays, ensuring better type compatibility and preventing accidental mutation.

Testing improvements:

  • Added a test case in params-for-server.hook.test.ts to verify that the paramsForServer function correctly accepts and handles readonly arrays as input.

@cloudflare-workers-and-pages
Copy link

Deploying feathers-utils with  Cloudflare Pages  Cloudflare Pages

Latest commit: 23c5916
Status: ✅  Deploy successful!
Preview URL: https://cbb191ab.feathers-utils.pages.dev
Branch Preview URL: https://fix-maybe-array-readonly.feathers-utils.pages.dev

View logs

@fratzinger fratzinger merged commit 80845bb into main Mar 6, 2026
11 checks passed
@fratzinger fratzinger deleted the fix/maybe-array-readonly branch March 6, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant