mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
fix: build
This commit is contained in:
@@ -63,7 +63,7 @@ export function deleteUndefinedProperties(object: unknown): unknown {
|
||||
* Checks if environment is Node.js
|
||||
*/
|
||||
export function isNodeEnvironment(): boolean {
|
||||
return Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';
|
||||
return Object.prototype.toString.call(typeof process === 'undefined' ? 0 : process) === '[object process]';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -175,10 +175,12 @@ export class Logger {
|
||||
|
||||
// Fallback to log everything, or not exiting
|
||||
switch (level) {
|
||||
case 'LOG':
|
||||
case 'LOG': {
|
||||
return Logger.logLevelSum;
|
||||
case 'EXIT':
|
||||
}
|
||||
case 'EXIT': {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,13 +191,13 @@ export class SMTP extends VerifiableTransport {
|
||||
password: process.env.SMTP_AUTH_PASSWORD,
|
||||
user: process.env.SMTP_AUTH_USER,
|
||||
},
|
||||
cc: typeof process.env.SMTP_CC !== 'undefined' ? (process.env.SMTP_CC as string).split(',') : [],
|
||||
cc: typeof process.env.SMTP_CC === 'undefined' ? [] : (process.env.SMTP_CC as string).split(','),
|
||||
host: process.env.SMTP_HOST,
|
||||
port:
|
||||
typeof process.env.SMTP_PORT !== 'undefined' ? Number.parseInt(process.env.SMTP_PORT, 10) : undefined,
|
||||
typeof process.env.SMTP_PORT === 'undefined' ? undefined : Number.parseInt(process.env.SMTP_PORT, 10),
|
||||
recipients:
|
||||
typeof process.env.SMTP_RECIPIENTS !== 'undefined' ? process.env.SMTP_RECIPIENTS.split(',') : [],
|
||||
secure: typeof process.env.SMTP_SECURE !== 'undefined' ? process.env.SMTP_SECURE === 'true' : false,
|
||||
typeof process.env.SMTP_RECIPIENTS === 'undefined' ? [] : process.env.SMTP_RECIPIENTS.split(','),
|
||||
secure: typeof process.env.SMTP_SECURE === 'undefined' ? false : process.env.SMTP_SECURE === 'true',
|
||||
sender: {
|
||||
mail: process.env.SMTP_SENDER_MAIL,
|
||||
name: process.env.SMTP_SENDER_NAME,
|
||||
@@ -262,14 +262,14 @@ export class SMTP extends VerifiableTransport {
|
||||
throw new Error('Invalid recipients found');
|
||||
}
|
||||
|
||||
if (typeof config.cc !== 'undefined') {
|
||||
if (typeof config.cc === 'undefined') {
|
||||
this.cc = [];
|
||||
} else {
|
||||
if (SMTP.isValidRecipientsList(config.cc)) {
|
||||
this.cc = config.cc;
|
||||
} else {
|
||||
throw new Error('Invalid cc recipients found');
|
||||
}
|
||||
} else {
|
||||
this.cc = [];
|
||||
}
|
||||
|
||||
this.from = config.sender;
|
||||
@@ -284,7 +284,7 @@ export class SMTP extends VerifiableTransport {
|
||||
},
|
||||
host: config.host,
|
||||
port: config.port,
|
||||
secure: typeof config.secure !== 'undefined' ? config.secure : false,
|
||||
secure: typeof config.secure === 'undefined' ? false : config.secure,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ export class SMTP extends VerifiableTransport {
|
||||
return this.sendMail({
|
||||
cc: this.cc,
|
||||
// use an address block if name is available, mail otherwise
|
||||
from: typeof this.from.name !== 'string' ? `${this.from.name} <${this.from.mail}>` : this.from.mail,
|
||||
from: typeof this.from.name === 'string' ? this.from.mail : `${this.from.name} <${this.from.mail}>`,
|
||||
subject: subject,
|
||||
text: message,
|
||||
to: this.recipients,
|
||||
|
||||
Reference in New Issue
Block a user