File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const EXPORT_TYPES = {
4040 serialize : ( passwordArray ) =>
4141 passwordArray
4242 . map ( ( password ) => `"${ password . replaceAll ( '"' , '""' ) } "` )
43- . join ( ', \n' ) ,
43+ . join ( '\n' ) ,
4444 } ,
4545 'text/plain' : {
4646 extension : 'txt' ,
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export const PasswordGenerator = (
6666 }
6767
6868 const passwordArray = [ ] ;
69- const generatedPasswords = new Set ( ) ;
69+ const generatedPasswords = allowDuplicates ? null : new Set ( ) ;
7070 const splitter = new GraphemerConstructor ( ) ;
7171 const graphemes = splitter . splitGraphemes ( totalCharacterSet ) ;
7272 const graphemeCount = graphemes . length ;
@@ -94,11 +94,11 @@ export const PasswordGenerator = (
9494 password += graphemes [ getRandomIntInclusive ( 0 , graphemeCount - 1 ) ] ;
9595 }
9696
97- if ( ! allowDuplicates && generatedPasswords . has ( password ) ) {
97+ if ( generatedPasswords ? .has ( password ) ) {
9898 continue ;
9999 }
100100
101- generatedPasswords . add ( password ) ;
101+ generatedPasswords ? .add ( password ) ;
102102 passwordArray . push ( password ) ;
103103 }
104104
You can’t perform that action at this time.
0 commit comments