Skip to content

Commit 38b74a9

Browse files
committed
Included return instruction log of generate functions in browser env
1 parent 47384f4 commit 38b74a9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

generate-ip/src/generate-ip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const ipv4 = {
5151
`ipv4.generate() » IPv4 address${ options.qty > 1 ? 'es' : '' } generated!`);
5252
if (options.qty === 1) console.info(
5353
`ipv4.generate() » ${ ipResult }`);
54-
else if (typeof require !== 'undefined' && !require.main.filename.endsWith('cli.js')) console.info(
54+
else if (typeof require == 'undefined' || !require.main.filename.endsWith('cli.js')) console.info(
5555
'ipv4.generate() » Check returned array.' );
5656
}
5757
return ipResult;

generate-pw/src/generate-pw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function generatePassword(options = {}) {
8989
if (options.verbose && !fromGeneratePasswords) {
9090
console.info(
9191
'generatePassword() » Password generated!');
92-
if (typeof require !== 'undefined' && !require.main.filename.endsWith('cli.js')) console.info(
92+
if (typeof require == 'undefined' || !require.main.filename.endsWith('cli.js')) console.info(
9393
'generatePassword() » Check returned string.');
9494
}
9595
return password;
@@ -128,7 +128,7 @@ function generatePasswords(qty, options = {}) {
128128
// Log/return final result
129129
if (options.verbose) console.info(
130130
`generatePasswords() » Password${ qty > 1 ? 's' : '' } generated!`);
131-
if (typeof require !== 'undefined' && !require.main.filename.endsWith('cli.js')) console.info(
131+
if (typeof require == 'undefined' || !require.main.filename.endsWith('cli.js')) console.info(
132132
'generatePasswords() » Check returned array.');
133133
return passwords;
134134
}

0 commit comments

Comments
 (0)