mirror of
https://github.com/github/codeql-action.git
synced 2026-08-05 04:57:19 -05:00
Refactor isVersionInfo() to use json` module
This commit is contained in:
+9
-9
@@ -634,16 +634,16 @@ interface PersistedVersionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isVersionInfo(x: unknown): x is VersionInfo {
|
function isVersionInfo(x: unknown): x is VersionInfo {
|
||||||
const candidate = x as Partial<VersionInfo> | null;
|
|
||||||
return (
|
return (
|
||||||
typeof candidate === "object" &&
|
json.isObject(x) &&
|
||||||
candidate !== null &&
|
json.validateSchema(
|
||||||
typeof candidate.version === "string" &&
|
{
|
||||||
(candidate.features === undefined ||
|
version: json.string,
|
||||||
(typeof candidate.features === "object" &&
|
features: json.undefinable(json.object),
|
||||||
candidate.features !== null)) &&
|
overlayVersion: json.undefinable(json.number),
|
||||||
(candidate.overlayVersion === undefined ||
|
},
|
||||||
typeof candidate.overlayVersion === "number")
|
x,
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user