MCPcopy Create free account
hub / github.com/clientdb/clientdb / resolveSortInput

Function resolveSortInput

core/query.ts:54–64  ·  view source on GitHub ↗
(
  sort?: EntityQuerySortInput<Data, View>
)

Source from the content-addressed store, hash-verified

52 : never;
53
54export function resolveSortInput<Data, View>(
55 sort?: EntityQuerySortInput<Data, View>
56): EntityQuerySortConfig<Data, View> | null {
57 if (!sort) return null;
58
59 if (typeof sort === "function") {
60 return { sort, direction: "desc" };
61 }
62
63 return sort;
64}
65
66type MaybeObservableArray<T> = IObservableArray<T> | T[];
67

Callers 2

createEntityStoreFunction · 0.90
createEntityQueryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected