mirror of
https://github.com/github/codeql-action.git
synced 2026-01-06 14:40:10 +08:00
Remove undefined values from results of unsafeEntriesInvariant
This commit is contained in:
@@ -1307,7 +1307,7 @@ export function unsafeKeysInvariant<T extends Record<string, any>>(
|
||||
export function unsafeEntriesInvariant<T extends Record<string, any>>(
|
||||
object: T,
|
||||
): Array<[keyof T, Exclude<T[keyof T], undefined>]> {
|
||||
return Object.entries(object) as Array<
|
||||
[keyof T, Exclude<T[keyof T], undefined>]
|
||||
>;
|
||||
return Object.entries(object).filter(
|
||||
([_, val]) => val !== undefined,
|
||||
) as Array<[keyof T, Exclude<T[keyof T], undefined>]>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user