@@ -82,7 +82,7 @@ export async function deleteKeysViaCli(keyData: KeyData): Promise<void> {
82
82
* @param keyArguments The arguments of key
83
83
*/
84
84
export async function populateDBWithHashes ( host : string , port : string , keyArguments : AddKeyArguments ) : Promise < void > {
85
- const dbConf = { host , port : Number ( port ) } ;
85
+ const dbConf = { port : Number . parseInt ( port ) , host , username : 'default' } ;
86
86
const client = createClient ( dbConf ) ;
87
87
88
88
await client . on ( 'error' , async function ( error : string ) {
@@ -110,7 +110,7 @@ export async function populateDBWithHashes(host: string, port: string, keyArgume
110
110
* @param keyArguments The arguments of key and its fields
111
111
*/
112
112
export async function populateHashWithFields ( host : string , port : string , keyArguments : AddKeyArguments ) : Promise < void > {
113
- const dbConf = { host , port : Number ( port ) } ;
113
+ const dbConf = { port : Number . parseInt ( port ) , host , username : 'default' } ;
114
114
const client = createClient ( dbConf ) ;
115
115
const fields : string [ ] = [ ] ;
116
116
@@ -141,7 +141,7 @@ export async function populateHashWithFields(host: string, port: string, keyArgu
141
141
* @param keyArguments The arguments of key and its members
142
142
*/
143
143
export async function populateListWithElements ( host : string , port : string , keyArguments : AddKeyArguments ) : Promise < void > {
144
- const dbConf = { host , port : Number ( port ) } ;
144
+ const dbConf = { port : Number . parseInt ( port ) , host , username : 'default' } ;
145
145
const client = createClient ( dbConf ) ;
146
146
const elements : string [ ] = [ ] ;
147
147
@@ -171,7 +171,7 @@ export async function populateListWithElements(host: string, port: string, keyAr
171
171
* @param keyArguments The arguments of key and its members
172
172
*/
173
173
export async function populateSetWithMembers ( host : string , port : string , keyArguments : AddKeyArguments ) : Promise < void > {
174
- const dbConf = { host , port : Number ( port ) } ;
174
+ const dbConf = { port : Number . parseInt ( port ) , host , username : 'default' } ;
175
175
const client = createClient ( dbConf ) ;
176
176
const members : string [ ] = [ ] ;
177
177
@@ -201,7 +201,7 @@ export async function populateSetWithMembers(host: string, port: string, keyArgu
201
201
* @param keyArguments The arguments of key and its members
202
202
*/
203
203
export async function populateZSetWithMembers ( host : string , port : string , keyArguments : AddKeyArguments ) : Promise < void > {
204
- const dbConf = { host , port : Number ( port ) } ;
204
+ const dbConf = { port : Number . parseInt ( port ) , host , username : 'default' } ;
205
205
let minScoreValue : - 10 ;
206
206
let maxScoreValue : 10 ;
207
207
const client = createClient ( dbConf ) ;
@@ -233,7 +233,7 @@ export async function populateSetWithMembers(host: string, port: string, keyArgu
233
233
* @param port The port of database
234
234
*/
235
235
export async function deleteAllKeysFromDB ( host : string , port : string ) : Promise < void > {
236
- const dbConf = { host , port : Number ( port ) } ;
236
+ const dbConf = { port : Number . parseInt ( port ) , host , username : 'default' } ;
237
237
const client = createClient ( dbConf ) ;
238
238
239
239
await client . on ( 'error' , async function ( error : string ) {
0 commit comments