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

Use readonly arrays for validator options #1061

Merged
merged 2 commits into from Jul 23, 2021
Merged

Conversation

gustavohenke
Copy link
Member

@gustavohenke gustavohenke commented Jul 14, 2021

Description

Changes validators options from type[] to readonly type[] - we don't do any mutation to them, so there's no need to require a mutable array.

Example of the issue: https://www.typescriptlang.org/play?#code/MYewdgzgLgBAhgJwQLhggpnAJuANgT3jHwG0BdGAXhhIEYAaGAJkYGYyBuAKADMBXMMCgBLcDBwBlEAFt0UABbCwAcwAUSgA58oqOMXIBKGAG8Avl0ky5ilasQIDHIA

Fixes #1059

To-do list

  • I have added tests for what I changed
  • This pull request is ready to merge.

@gustavohenke gustavohenke requested a review from fedeci July 14, 2021 02:04
@gustavohenke
Copy link
Member Author

Looks like travis-ci.org has been halted, I'm trying to set us up on travis-ci.com now... 😕

@gustavohenke
Copy link
Member Author

(if the above doesn't work, we might have to use github actions...)

@fedeci
Copy link
Member

fedeci commented Jul 14, 2021

I would directly go with GH actions that are better integrated.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling ff996e2 on ts-readonly-arrays into 5a29d11 on master.

@gustavohenke gustavohenke merged commit 4557793 into master Jul 23, 2021
@gustavohenke gustavohenke deleted the ts-readonly-arrays branch July 23, 2021 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Argument of type 'readonly number[]' is not assignable to parameter of type 'any[]'
3 participants