UNPKG

pose-core

Version:

Factory for Pose animation state machines

13 lines (10 loc) 282 B
export const sortByReversePriority = (priorityOrder: string[]) => ( a: string, b: string ) => { const aP = priorityOrder.indexOf(a); const bP = priorityOrder.indexOf(b); if (aP === -1 && bP !== -1) return -1; if (aP !== -1 && bP === -1) return 1; return aP - bP; };