Skip to content

fn.sum<T>() should accept T as an arbitrary type #1938

Description

@XiNiHa

While the default for T we have (number | string | bigint) makes sense, it should be possible to override T as an arbitrary type, rather than restricting it with extends number | string | bigint.

This is because users can customize the JS type representations at the driver layer, which in my case was using Decimal.js for decimal types.

However, since the fn.sum<T>() function didn't accept bigint | Decimal as T, it resulted in a type error.

Though debatable, I personally think that removing the type parameter restriction is the right thing to do.

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