We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4222726 commit ce5286bCopy full SHA for ce5286b
bin/mongodb-rag.js
@@ -19,10 +19,11 @@ const enquirer = new Enquirer();
19
const __dirname = path.dirname(fileURLToPath(import.meta.url));
20
21
const isValidMongoURI = (uri) => {
22
- const atlasPattern = /^mongodb\+srv:\/\/[^:]+:[^@]+@[\w-]+\.mongodb\.net\/?/;
+ const atlasPattern = /^mongodb\+srv:\/\/[^:]+:[^@]+@[\w-]+\.mongodb\.net\/[\w-]*\??(.*)?$/;
23
return atlasPattern.test(uri);
24
};
25
26
+
27
const promptWithValidation = async (promptConfig) => {
28
const response = await enquirer.prompt(promptConfig);
29
if (response[promptConfig.name] === '?') {
0 commit comments