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

bug: readonly arrays are rejected by TS type for some signatures #828

Open
duncanbeevers opened this issue May 28, 2024 · 0 comments
Open

Comments

@duncanbeevers
Copy link
Contributor

🐞 Permit readonly arrays

It should be possible to assign readonly arrays directly to papr payload-accepting methods.
Instead, we get a type error;

const payload: { list: readonly number[] } = { list: [456] };
// The type 'readonly number[]' is 'readonly' and cannot be assigned to the mutable type 'number[]'.
await simpleModel.updateOne({ foo: 'foo' }, { $set: payload });
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

1 participant