mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 18:25:24 +00:00
Fixed possible undefined date case
This commit is contained in:
@@ -1201,8 +1201,12 @@ function validateJSONBuffer(
|
||||
function isRelevantEntry(
|
||||
entry: Schemas.RelevantDate,
|
||||
): entry is Schemas.RelevancyEntry {
|
||||
return (
|
||||
Object.prototype.hasOwnProperty.call(entry, "relevantDate") ||
|
||||
Object.prototype.hasOwnProperty.call(entry, "date")
|
||||
);
|
||||
const isRelevantDateAvailable: boolean =
|
||||
Object.prototype.hasOwnProperty.call(entry, "relevantDate") &&
|
||||
"relevantDate" in entry;
|
||||
|
||||
const isDateAvailable: boolean =
|
||||
Object.prototype.hasOwnProperty.call(entry, "date") && "date" in entry;
|
||||
|
||||
return isRelevantDateAvailable || isDateAvailable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user