@itwin/core-backend
Version:
iTwin.js backend components
38 lines • 1.58 kB
TypeScript
interface DeepEqualOpts {
/**
* Tolerance for number fields, if not defined will be 1e-10
* If you don't want a tolerance, either supply 0 or use regular .deep.equal
*/
tolerance?: number;
/** e.g. consider {x: undefined} and {} as deeply equal */
considerNonExistingAndUndefinedEqual?: boolean;
/** Specify standard property keys holding ec class identifiers (when true, `classFullName` and `relClassName`)
* to be normalized during comparison so that differently cased and alternative syntax still is considered equal
* Passing `true`, is the same as passing `["classFullName", "relClassName"]`
*/
normalizeClassNameProps?: boolean | string[];
}
export declare const defaultOpts: {
readonly tolerance: 1e-10;
readonly considerNonExistingAndUndefinedEqual: false;
};
declare global {
namespace Chai {
interface Deep {
advancedEqual(actual: any, options?: DeepEqualOpts): Assertion;
subsetEqual(actual: any, options?: DeepEqualOpts): Assertion;
}
}
}
interface AdvancedEqualFuncOpts extends DeepEqualOpts {
/** only test */
useSubsetEquality?: boolean;
}
/**
* The diff shown on failure will show undefined fields as part of the diff even if
* consideringNonExistingAndUndefinedEqual is true. You can ignore that.
* We would have to mutate the object to clean the diff, although it is worth considering.
*/
export declare function advancedDeepEqual(e: any, a: any, options?: AdvancedEqualFuncOpts): boolean;
export {};
//# sourceMappingURL=AdvancedEqual.d.ts.map