docs(typedoc): document function examples

This commit is contained in:
2024-03-12 20:42:34 +02:00
parent ec41aebad9
commit fdb28fa612
10 changed files with 179 additions and 17 deletions

View File

@@ -22,8 +22,26 @@
*
* @remarks uses JSON.stringify()
*
* @param obj1 - first object to compare with second
* @param obj2 - second object to compare with first
* @example
* ```ts
* // prints false
* console.log(isDeepWeakEqual({ a: 1 }, ["lorem"]))
*
* // prints true
* console.log(isDeepWeakEqual({ a: 1 }, { a: 1 }))
*
* // prints true
* // snippet displaying the weak equality of this function
* console.log(
* isDeepWeakEqual(
* { date: "2024-03-12T18:19:50.548Z" },
* { date: new Date(1710267590548) },
* ),
* );
* ```
*
* @param obj1 - first object for comparison
* @param obj2 - second object for comparison
* @returns true if equal
*/
export const isDeepWeakEqual = (obj1: object, obj2: object) =>