@monstermann/fn
Version:
A utility library for TypeScript.
22 lines • 793 B
TypeScript
//#region src/set/isShallowEqual.d.ts
/**
* `isShallowEqual(target, source)`
*
* Checks if the `target` set and `source` set contain the same values. Returns `true` if both sets have the same size and contain identical elements, `false` otherwise.
*
* ```ts
* isShallowEqual(new Set([1, 2, 3]), new Set([3, 2, 1])); // true
* isShallowEqual(new Set([1, 2]), new Set([1, 2, 3])); // false
* ```
*
* ```ts
* pipe(new Set([1, 2, 3]), isShallowEqual(new Set([3, 2, 1]))); // true
* pipe(new Set([1, 2]), isShallowEqual(new Set([1, 2, 3]))); // false
* ```
*/
declare const isShallowEqual: {
<T>(source: ReadonlySet<NoInfer<T>>): (target: ReadonlySet<T>) => boolean;
<T>(target: ReadonlySet<T>, source: ReadonlySet<NoInfer<T>>): boolean;
};
//#endregion
export { isShallowEqual };