File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 5252 "gen-esm-wrapper" : " ^1.1.3" ,
5353 "mocha" : " ^8.1.3" ,
5454 "nyc" : " ^15.1.0" ,
55- "ts-node" : " ^9.0.0 " ,
56- "typescript" : " ^4.0.3 "
55+ "ts-node" : " ^10.9.1 " ,
56+ "typescript" : " ^4.7.4 "
5757 },
5858 "dependencies" : {
5959 "@types/whatwg-url" : " ^8.2.1" ,
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function connectionStringHasValidScheme(connectionString: string) {
1818// Adapted from the Node.js driver code:
1919// https://github.com/mongodb/node-mongodb-native/blob/350d14fde5b24480403313cfe5044f6e4b25f6c9/src/connection_string.ts#L146-L206
2020const HOSTS_REGEX =
21- / ^ (?< protocol > [ ^ / ] + ) : \/ \/ (?: (?< username > [ ^ : ] * ) (?: : (?< password > [ ^ @ ] * ) ) ? @ ) ? (?< hosts > (? ! : ) [ ^ / ? @ ] * ) (?< rest > .* ) / ;
21+ / ^ (?< protocol > [ ^ / ] + ) : \/ \/ (?: (?< username > [ ^ : @ ] * ) (?: : (?< password > [ ^ @ ] * ) ) ? @ ) ? (?< hosts > (? ! : ) [ ^ / ? @ ] * ) (?< rest > .* ) / ;
2222
2323class CaseInsensitiveMap < K extends string = string > extends Map < K , string > {
2424 delete ( name : K ) : boolean {
Original file line number Diff line number Diff line change @@ -73,6 +73,20 @@ describe('ConnectionString', () => {
7373 isSRV : false ,
7474 hosts : [ 'localhost:12345' , 'anotherHost' ]
7575 }
76+ } ,
77+ {
78+ uri : 'mongodb://database-meow@database-haha.mongo.blah.blah.com:8888/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@database-haha@' ,
79+ match : {
80+ href : 'mongodb://database-meow@database-haha.mongo.blah.blah.com:8888/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@database-haha@' ,
81+ protocol : 'mongodb:' ,
82+ username : 'database-meow' ,
83+ password : '' ,
84+ pathname : '/' ,
85+ search : '?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@database-haha@' ,
86+ hash : '' ,
87+ isSRV : false ,
88+ hosts : [ 'database-haha.mongo.blah.blah.com:8888' ]
89+ }
7690 }
7791 ] ) {
7892 it ( `parses ${ uri } correctly` , ( ) => {
You can’t perform that action at this time.
0 commit comments