Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91a63dc

Browse files
committed
Remove undefined values from results of unsafeEntriesInvariant
1 parent d25fa60 commit 91a63dc

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/upload-sarif-action.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ export function unsafeKeysInvariant<T extends Record<string, any>>(
13071307
export function unsafeEntriesInvariant<T extends Record<string, any>>(
13081308
object: T,
13091309
): Array<[keyof T, Exclude<T[keyof T], undefined>]> {
1310-
return Object.entries(object) as Array<
1311-
[keyof T, Exclude<T[keyof T], undefined>]
1312-
>;
1310+
return Object.entries(object).filter(
1311+
([_, val]) => val !== undefined,
1312+
) as Array<[keyof T, Exclude<T[keyof T], undefined>]>;
13131313
}

0 commit comments

Comments
 (0)