@@ -118,25 +118,25 @@ export namespace TestValidator {
118118 * ```;
119119 *
120120 * @param title - Descriptive title used in error messages when values differ
121- * @param x - The first value to compare
121+ * @param X - The first value to compare
122122 * @param y - The second value to compare (can be null or undefined)
123123 * @param exception - Optional filter function to exclude specific keys from
124124 * comparison
125125 * @throws Error with detailed diff information when values are not equal
126126 */
127- export function equals < T > (
127+ export function equals < X , Y extends X > (
128128 title : string ,
129- x : T ,
130- y : T | null | undefined ,
129+ X : X ,
130+ y : Y | null | undefined ,
131131 exception ?: ( key : string ) => boolean ,
132132 ) : void {
133- const diff : string [ ] = json_equal_to ( exception ?? ( ( ) => false ) ) ( x ) ( y ) ;
133+ const diff : string [ ] = json_equal_to ( exception ?? ( ( ) => false ) ) ( X ) ( y ) ;
134134 if ( diff . length )
135135 throw new Error (
136136 [
137137 `Bug on ${ title } : found different values - [${ diff . join ( ", " ) } ]:` ,
138138 "\n" ,
139- JSON . stringify ( { x, y } , null , 2 ) ,
139+ JSON . stringify ( { x : X , y } , null , 2 ) ,
140140 ] . join ( "\n" ) ,
141141 ) ;
142142 }
@@ -175,10 +175,10 @@ export namespace TestValidator {
175175 * comparison
176176 * @throws Error when values are equal (indicating validation failure)
177177 */
178- export function notEquals < T > (
178+ export function notEquals < X , Y extends X > (
179179 title : string ,
180- x : T ,
181- y : T | null | undefined ,
180+ x : X ,
181+ y : Y | null | undefined ,
182182 exception ?: ( key : string ) => boolean ,
183183 ) : void {
184184 const diff : string [ ] = json_equal_to ( exception ?? ( ( ) => false ) ) ( x ) ( y ) ;
@@ -349,10 +349,10 @@ export namespace TestValidator {
349349 * @param trace - Optional flag to enable debug logging (default: false)
350350 * @throws Error when entity order differs between expected and actual results
351351 */
352- export const index = < Summary extends IEntity < any > > (
352+ export const index = < X extends IEntity < any > , Y extends X > (
353353 title : string ,
354- expected : Summary [ ] ,
355- gotten : Summary [ ] ,
354+ expected : X [ ] ,
355+ gotten : Y [ ] ,
356356 trace : boolean = false ,
357357 ) : void => {
358358 const length : number = Math . min ( expected . length , gotten . length ) ;
0 commit comments