@monstermann/fn
Version:
A utility library for TypeScript.
22 lines • 675 B
TypeScript
//#region src/object/isShallowEqual.d.ts
/**
* `isShallowEqual(target, source)`
*
* Performs a shallow equality comparison between `target` and `source` objects.
*
* ```ts
* isShallowEqual({ a: 1, b: 2 }, { a: 1, b: 2 }); // true
* isShallowEqual({ a: 1, b: 2 }, { a: 1, b: 3 }); // false
* ```
*
* ```ts
* pipe({ a: 1, b: 2 }, isShallowEqual({ a: 1, b: 2 })); // true
* pipe({ a: 1, b: 2 }, isShallowEqual({ a: 1, b: 3 })); // false
* ```
*/
declare const isShallowEqual: {
<T extends object, U extends T>(source: U): (target: T) => target is U;
<T extends object, U extends T>(target: T, source: U): target is U;
};
//#endregion
export { isShallowEqual };