add message to log operator

This commit is contained in:
Dan Percic 2022-03-04 20:14:38 +02:00
parent 8d823ad673
commit f7f0bb86a6

View File

@ -20,8 +20,8 @@ export function humanize(value: string, lowercase = true): string {
return words.map(capitalize).join(' ');
}
export function log<T>(): MonoTypeOperatorFunction<T> {
return tap<T>(res => console.log(`%c[${moment().format('HH:mm:ss.SSS')}]`, 'color: yellow;', res));
export function log<T>(message = ''): MonoTypeOperatorFunction<T> {
return tap<T>(res => console.log(`%c[${moment().format('HH:mm:ss.SSS')}] ${message}`, 'color: yellow;', res));
}
export function toNumber(str: string): number {