mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
workspace: add oxlint
This commit is contained in:
18 files changed
+120
-44
No files matched your search
@@ -16,7 +16,7 @@ export function createRegistry(ctx: Context) {
|
||||
function createMetric<Q extends string, T extends (new (a: any) => Metric<Q>)>(
|
||||
C: T, name: string, help: string, extra?: T extends new (a: infer R) => any ? Partial<R> : never,
|
||||
): T extends (new (a) => Gauge<Q>) ? Gauge<Q> : T extends (new (a) => Counter<Q>) ? Counter<Q> : Metric<Q> {
|
||||
const metric = new C({ name, help, ...(extra || {}) });
|
||||
const metric = new C({ name, help, ...extra });
|
||||
registry.registerMetric(metric);
|
||||
return metric as any;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user