Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addOrderBy(orderBy) {
if (orderBy instanceof API.OrderBy) {
const uiOrderBy = new Mapping.OrderByMapping(this.uiSegmentSrv, this.entity).getUiOrderBy(orderBy);
this.query.addOrderBy(uiOrderBy);
} else if (orderBy instanceof UI.OrderBy) {
this.query.addOrderBy(orderBy);
} else {
throw new Error("OrderBy type is not supported");
}
}