mirror of
https://github.com/github/codeql-action.git
synced 2026-05-22 05:18:35 +00:00
Group OIDC schemas into an array
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import * as json from ".";
|
||||
|
||||
export function makeFromSchema<S extends json.Schema>(
|
||||
includeOptional: boolean,
|
||||
schema: S,
|
||||
): json.FromSchema<S> {
|
||||
const result = {};
|
||||
for (const [key, validator] of Object.entries(schema)) {
|
||||
if (!validator.required && !includeOptional) {
|
||||
continue;
|
||||
}
|
||||
result[key] = `value-for-${key}`;
|
||||
}
|
||||
return result as json.FromSchema<S>;
|
||||
}
|
||||
Reference in New Issue
Block a user