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

Function objectToMap

src/sort.ts:100–106  ·  view source on GitHub ↗

@internal

(t: { readonly [key: string]: SortDirection })

Source from the content-addressed store, hash-verified

98
99/** @internal */
100function objectToMap(t: { readonly [key: string]: SortDirection }): SortForCmd {
101 const sortEntries: SortPairForCmd[] = Object.entries(t).map(([k, v]) => [
102 `${k}`,
103 prepareDirection(v)
104 ]);
105 return new Map(sortEntries);
106}
107
108/** @internal */
109function mapToMap(t: ReadonlyMap<string, SortDirection>): SortForCmd {

Callers 1

formatSortFunction · 0.85

Calls 2

prepareDirectionFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected