File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ const OPTIONS = {
8787 "greedy-arrays" : true ,
8888 "short-option-groups" : false ,
8989 } ,
90- } ;
90+ } as const ;
9191
9292function isConnectionSpecifier ( arg : string | undefined ) : boolean {
9393 return (
@@ -185,14 +185,15 @@ function getExportsPath(): string {
185185// are prefixed with `MDB_MCP_` and the keys match the UserConfig keys, but are converted
186186// to SNAKE_UPPER_CASE.
187187function parseEnvConfig ( env : Record < string , unknown > ) : Partial < UserConfig > {
188+ const CONFIG_WITH_URLS : Set < string > = new Set < ( typeof OPTIONS ) [ "string" ] [ number ] > ( [ "connectionString" ] ) ;
189+
188190 function setValue ( obj : Record < string , unknown > , path : string [ ] , value : string ) : void {
189191 const currentField = path . shift ( ) ;
190192 if ( ! currentField ) {
191193 return ;
192194 }
193195 if ( path . length === 0 ) {
194- // MongoDB URLs must not be preprocessed
195- if ( typeof value === "string" && ( value . startsWith ( "mongodb://" ) || value . startsWith ( "mongodb+srv://" ) ) ) {
196+ if ( CONFIG_WITH_URLS . has ( currentField ) ) {
196197 obj [ currentField ] = value ;
197198 return ;
198199 }
You can’t perform that action at this time.
0 commit comments