refactor: update dependencies

This commit is contained in:
Rainer Killinger
2020-03-10 10:56:20 +01:00
committed by Rainer Killinger
parent edc6e6fad5
commit 9de064756a
6 changed files with 1426 additions and 775 deletions

View File

@@ -30,7 +30,7 @@ export type RecursivePartial<T> = {
*
* @param obj Object to delete undefined properties from
*/
export function deleteUndefinedProperties(obj: unknown) {
export function deleteUndefinedProperties(obj: unknown): unknown {
// return atomic data types and arrays (recursion anchor)
if (typeof obj !== 'object' || Array.isArray(obj)) {
return obj;

View File

@@ -205,7 +205,7 @@ export class SMTP extends VerifiableTransport {
const config = {
...smtpConfig,
// deleting undefined properties so the actual config doesn't get overwritten by undefined values
...deleteUndefinedProperties(envConfig),
...(deleteUndefinedProperties(envConfig) as object),
} as SMTPConfig;
if (typeof config.host === 'undefined') {

View File

@@ -12,10 +12,8 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import * as moment from 'moment';
import {LogLevel} from '../logger';
import {Transformation} from '../transformation';
/**
* Transformation that adds a timestamp to output
*/
@@ -38,6 +36,7 @@ export class Timestamp implements Transformation {
* @param output Output to add timestamp to
*/
transform(_logLevel: LogLevel, output: string): string {
const moment = require('moment');
const now = moment();
return `[${now.format(this.format)}] ${output}`;