fix edge case in entriesOf

This commit is contained in:
Chris Kruining 2025-02-04 15:28:08 +11:00
parent 9447071d64
commit 3bd17306f2
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2

View file

@ -115,6 +115,10 @@ const entriesOf = (subject: object): Iterable<readonly [string | number, any]> =
return subject.entries();
}
if (subject === null || subject === undefined) {
return [];
}
return Object.entries(subject);
};