import { SortOrder } from '../enums/sort-order.enum';

export type MongoSortDirection = 1 | -1;

export const resolveMongoSortDirection = (
  sortOrder?: SortOrder | null,
): MongoSortDirection => (sortOrder === SortOrder.ASC ? 1 : -1);
