File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* eslint-disable no-param-reassign */
2
+ // eslint-disable-next-line import/no-unresolved, import/extensions
3
+ import { Options } from './options' ;
4
+
5
+ function generate ( options : Options ) : string {
6
+ // Set default values for options
7
+ options = options || { } ;
8
+ if ( ! Object . prototype . hasOwnProperty . call ( options , 'length' ) )
9
+ options . length = 8 ;
10
+ if ( ! Object . prototype . hasOwnProperty . call ( options , 'numbers' ) )
11
+ options . numbers = false ;
12
+ if ( ! Object . prototype . hasOwnProperty . call ( options , 'symbols' ) )
13
+ options . symbols = false ;
14
+ if ( ! Object . prototype . hasOwnProperty . call ( options , 'uppercase' ) )
15
+ options . uppercase = true ;
16
+ if ( ! Object . prototype . hasOwnProperty . call ( options , 'lowercase' ) )
17
+ options . lowercase = true ;
18
+ if (
19
+ ! Object . prototype . hasOwnProperty . call ( options , 'excludeSimilarCharacters' )
20
+ )
21
+ options . excludeSimilarCharacters = false ;
22
+
23
+ return '' ;
24
+ }
25
+
26
+ export default generate ;
You can’t perform that action at this time.
0 commit comments