({
column,
desc,
}: {
column?: keyof typeof sortFunctions;
desc: boolean;
})
| 317 | } |
| 318 | |
| 319 | export function makeSort({ |
| 320 | column, |
| 321 | desc, |
| 322 | }: { |
| 323 | column?: keyof typeof sortFunctions; |
| 324 | desc: boolean; |
| 325 | }): Comparer<Flow> { |
| 326 | if (!column) { |
| 327 | return (_a, _b) => 0; |
| 328 | } |
| 329 | const sortKeyFun = sortFunctions[column]; |
| 330 | return (a, b) => { |
| 331 | const ka = sortKeyFun(a); |
| 332 | const kb = sortKeyFun(b); |
| 333 | // @ts-expect-error undefined is fine |
| 334 | if (ka > kb) { |
| 335 | return desc ? -1 : 1; |
| 336 | } |
| 337 | // @ts-expect-error undefined is fine |
| 338 | if (ka < kb) { |
| 339 | return desc ? 1 : -1; |
| 340 | } |
| 341 | return 0; |
| 342 | }; |
| 343 | } |
| 344 | |
| 345 | export function selectRelative(flows: FlowsState, shift: number) { |
| 346 | const lastSelected: Flow | undefined = |
no outgoing calls
no test coverage detected
searching dependent graphs…