We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
cloneCredential
1 parent 0ed734b commit 35715efCopy full SHA for 35715ef
1 file changed
src/start-proxy/validation.ts
@@ -7,10 +7,10 @@ import type { AuthConfig, UsernamePassword } from "./types";
7
import * as types from "./types";
8
9
/** 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 {
+export function cloneCredential<S extends json.Schema>(
+ schema: S,
+ obj: json.FromSchema<S>,
+): json.FromSchema<S> {
14
const result = {};
15
16
for (const key of Object.keys(schema)) {
@@ -21,7 +21,7 @@ export function cloneCredential<
21
result[key] = obj[key];
22
}
23
24
- return result as T;
+ return result as json.FromSchema<S>;
25
26
27
/** Extracts an `AuthConfig` value from `config`. */
0 commit comments