@qntm-code/utils
Version:
A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.
15 lines (14 loc) • 746 B
TypeScript
export type IndividualEqualityType = null | undefined | boolean | number | string | Date | object | Function;
export type EqualityType = IndividualEqualityType | IndividualEqualityType[];
/**
* Performs a deep comparison between two values to determine if they are equivalent.
*
* **Note:** This method supports comparing nulls, undefineds, booleans, numbers, strings, Dates, objects, Functions, Arrays, RegExs, Maps, Sets, and Typed Arrays.
*
* Object objects are compared by their own, not inherited, enumerable properties.
*
* Functions and DOM nodes are compared by strict equality, i.e. ===.
*
* The order of the array items must be the same for the arrays to be equal.
*/
export declare function isEqual(a: any, b: any): boolean;