Multi-level sort with ts-comparer-builder
ts-comparer-builder is an easy way of creating multi-level comparer functions that can be used in Array.sort
Example
Given a (very simple) Date type
and some unordered instances of it
we can build a comparer function for it
.sortKeyx.year .thenKeyx.month .thenKeyx.day .build
and sort our list of Date
dates.sortdateComparer
so that it looks like this:
acknowledgements
Created using the wonderful https://github.com/alexjoverm/typescript-library-starter.