Use Array.isArray
This commit is contained in:
parent
1e7a38893c
commit
57eca7cbb2
3 changed files with 9 additions and 9 deletions
|
|
@ -823,7 +823,7 @@ export function fixInvalidNotifications(
|
|||
);
|
||||
return sarif;
|
||||
}
|
||||
if (!(sarif.runs instanceof Array)) {
|
||||
if (!Array.isArray(sarif.runs)) {
|
||||
return sarif;
|
||||
}
|
||||
|
||||
|
|
@ -837,21 +837,21 @@ export function fixInvalidNotifications(
|
|||
runs: sarif.runs.map((run) => {
|
||||
if (
|
||||
run.tool?.driver?.name !== "CodeQL" ||
|
||||
!(run.invocations instanceof Array)
|
||||
!Array.isArray(run.invocations)
|
||||
) {
|
||||
return run;
|
||||
}
|
||||
return {
|
||||
...run,
|
||||
invocations: run.invocations.map((invocation) => {
|
||||
if (!(invocation.toolExecutionNotifications instanceof Array)) {
|
||||
if (!Array.isArray(invocation.toolExecutionNotifications)) {
|
||||
return invocation;
|
||||
}
|
||||
return {
|
||||
...invocation,
|
||||
toolExecutionNotifications:
|
||||
invocation.toolExecutionNotifications.map((notification) => {
|
||||
if (!(notification.locations instanceof Array)) {
|
||||
if (!Array.isArray(notification.locations)) {
|
||||
return notification;
|
||||
}
|
||||
const newLocations = removeDuplicateLocations(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue