Skip to content

Commit 61b469e

Browse files
authored
fix(NODE-4626): remove nested import logic (#7)
1 parent 5a528f6 commit 61b469e

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/index.js

-13
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,12 @@ const classesWithAsyncAPIs = new Map([
3939
['GridFSBucket', makeLegacyGridFSBucket],
4040
['ClientSession', makeLegacyClientSession],
4141
['MongoClient', makeLegacyMongoClient],
42-
43-
// Need to be exported top-level still
4442
['ClientSession', makeLegacyClientSession],
4543
['GridFSBucketWriteStream', makeLegacyGridFSBucketWriteStream],
4644
['OrderedBulkOperation', makeLegacyOrderedBulkOperation],
4745
['UnorderedBulkOperation', makeLegacyUnorderedBulkOperation]
4846
]);
4947

50-
const TODO_SPECIAL_IMPORTS = new Map([
51-
['ClientSession', '/lib/sessions'],
52-
['GridFSBucketWriteStream', '/lib/gridfs/upload'],
53-
['OrderedBulkOperation', '/lib/bulk/ordered'],
54-
['UnorderedBulkOperation', '/lib/bulk/unordered']
55-
]);
56-
57-
for (const [missingTopLevelClassName, location] of TODO_SPECIAL_IMPORTS) {
58-
mongodb[missingTopLevelClassName] = require(`mongodb${location}`)[missingTopLevelClassName];
59-
}
60-
6148
for (const [mongodbExportName, mongodbExportValue] of Object.entries(mongodb)) {
6249
let makeLegacyClass = classesWithAsyncAPIs.get(mongodbExportName);
6350
if (makeLegacyClass != null) {

0 commit comments

Comments
 (0)