mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Add convenience functions to produce CheckSchemaResult values
This commit is contained in:
10
lib/entry-points.js
generated
10
lib/entry-points.js
generated
@@ -144527,7 +144527,7 @@ function optionalOrNull(validator) {
|
||||
},
|
||||
check: (val, path29) => {
|
||||
if (val === void 0 || val === null) {
|
||||
return { valid: true, unknownKeys: [] };
|
||||
return successfulCheckSchema();
|
||||
}
|
||||
return validator.check(val, path29);
|
||||
},
|
||||
@@ -144538,8 +144538,14 @@ function validateSchema(schema, obj) {
|
||||
const result = checkSchema(schema, obj, { failFast: true });
|
||||
return result.valid;
|
||||
}
|
||||
function successfulCheckSchema() {
|
||||
return {
|
||||
valid: true,
|
||||
unknownKeys: []
|
||||
};
|
||||
}
|
||||
function checkSchema(schema, obj, options = {}, path29 = "") {
|
||||
const result = { valid: true, unknownKeys: [] };
|
||||
const result = successfulCheckSchema();
|
||||
const inputKeys = new Set(Object.keys(obj));
|
||||
for (const [key, validator] of Object.entries(schema)) {
|
||||
const hasKey = key in obj;
|
||||
|
||||
Reference in New Issue
Block a user