import { get } from 'lodash' ; /**
 * The sort direction possibilities.
 */ type SortDirection = 'asc' | 'desc' ; /**
 * A list of possible framework sort options.
 */ export type FrameworkSort = 'framework' | 'name' ; export const sortOptions = { framework : 'Running order' , name : 'Name' } ; export const sortDirections = { framework : 'asc' , name : 'asc' } ; param sort export function sortDisplayName ( sort ) { return get ( sortOptions , sort , 'Unknown sort' ) ; } param direction export function reverseDirection ( direction ) { return direction === 'asc' ? 'desc' : 'asc' ; } param sort param reverse export function sortDirection ( sort , reverse ) { const direction = get ( sortDirections , sort , 'asc' ) ; return reverse ? reverseDirection ( direction ) : direction ; }