From 020f8ebe6dc28a0d0e596ffe064f7d4c8e091e87 Mon Sep 17 00:00:00 2001 From: EvolutionX Date: Mon, 9 May 2022 23:01:26 +0530 Subject: [PATCH] style: prettier things --- src/commands/init.js | 2 +- src/prompts/init.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/commands/init.js b/src/commands/init.js index 4ebff08..05c1cd9 100644 --- a/src/commands/init.js +++ b/src/commands/init.js @@ -25,7 +25,7 @@ export async function init({ flags }) { } const node = await execa('node', ['--version']); - if ((/v1(([0-6]\.[2-9])|([0-5]\.[0-9]))/gm).test(node.stdout)) { + if (/v1(([0-6]\.[2-9])|([0-5]\.[0-9]))/gm.test(node.stdout)) { console.log( yellowBright( `\nYou are using Node ${node.stdout}\nPlease upgrade to Node 16.10.x or higher!\n` diff --git a/src/prompts/init.js b/src/prompts/init.js index 56eec0e..6827465 100644 --- a/src/prompts/init.js +++ b/src/prompts/init.js @@ -68,10 +68,12 @@ export const token = { type: 'password', validate: (/** @type {string} */ token) => { if (token === 'no') return true; - return (/(?mfa\.[a-z0-9_-]{20,})|(?[a-z0-9_-]{23,28}\.[a-z0-9_-]{6,7}\.[a-z0-9_-]{27})/i).test(token) + return /(?mfa\.[a-z0-9_-]{20,})|(?[a-z0-9_-]{23,28}\.[a-z0-9_-]{6,7}\.[a-z0-9_-]{27})/i.test( + token + ) ? true - : 'Invalid token' - } + : 'Invalid token'; + }, }; export const main_dir = {