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

Function sorted

test/tools/utils.ts:315–322  ·  view source on GitHub ↗
(iterable: Iterable<T>, how: (a: T, b: T) => 0 | 1 | -1)

Source from the content-addressed store, hash-verified

313};
314
315export const sorted = <T>(iterable: Iterable<T>, how: (a: T, b: T) => 0 | 1 | -1) => {
316 if (typeof how !== 'function') {
317 throw new TypeError('must provide a "how" function to sorted');
318 }
319 const items = Array.from(iterable);
320 items.sort(how);
321 return items;
322};
323
324/**
325 * This helper method is necessary as the changes in NODE-4720 required the Topology constructor to

Callers 1

dependency.test.tsFile · 0.90

Calls 1

sortMethod · 0.45

Tested by

no test coverage detected