From 2bdd906989c348cc960dc6306916ed2cf83e851c Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Thu, 4 Apr 2019 22:58:18 +0200 Subject: [PATCH] Small improvements --- src/pass.js | 6 +++--- src/schema.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pass.js b/src/pass.js index f11b0d1..c157d0a 100644 --- a/src/pass.js +++ b/src/pass.js @@ -280,10 +280,11 @@ class Pass { if (!dateParse) { genericDebug(formatMessage("DATE_FORMAT_UNMATCH", "Expiration date")); - } else { - this._props.expirationDate = dateParse; + return this; } + this._props.expirationDate = dateParse; + return this; } @@ -864,7 +865,6 @@ function assignLength(length, ...sources) { return Object.assign({ length }, ...sources); } - /** * Automatically generates barcodes for all the types given common info * diff --git a/src/schema.js b/src/schema.js index 43cb16c..b90303e 100644 --- a/src/schema.js +++ b/src/schema.js @@ -189,8 +189,8 @@ const seat = Joi.object().keys({ }); const location = Joi.object().keys({ - latitude: Joi.number(), - longitude: Joi.number() + latitude: Joi.number().required(), + longitude: Joi.number().required() }); // --------- UTILITIES ---------- //