message: Add option to sort bib files by entry type
diff: @@ -17,11 +17,17 @@ export function bibtexSort(keys: string[], duplicates: Set<bibtexParser.Entry>):
  let r = 0
  for (const key of keys) {
  // Select the appropriate sort function
  - if (key === 'key') {
  + switch (key) {
  + case 'key':
  r = bibtexSortByKey(a, b)
  - } else if (key === 'year-desc') {
  + break
  + case 'year-desc':
  r = -bibtexSortByField('year', a, b)
  - } else {
  + break
  + case 'type':
  + r = bibtexSortByType(a, b)
  + break
  + default:
  r = bibtexSortByField(key, a, b)
  }
  // Compare until different
  @@ -77,6 +83,10 @@ function bibtexSortByKey(a: bibtexParser.Entry, b: bibtexParser.Entry): number {
  }
  }
  +function bibtexSortByType(a: bibtexParser.Entry, b: bibtexParser.Entry): number {
  + return a.entryType.localeCompare(b.entryType)
  +}
  +
  /**
  * Creates an aligned string from a bibtexParser.Entry
  * @param entry the bibtexParser.Entry
  