Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return values.sort((v1: V, v2: V) => {
return ObjectUtils.naturalCompare(
clause.valueAccessor(v1),
clause.valueAccessor(v2),
clause.direction,
clause.nullsFirst
);
});
}
return data.sort((a, b) => {
const propertyA: number | string = ObjectUtils.resolve(
a,
this._sort.active
);
const propertyB: number | string = ObjectUtils.resolve(
b,
this._sort.active
);
return ObjectUtils.naturalCompare(
propertyB,
propertyA,
this._sort.direction
);
});
}