Skip to content

Array types shouldn't have to be the same #90

@alexandrulesi

Description

@alexandrulesi

Consider something like:

export interface DiffData<Ta, Tb> {
    removed: Ta[];
    added: Tb[];
}
export declare function diff<Ta, Tb>(a: Ta[], b: Tb[], compareFunc?: (ia: Ta, ib: Tb) => boolean): DiffData<Ta, Tb>;

My concrete use case is: I have some records in the db and new records coming in. The records in the db have ids, the new ones do not. I need the ids to know what records I want to archive in the db. Now I can't use this package without some workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions