compare-anything
Version:
Compares objects and arrays and tells you which props or values are duplicates, and which are only present once.
11 lines (10 loc) • 391 B
TypeScript
export type ComparisonObjects<ObjectType> = {
differentProps: (keyof ObjectType)[];
differentPropsPicked: Partial<ObjectType>[];
equal: boolean;
};
export declare function compareObjectsBasedOn<ObjectType extends {
[key in string]: any;
} | any = {
[key in string]: any;
}>(propKeys: (keyof ObjectType)[], objects: [ObjectType, ...any[]]): ComparisonObjects<ObjectType>;