UNPKG

supergeneric

Version:

Supergeneric JS helper functions... formatters, math functions, sort functions, etc.

2 lines (1 loc) 145 B
function n(n,{descending:t=!1}={}){const e=t?1:-1,o=-e;return"function"==typeof n?(t,c)=>n(t)<n(c)?e:o:(t,c)=>t[n]<c[n]?e:o}export{n as sortBy};