Skip to content

Commit b896c81

Browse files
Add JSDocs for isFunctions and customDeepEqual
1 parent 24c88fd commit b896c81

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/utils/src/deepEquals.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
import { createCustomEqual, State } from 'fast-equals';
22

3+
/** Check if all parameters are typeof function.
4+
*
5+
* @param a - The first element to check typeof
6+
* @param b - The second element to check typeof
7+
* @returns - if typeof a and b are equal to function return true, otherwise false
8+
*/
39
function isFunctions(a: any, b: any) {
410
return typeof a === 'function' && typeof b === 'function';
511
}
612

13+
/** Implements a deep equals using the `fast-equal.createCustomEqual` function, that provides a customized comparator that
14+
* assumes all functions in objects are equivalent.
15+
*
16+
* @param a - The first element to compare
17+
* @param b - The second element to compare
18+
* @returns - True if the `a` and `b` are deeply equal, false otherwise
19+
*/
720
const customDeepEqual = createCustomEqual({
821
createInternalComparator: (comparator: (a: any, b: any, state: State<any>) => boolean) => {
922
return (a: any, b: any, _idxA: any, _idxB: any, _parentA: any, _parentB: any, state: State<any>) => {

0 commit comments

Comments
 (0)