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

Function transform

src/connection_string.ts:655–665  ·  view source on GitHub ↗
({ name, options, values: [value] })

Source from the content-addressed store, hash-verified

653 auth: {
654 target: 'credentials',
655 transform({ name, options, values: [value] }): MongoCredentials {
656 if (!isRecord(value, ['username', 'password'] as const)) {
657 throw new MongoParseError(
658 `${name} must be an object with 'username' and 'password' properties`
659 );
660 }
661 return MongoCredentials.merge(options.credentials, {
662 username: value.username,
663 password: value.password
664 });
665 }
666 },
667 authMechanism: {
668 target: 'credentials',

Callers 2

setOptionFunction · 0.70
mapFunction · 0.50

Calls 12

isRecordFunction · 0.90
entriesFromStringFunction · 0.85
getBooleanFunction · 0.85
getIntFromOptionsFunction · 0.85
getUIntFromOptionsFunction · 0.85
matchMethod · 0.80
addMethod · 0.80
mergeMethod · 0.45
filterMethod · 0.45
hasMethod · 0.45
fromOptionsMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected