mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
02c65a852d
Co-authored-by: Opender Singh <opender94@gmail.com>
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);
|