DeepCompare Class

Utilities to compare json objects by searching through their properties.

Methods

Name Description
constructor(numberRelTol: number1.0e-12): DeepCompare Construct comparison object with relative tolerance.  
compare(a: any, b: any, tolerance?: number): boolean Main entry for comparing deep json objects.  
compareNumber(a: number, b: number): boolean Test if a and b are within tolerance.  

Properties

Name Type Description
errorTracker any[] Array of error descriptions.  
numberRelTol number relative tolerance for declaring numeric values equal.  
propertyCounts [key: string]: number Counts of property names encountered during various searches.  
typeCounts { arrays: number, booleans: number, functions: number, numbers: number, objects: number, strings: number, undefined: number } Statistical accumulations during searchers.  

Defined in

Last Updated: 17 December, 2024