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

refine types: arrays may be readonly #878

Merged
merged 1 commit into from Aug 21, 2019
Merged

refine types: arrays may be readonly #878

merged 1 commit into from Aug 21, 2019

Conversation

elmarx
Copy link
Contributor

@elmarx elmarx commented Aug 21, 2019

chokidar does not modify passed arrays, thus they may also be marked as readonly in type definition.

@paulmillr paulmillr merged commit 775420f into paulmillr:master Aug 21, 2019
@paulmillr
Copy link
Owner

Thanks!

@paulmillr
Copy link
Owner

Just a quick clarification from what i've understood.

ReadonlyArray is an interface, not a subclass. That's why it's good to use. I've thought it was a subclass. A more modern version of that would be readonly string[], which is only supported by TS 3.4+.

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.

None yet

2 participants