Closed
Description
Hi! To clarify the title, the following code:
/**
*
* Adds equality functions to a data object. This freezes an object.
* HashCode is lazily evaluated and memoized.
*
* @param <D> The type of the data object
* @param data The data object to add equality to
* @param equals The equality function
* @param hashCode The hash code function
*
* @returns The data object with equality added
*/
export default function <D extends Record<string, unknown>>(
data: D,
equals: (a: D, b: D) => boolean,
hashCode: (data: D) => number
): D & HasEquals {
// ....
}
Needs @param hashCode.__type
and @param equals.__type
, else validation will show the following:
./src/lib/utils/addEquality.ts:20:10 - warning addEquality.equals.__type does not have any documentation.
20 equals: (a: D, b: D) => boolean,
./src/lib/utils/addEquality.ts:21:12 - warning addEquality.hashCode.__type does not have any documentation.
21 hashCode: (data: D) => number
Metadata
Metadata
Assignees
Labels
No labels