This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /******************** HELPER FUNCTION **********************/ | |
| //Filter array for any distinct values --- STACKOVERFLOW | |
| function isDistinct(array) { | |
| return new Set(array).size === array.length; | |
| } | |
| // Use combination sum to get all the possible combinations | |
| function combinationSum(candidates, target) { | |
| var result = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {CustomError} from "./error/custom-error.interface"; | |
| require('dotenv').config(); | |
| import {RequestHandler} from 'express'; | |
| import {MongoClient} from 'mongodb'; | |
| let client: MongoClient; | |
| const connectToClientIfDropped: () => Promise<void> = async () => { | |
| if (client && client.isConnected()) { |