import { Comparer } from "./Comparer" ; /**
 * Compares two values based on one of their properties.
 */ export class PropertyComparer < TValue , TProperty > implements Comparer < TValue > { param getProperty param comparer constructor ( private readonly getProperty , private readonly comparer ) { } inheritdoc compareTo ( a , b ) { return this . comparer . compareTo ( this . getProperty ( a ) , this . getProperty ( b ) ) ; } }