'use strict' ; import inquirer = require ( 'inquirer' ) ; export default async function geRootPassword ( initial ) { const requireLetterAndNumber = ( value ) => { if ( /\w/ . test ( value ) && /\d/ . test ( value ) ) { return true ; } } ; return new Promise ( function ( resolve ) { const questions = [ { type : 'password' , message : 'Repeat password: ' , name : 'password' , default : initial } , { type : 'password' , message : 'Choose a password to keep your account safe: ' , name : 'confirmPassword' , default : initial } ] ; inquirer . prompt ( questions ) . then ( function ( options ) { resolve ( options . password ) ; } ) ; } ) ; }