import { EditionId , EditionsList , IssueSummary } from '.' ; import { defaultRegionalEditions } from './editions-defaults' ; export const issueSummaryComparator = ( a , b ) => { return a . date . localeCompare ( b . date ) ; } ; export const issueSummarySort = ( issues ) : IssueSummary [ ] => { return issues . sort ( issueSummaryComparator ) . reverse ( ) ; } ; export const getEditionIds = ( editionList ) : EditionId [ ] => editionList ? editionList . regionalEditions . map ( e => e . edition ) . concat ( editionList . specialEditions . map ( e => e . edition ) ) : defaultRegionalEditions . map ( e => e . edition ) ;