mirror of
https://github.com/github/codeql-action.git
synced 2026-10-31 01:49:43 +00:00
Allow nested checking
This commit is contained in:
126
lib/entry-points.js
generated
126
lib/entry-points.js
generated
@@ -29647,13 +29647,13 @@ var require_helpers = __commonJS({
|
||||
exports2.encodePath = function encodePointer(a) {
|
||||
return a.map(pathEncoder).join("");
|
||||
};
|
||||
exports2.getDecimalPlaces = function getDecimalPlaces(number) {
|
||||
exports2.getDecimalPlaces = function getDecimalPlaces(number2) {
|
||||
var decimalPlaces = 0;
|
||||
if (isNaN(number)) return decimalPlaces;
|
||||
if (typeof number !== "number") {
|
||||
number = Number(number);
|
||||
if (isNaN(number2)) return decimalPlaces;
|
||||
if (typeof number2 !== "number") {
|
||||
number2 = Number(number2);
|
||||
}
|
||||
var parts = number.toString().split("e");
|
||||
var parts = number2.toString().split("e");
|
||||
if (parts.length === 2) {
|
||||
if (parts[1][0] !== "-") {
|
||||
return decimalPlaces;
|
||||
@@ -78733,9 +78733,9 @@ var require_enum_object = __commonJS({
|
||||
if (!isEnumObject(enumObject))
|
||||
throw new Error("not a typescript enum object");
|
||||
let values = [];
|
||||
for (let [name, number] of Object.entries(enumObject))
|
||||
if (typeof number == "number")
|
||||
values.push({ name, number });
|
||||
for (let [name, number2] of Object.entries(enumObject))
|
||||
if (typeof number2 == "number")
|
||||
values.push({ name, number: number2 });
|
||||
return values;
|
||||
}
|
||||
exports2.listEnumValues = listEnumValues;
|
||||
@@ -92751,10 +92751,10 @@ var require_util12 = __commonJS({
|
||||
return arg == null;
|
||||
}
|
||||
exports2.isNullOrUndefined = isNullOrUndefined;
|
||||
function isNumber(arg) {
|
||||
function isNumber2(arg) {
|
||||
return typeof arg === "number";
|
||||
}
|
||||
exports2.isNumber = isNumber;
|
||||
exports2.isNumber = isNumber2;
|
||||
function isString3(arg) {
|
||||
return typeof arg === "string";
|
||||
}
|
||||
@@ -101524,24 +101524,24 @@ var require_operators = __commonJS({
|
||||
}
|
||||
}.call(this);
|
||||
}
|
||||
function toIntegerOrInfinity(number) {
|
||||
number = Number2(number);
|
||||
if (NumberIsNaN(number)) {
|
||||
function toIntegerOrInfinity(number2) {
|
||||
number2 = Number2(number2);
|
||||
if (NumberIsNaN(number2)) {
|
||||
return 0;
|
||||
}
|
||||
if (number < 0) {
|
||||
throw new ERR_OUT_OF_RANGE("number", ">= 0", number);
|
||||
if (number2 < 0) {
|
||||
throw new ERR_OUT_OF_RANGE("number", ">= 0", number2);
|
||||
}
|
||||
return number;
|
||||
return number2;
|
||||
}
|
||||
function drop(number, options = void 0) {
|
||||
function drop(number2, options = void 0) {
|
||||
if (options != null) {
|
||||
validateObject(options, "options");
|
||||
}
|
||||
if ((options === null || options === void 0 ? void 0 : options.signal) != null) {
|
||||
validateAbortSignal(options.signal, "options.signal");
|
||||
}
|
||||
number = toIntegerOrInfinity(number);
|
||||
number2 = toIntegerOrInfinity(number2);
|
||||
return async function* drop2() {
|
||||
var _options$signal5;
|
||||
if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) {
|
||||
@@ -101552,20 +101552,20 @@ var require_operators = __commonJS({
|
||||
if (options !== null && options !== void 0 && (_options$signal6 = options.signal) !== null && _options$signal6 !== void 0 && _options$signal6.aborted) {
|
||||
throw new AbortError();
|
||||
}
|
||||
if (number-- <= 0) {
|
||||
if (number2-- <= 0) {
|
||||
yield val;
|
||||
}
|
||||
}
|
||||
}.call(this);
|
||||
}
|
||||
function take(number, options = void 0) {
|
||||
function take(number2, options = void 0) {
|
||||
if (options != null) {
|
||||
validateObject(options, "options");
|
||||
}
|
||||
if ((options === null || options === void 0 ? void 0 : options.signal) != null) {
|
||||
validateAbortSignal(options.signal, "options.signal");
|
||||
}
|
||||
number = toIntegerOrInfinity(number);
|
||||
number2 = toIntegerOrInfinity(number2);
|
||||
return async function* take2() {
|
||||
var _options$signal7;
|
||||
if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted) {
|
||||
@@ -101576,10 +101576,10 @@ var require_operators = __commonJS({
|
||||
if (options !== null && options !== void 0 && (_options$signal8 = options.signal) !== null && _options$signal8 !== void 0 && _options$signal8.aborted) {
|
||||
throw new AbortError();
|
||||
}
|
||||
if (number-- > 0) {
|
||||
if (number2-- > 0) {
|
||||
yield val;
|
||||
}
|
||||
if (number <= 0) {
|
||||
if (number2 <= 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -124893,8 +124893,8 @@ var require_util16 = __commonJS({
|
||||
parts.push(format.substring(last));
|
||||
return parts.join("");
|
||||
};
|
||||
util3.formatNumber = function(number, decimals, dec_point, thousands_sep) {
|
||||
var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
|
||||
util3.formatNumber = function(number2, decimals, dec_point, thousands_sep) {
|
||||
var n = number2, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
|
||||
var d = dec_point === void 0 ? "," : dec_point;
|
||||
var t = thousands_sep === void 0 ? "." : thousands_sep, s = n < 0 ? "-" : "";
|
||||
var i = parseInt(n = Math.abs(+n || 0).toFixed(c), 10) + "";
|
||||
@@ -144502,17 +144502,47 @@ function isArray(value) {
|
||||
function isString(value) {
|
||||
return typeof value === "string";
|
||||
}
|
||||
function isNumber(value) {
|
||||
return typeof value === "number";
|
||||
}
|
||||
function isStringOrUndefined(value) {
|
||||
return value === void 0 || isString(value);
|
||||
}
|
||||
var string = {
|
||||
validate: isString,
|
||||
required: true
|
||||
};
|
||||
function array(validator) {
|
||||
function defaultCheck(validate) {
|
||||
return (arg) => ({ unknownKeys: [], valid: validate(arg) });
|
||||
}
|
||||
function makeValidator(validate, required = true) {
|
||||
return {
|
||||
validate: (val) => {
|
||||
return isArray(val) && val.every((e) => validator.validate(e));
|
||||
validate,
|
||||
check: defaultCheck(validate),
|
||||
required
|
||||
};
|
||||
}
|
||||
var string = makeValidator(isString);
|
||||
var number = makeValidator(isNumber);
|
||||
function array(validator) {
|
||||
const validate = (val) => {
|
||||
return isArray(val) && val.every((e) => validator.validate(e));
|
||||
};
|
||||
return {
|
||||
validate,
|
||||
check: (val, path29) => {
|
||||
const result = { valid: true, unknownKeys: [] };
|
||||
if (!isArray(val)) {
|
||||
result.valid = false;
|
||||
return result;
|
||||
}
|
||||
let index2 = 0;
|
||||
for (const e of val) {
|
||||
const eResult = validator.check(e, `${path29}[${index2}].`);
|
||||
result.unknownKeys.push(...eResult.unknownKeys);
|
||||
index2++;
|
||||
if (!eResult.valid) {
|
||||
result.valid = false;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
required: true
|
||||
};
|
||||
@@ -144522,6 +144552,12 @@ function object(schema) {
|
||||
validate: (val) => {
|
||||
return isObject(val) && validateSchema(schema, val);
|
||||
},
|
||||
check: (val, path29) => {
|
||||
if (!isObject(val)) {
|
||||
return { valid: false, unknownKeys: [] };
|
||||
}
|
||||
return checkSchema(schema, val, {}, path29);
|
||||
},
|
||||
required: true
|
||||
};
|
||||
}
|
||||
@@ -144530,6 +144566,12 @@ function optionalOrNull(validator) {
|
||||
validate: (val) => {
|
||||
return val === void 0 || val === null || validator.validate(val);
|
||||
},
|
||||
check: (val, path29) => {
|
||||
if (val === void 0 || val === null) {
|
||||
return { valid: true, unknownKeys: [] };
|
||||
}
|
||||
return validator.check(val, path29);
|
||||
},
|
||||
required: false
|
||||
};
|
||||
}
|
||||
@@ -144538,6 +144580,12 @@ function optional(validator) {
|
||||
validate: (val) => {
|
||||
return val === void 0 || validator.validate(val);
|
||||
},
|
||||
check: (val, path29) => {
|
||||
if (val === void 0) {
|
||||
return { valid: true, unknownKeys: [] };
|
||||
}
|
||||
return validator.check(val, path29);
|
||||
},
|
||||
required: false
|
||||
};
|
||||
}
|
||||
@@ -144564,12 +144612,16 @@ function checkSchema(schema, obj, options = {}, path29 = "") {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (hasKey && !validator.validate(obj[key])) {
|
||||
result.valid = false;
|
||||
if (options.failFast) {
|
||||
return result;
|
||||
if (hasKey) {
|
||||
const checkResult = validator.check(obj[key], `${path29}${key}.`);
|
||||
result.unknownKeys.push(...checkResult.unknownKeys);
|
||||
if (!checkResult.valid) {
|
||||
result.valid = false;
|
||||
if (options.failFast) {
|
||||
return result;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
inputKeys.delete(key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user