UNPKG

@nestjs/core

Version:

Nest - modern, fast, powerful node.js web framework (@core)

8 lines (7 loc) 242 B
export function getSortedHierarchyLevels(groups, order = 'ASC') { const comparator = order === 'ASC' ? (a, b) => a - b : (a, b) => b - a; const levels = Array.from(groups.keys()).sort(comparator); return levels; }