The Maslak library converts your flat object to key and value objects, and then sort it by the given array.