Skip to content

Commit

Permalink
feat: remove explicit types from InjectMetric
Browse files Browse the repository at this point in the history
Implements support for NestJS v10

Closes #1770

Signed-off-by: Will Soto <willsoto@users.noreply.github.com>
  • Loading branch information
willsoto committed Jun 18, 2023
1 parent 40ca80d commit 2b6f32f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ import { getToken } from "./metrics";
* }
* ```
*/
export function InjectMetric(
name: string,
): (
target: object,
key: string | symbol | undefined,
index?: number | undefined,
) => void {
const token = getToken(name);

return Inject(token);
export function InjectMetric(name: string) {
return Inject(getToken(name));
}
4 changes: 2 additions & 2 deletions test/metrics/counter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { expect } from "chai";
import * as client from "prom-client";
import { Counter, register } from "prom-client";
import {
getToken,
InjectMetric,
makeCounterProvider,
PrometheusModule,
getToken,
makeCounterProvider,
} from "../../src";

describe("Counter", function () {
Expand Down

0 comments on commit 2b6f32f

Please sign in to comment.