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

chore: add support for readonly arrays #189

Merged
merged 2 commits into from
Jan 19, 2022

Conversation

clarkerican
Copy link
Contributor

TODO: Revisit to add TS tests once this PR (https://github.com/faker-js/faker/pull/186/files) is merged.

I searched for all parameters that have T[] and don't modify the array.

@netlify
Copy link

netlify bot commented Jan 17, 2022

✔️ Deploy Preview for vigilant-wescoff-04e480 ready!

🔨 Explore the source changes: 62d934b

🔍 Inspect the deploy log: https://app.netlify.com/sites/vigilant-wescoff-04e480/deploys/61e83964196a7e00071a65a2

😎 Browse the preview: https://deploy-preview-189--vigilant-wescoff-04e480.netlify.app

@Shinigami92 Shinigami92 added the p: 2-high Fix main branch label Jan 17, 2022
@Shinigami92 Shinigami92 added this to the v6.0.0 milestone Jan 17, 2022
@Shinigami92
Copy link
Member

Is this just enough? I expected something like ReadonlyArray<T> | T[] 🤔
Did you tested it locally? I'm afraid of breaking simple array typing ^^'

Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

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

I tested a bit in TS Playground and everything works find 👍

@Shinigami92 Shinigami92 requested a review from a team January 17, 2022 17:20
@Shinigami92 Shinigami92 marked this pull request as ready for review January 17, 2022 17:20
src/helpers.ts Show resolved Hide resolved
@Shinigami92 Shinigami92 requested review from damienwebdev and a team January 19, 2022 16:16
Copy link
Member

@damienwebdev damienwebdev left a comment

Choose a reason for hiding this comment

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

lgtm

@Shinigami92 Shinigami92 merged commit ec4efba into main Jan 19, 2022
@Shinigami92 Shinigami92 deleted the erica/support-readonly-arrays branch January 19, 2022 18:45
pkuczynski pushed a commit to pkuczynski/faker that referenced this pull request Jan 21, 2022
Co-authored-by: Shinigami <chrissi92@hotmail.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: 2-high Fix main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

types: random.arrayElement (and probably others) should support ReadonlyArray
5 participants