Skip to content

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

Description

@duncanbeevers

🐞 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 });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions