Skip to content

Commit 35715ef

Browse files
committed
Improve typing of cloneCredential
1 parent 0ed734b commit 35715ef

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/start-proxy/validation.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import type { AuthConfig, UsernamePassword } from "./types";
77
import * as types from "./types";
88

99
/** Constructs a new object from `obj` with only keys that exist in `schema`. */
10-
export function cloneCredential<
11-
T extends json.FromSchema<S>,
12-
S extends json.Schema,
13-
>(schema: S, obj: T): T {
10+
export function cloneCredential<S extends json.Schema>(
11+
schema: S,
12+
obj: json.FromSchema<S>,
13+
): json.FromSchema<S> {
1414
const result = {};
1515

1616
for (const key of Object.keys(schema)) {
@@ -21,7 +21,7 @@ export function cloneCredential<
2121
result[key] = obj[key];
2222
}
2323

24-
return result as T;
24+
return result as json.FromSchema<S>;
2525
}
2626

2727
/** Extracts an `AuthConfig` value from `config`. */

0 commit comments

Comments
 (0)