mirror of
https://github.com/Kong/insomnia
synced 2024-11-12 17:26:32 +00:00
11 lines
385 B
TypeScript
11 lines
385 B
TypeScript
|
import { ascend, descend, prop, sortWith } from 'ramda';
|
||
|
|
||
|
import { isDefaultProject, isLocalProject, isRemoteProject, Project } from '../project';
|
||
|
|
||
|
export const sortProjects = <T extends Pick<Project, 'name' | 'remoteId' | '_id'>>(projects: T[]) => sortWith<T>([
|
||
|
descend(isDefaultProject),
|
||
|
descend(isLocalProject),
|
||
|
descend(isRemoteProject),
|
||
|
ascend(prop('name')),
|
||
|
], projects);
|