From 35715ef8fe7f093c67aee3ea68ab814037564120 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 30 Apr 2026 11:43:54 +0100 Subject: [PATCH] Improve typing of `cloneCredential` --- src/start-proxy/validation.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/start-proxy/validation.ts b/src/start-proxy/validation.ts index 878f2eb4d..6603a4776 100644 --- a/src/start-proxy/validation.ts +++ b/src/start-proxy/validation.ts @@ -7,10 +7,10 @@ import type { AuthConfig, UsernamePassword } from "./types"; import * as types from "./types"; /** Constructs a new object from `obj` with only keys that exist in `schema`. */ -export function cloneCredential< - T extends json.FromSchema, - S extends json.Schema, ->(schema: S, obj: T): T { +export function cloneCredential( + schema: S, + obj: json.FromSchema, +): json.FromSchema { const result = {}; for (const key of Object.keys(schema)) { @@ -21,7 +21,7 @@ export function cloneCredential< result[key] = obj[key]; } - return result as T; + return result as json.FromSchema; } /** Extracts an `AuthConfig` value from `config`. */