From 91a63dc72c2c4c97e141018269495a7b62608d09 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 1 Oct 2025 15:28:56 +0100 Subject: [PATCH] Remove `undefined` values from results of `unsafeEntriesInvariant` --- lib/upload-sarif-action.js | 4 +++- src/util.ts | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 1470a5824..f703f3c06 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -88591,7 +88591,9 @@ async function asyncSome(array, predicate) { return results.some((result) => result); } function unsafeEntriesInvariant(object) { - return Object.entries(object); + return Object.entries(object).filter( + ([_, val2]) => val2 !== void 0 + ); } // src/actions-util.ts diff --git a/src/util.ts b/src/util.ts index 1fb193798..e7c29ed12 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1307,7 +1307,7 @@ export function unsafeKeysInvariant>( export function unsafeEntriesInvariant>( object: T, ): Array<[keyof T, Exclude]> { - return Object.entries(object) as Array< - [keyof T, Exclude] - >; + return Object.entries(object).filter( + ([_, val]) => val !== undefined, + ) as Array<[keyof T, Exclude]>; }