Skip to content

Commit a54cc46

Browse files
refactor: Bump inquirer from 12.9.0 to 13.2.2 (#3208)
1 parent 3fc5eb3 commit a54cc46

3 files changed

Lines changed: 220 additions & 169 deletions

File tree

Parse-Dashboard/CLI/mfa.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
const crypto = require('crypto');
2-
let inquirer = require('inquirer');
3-
if (inquirer.default) {
4-
inquirer = inquirer.default;
5-
}
2+
let inquirer;
3+
const loadInquirer = async () => {
4+
if (!inquirer) {
5+
const mod = await import('inquirer');
6+
inquirer = mod.default || mod;
7+
}
8+
};
69
const OTPAuth = require('otpauth');
710
const { copy } = require('./utils.js');
811
const phrases = {
@@ -11,9 +14,10 @@ const phrases = {
1114
enterAppName: 'Enter the app name:',
1215
}
1316
const getAlgorithm = async () => {
17+
await loadInquirer();
1418
let { algorithm } = await inquirer.prompt([
1519
{
16-
type: 'list',
20+
type: 'select',
1721
name: 'algorithm',
1822
message: 'Which hashing algorithm do you want to use?',
1923
default: 'SHA1',
@@ -141,6 +145,7 @@ const showInstructions = ({ app, username, passwordCopied, encrypt, config }) =>
141145

142146
module.exports = {
143147
async createUser() {
148+
await loadInquirer();
144149
const data = {};
145150

146151
console.log('');
@@ -210,6 +215,7 @@ module.exports = {
210215
showInstructions({ app: data.app, username, passwordCopied: true, encrypt, config });
211216
},
212217
async createMFA() {
218+
await loadInquirer();
213219
console.log('');
214220
const { username, app } = await inquirer.prompt([
215221
{

0 commit comments

Comments
 (0)