UNPKG

@nestjs/core

Version:

The core of NestJS, a TypeScript framework for Node.js backends: modules, dependency injection and the request pipeline, on Express, Fastify or node:http.

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; }