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

fix(types): allow evaluate functions to take a readonly array as an argument #7072

Merged
merged 5 commits into from Sep 11, 2021

Conversation

n10v
Copy link
Contributor

@n10v n10v commented Apr 8, 2021

Fixes #6953

@google-cla google-cla bot added the cla: yes label Apr 8, 2021
@n10v n10v changed the title fix(types): allow Frame.evaluate to take a readonly array as an argument fix(types): allow evaluate functions to take a readonly array as an argument Apr 9, 2021
@jackfranklin
Copy link
Collaborator

jackfranklin commented May 25, 2021

Thanks for this change (and sorry for the slow reply).

I'm curious, if we made the type JSONArray = readonly Serializable[], would that work? I think a mutable array can become a readonly, but not the other way round. So if so we can avoid the union type and just define it with readonly.

@n10v
Copy link
Contributor Author

n10v commented May 26, 2021

Hi @jackfranklin,
yes, it seems so 👍
I will change the PR later today.

@n10v
Copy link
Contributor Author

n10v commented Jun 29, 2021

Updated. Please take a look :)

Copy link
Contributor

@jschfflr jschfflr left a comment

Choose a reason for hiding this comment

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

This change looks good to me, thanks!

@jschfflr jschfflr enabled auto-merge (squash) September 11, 2021 08:02
@jschfflr jschfflr merged commit 491614c into puppeteer:main Sep 11, 2021
@n10v n10v deleted the fix-evaluate-readonly branch September 13, 2021 07:33
jschfflr pushed a commit to mushishi78/puppeteer that referenced this pull request Sep 16, 2021
This was referenced May 30, 2022
This was referenced May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

page.evaluate* functions typings don't accept readonly arrays
3 participants