MCPcopy
hub / github.com/omkarcloud/botasaurus / getSortKey

Function getSortKey

js/botasaurus-server-js/src/sorts.ts:30–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 protected abstract getLabel(): string;
29
30 protected getSortKey(): (item: any) => any {
31
32 return (item: any) => {
33 const value = item[this.field];
34
35 if (isNullish(value)) {
36 const noneValue = this.reverse ? [0] : [3];
37 return noneValue;
38 }
39
40 return typeof value === 'number' ? [1, value] : [2, value];
41 };
42 }
43
44 private compareSortKeys(keyA: any, keyB: any): number {
45 if (Array.isArray(keyA) && Array.isArray(keyB)) {

Callers

nothing calls this directly

Calls 2

isNullishFunction · 0.90
isNotNullishFunction · 0.90

Tested by

no test coverage detected