Skip to content

Commit

Permalink
WIP: createLogger derive TKey from array of opts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitsunee committed Nov 14, 2024
1 parent 8462599 commit c8217cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/LogLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface MessageTemplate {
utc?: boolean;
}

interface LogLevelOpts {
export interface LogLevelOpts {
/**
* Name of the log level
*/
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable */

interface LogLevel {
level: number;
}
import type { LogLevelOpts } from "./LogLevel";

function createLogger<TKey extends string>(levels: Record<TKey, LogLevel>) {
return {} as Record<TKey, () => void>;
function createLogger<TKey extends string>(
levels: Array<LogLevelOpts & { name: TKey }>
) {
return {} as Record<Lowercase<TKey>, () => void>;
}

0 comments on commit c8217cd

Please sign in to comment.