Skip to content

Commit

Permalink
fix: decorator types (#1685)
Browse files Browse the repository at this point in the history
I found this issue #1667 that had the same errors as me, but the comments didn't help. I also found a different issue nestjs/nest#10959, and the fix they used nestjs/nest#10970, and used that to fix the problem with the InjectMetric decorator.

The problem is that the decorator types are wrong. Record<string, unknown> fails with strict checks, and the key may also be undefined.

Fixes #1667
  • Loading branch information
Nicklason authored Apr 7, 2023
1 parent 3b55ea5 commit 6f8a52e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import { getToken } from "./metrics";
export function InjectMetric(
name: string,
): (
target: Record<string, unknown>,
key: string | symbol,
target: object,
key: string | symbol | undefined,
index?: number | undefined,
) => void {
const token = getToken(name);
Expand Down

0 comments on commit 6f8a52e

Please sign in to comment.