Skip to content

Using .whereIn with Sets #524

@tintin10q

Description

@tintin10q

Describe the feature

It would be great if you could give sets to the .whereIn method. Currently if you do this typescript gives an error and you also get back an empty list of results. It would be great if sets worked.

I also imagine that it would also be quite faster than using arrays because finding out if something is in a set O(1). But even if you already convert to a set behind the scenes it would still be faster if we could just pass a set directly because than you can skip the conversion.

You probably already know this but you can check that something is a Set using the instanceof keyword. Like so:

const a = new Set(["set"])
console.log("a is a set:", a instanceof Set)

I don't know if this feature could be implemented as a module because I don't really know what that means but I think this is just a simple change to an already existing thing.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions