MCPcopy Create free account
hub / github.com/GarliqBread/Noteup / withPinned

Function withPinned

src/utils/sorting.ts:10–15  ·  view source on GitHub ↗
(sortFunction: NotesSortStrategy["sort"])

Source from the content-addressed store, hash-verified

8};
9
10const withPinned = (sortFunction: NotesSortStrategy["sort"]) => (a: Note, b: Note) => {
11 if (a.pinned && !b.pinned) return -1;
12 if (!a.pinned && b.pinned) return 1;
13
14 return sortFunction(a, b);
15};
16
17const createdDate: NotesSortStrategy = {
18 sort: (a: Note, b: Note): number => {

Callers 1

getNotesSorterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected