@sap-cloud-sdk/util
Version:
SAP Cloud SDK for JavaScript general utilities
25 lines (24 loc) • 1.12 kB
TypeScript
/**
* Checks whether the keys and values of two objects are equal.
* @param obj1 - The first object.
* @param obj2 - The second object.
* @returns A boolean, indicating whether the two objects are equal to each other.
*/
export declare function equalObjects(obj1: Record<string, any>, obj2: Record<string, any>): boolean;
/**
* Checks whether the two items contain the same content.
* When both of them are arrays, the elements and the order are checked, see {@link equalArrays}.
* When both of them are objects, the key/value pairs are checked, see {@link equalObjects}.
* In other cases, triple equals is used.
* @param item1 - The first item.
* @param item2 - The second item.
* @returns A boolean, indicating all the items equal to each other.
*/
export declare function equal<T>(item1: T, item2: T): boolean;
/**
* Checks whether the elements of two arrays are the same with the same order.
* @param arr1 - The first array.
* @param arr2 - The second array.
* @returns A boolean, indicating both arrays have the same contents.
*/
export declare function equalArrays<T>(arr1: T[], arr2: T[]): boolean;