Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type definitions erroneously disallow passing an explicitly readonly array of strings #408

Closed
lazarljubenovic opened this issue Jul 19, 2023 · 1 comment
Milestone

Comments

@lazarljubenovic
Copy link

Actual behavior

import glob from 'fast-glob'
declare const options: { readonly patterns: ReadonlyArray<string> }
glob(patterns)
//   ^^^^^^^^
// Argument of type 'readonly string[]' is not assignable to parameter of type 'string | string[]'.
//   The type 'readonly string[]' is 'readonly' and cannot be assigned to the mutable type 'string[]'.

Expected behavior

No error. It's my first time using fast-glob, but I assume it won't actually mutate the array, right?

@mrmlnc
Copy link
Owner

mrmlnc commented Aug 4, 2023

Will be included in the 4.0.0 release (#371).

@mrmlnc mrmlnc closed this as completed Aug 4, 2023
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

No branches or pull requests

2 participants