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

Function removeAuthFromConnectionString

test/tools/utils.ts:230–243  ·  view source on GitHub ↗
(connectionString: string)

Source from the content-addressed store, hash-verified

228}
229
230export function removeAuthFromConnectionString(connectionString: string) {
231 const indices = getIndicesOfAuthInUrl(connectionString);
232 if (!indices) {
233 return connectionString;
234 }
235
236 const { start, end } = indices;
237
238 if (start === -1 || end === -1) {
239 return connectionString;
240 }
241
242 return connectionString.slice(0, start) + connectionString.slice(end + 1);
243}
244
245export function extractAuthFromConnectionString(connectionString: string | any[]) {
246 const indices = getIndicesOfAuthInUrl(connectionString);

Callers

nothing calls this directly

Calls 1

getIndicesOfAuthInUrlFunction · 0.85

Tested by

no test coverage detected