MCPcopy
hub / github.com/mongodb/node-mongodb-native / isPair

Function isPair

src/sort.ts:58–68  ·  view source on GitHub ↗

@internal

(t: Sort)

Source from the content-addressed store, hash-verified

56
57/** @internal */
58function isPair(t: Sort): t is readonly [string, SortDirection] {
59 if (Array.isArray(t) && t.length === 2) {
60 try {
61 prepareDirection(t[1]);
62 return true;
63 } catch {
64 return false;
65 }
66 }
67 return false;
68}
69
70function isDeep(t: Sort): t is ReadonlyArray<readonly [string, SortDirection]> {
71 return Array.isArray(t) && Array.isArray(t[0]);

Callers 1

formatSortFunction · 0.85

Calls 1

prepareDirectionFunction · 0.85

Tested by

no test coverage detected