Skip to content

Commit

Permalink
fix: widen type for logger tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kshutkin committed Dec 2, 2021
1 parent 8f6af4e commit 7b2b936
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions logger/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Action, Appender, LogLevel, LogMessage, Identity } from './types';

let globalInputId = 0;

export function createLogger<ErrorContext = Error>(...args: [] | [string | Identity] | [string, Identity]) {
export function createLogger<ErrorContext = Error>(...args: [] | [string | Identity | undefined] | [string, Identity]) {
let initialLogLevel: number = LogLevel.info;

const inputId = globalInputId++;
Expand Down Expand Up @@ -66,7 +66,7 @@ export function createLogger<ErrorContext = Error>(...args: [] | [string | Ident
}
}

function getOptions(options: [] | [string | Identity] | [string, Identity]): { tag?: string, parentId?: number } {
function getOptions(options: [] | [string | Identity | undefined] | [string, Identity]): { tag?: string, parentId?: number } {
let parentId, tag;
if (options.length === 1) {
if (typeof options[0] === 'string') {
Expand Down

0 comments on commit 7b2b936

Please sign in to comment.