From 7de8c225215a6adaf2963e5924ec5d3353f2f560 Mon Sep 17 00:00:00 2001 From: lruzicki <56487722+lruzicki@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:36:49 +0200 Subject: [PATCH] Update passwordGenerator.js --- src/helpers/passwordGenerator.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/helpers/passwordGenerator.js b/src/helpers/passwordGenerator.js index 69b82bc..4f3698c 100644 --- a/src/helpers/passwordGenerator.js +++ b/src/helpers/passwordGenerator.js @@ -25,18 +25,15 @@ export const passwordGenerator = (options) => { const categoriesArray = getCategoriesArray(); - // Select at least one character from each selected category categoriesArray.forEach((category) => { password += getRandomOfType(category); }); - // Fill the rest of the password with random characters for (let i = categoriesArray.length; i < length; i++) { const randomCategory = categoriesArray[getSafeRandomNumberArray(1, categoriesArray.length)]; password += getRandomOfType(randomCategory); } - // Shuffle the password to randomize the positions of characters password = shuffle(password); return password;