Skip to content

Using typescript readonly variable as a PrimitiveValue #2271

@keepcosmos

Description

@keepcosmos

When I try to pass readonly args into where syntax, it throws typescript syntax error

Argument of type 'readonly string[]' is not assignable to parameter of type 'AnyQueryBuilder'.

ex)

function test(ids: readonly string[]) {
  return User.query().whereIn('id', ids)
}

Any way to solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions