mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-16 00:25:30 +00:00
Schema: removed filter function for getValidated to return empty object in case of error;
Added OVV_KEYS_BADFORMAT message to throw in case of error;
This commit is contained in:
@@ -370,7 +370,7 @@ class Pass {
|
||||
|
||||
let valid = data
|
||||
.map(o => schema.getValidated(o, "barcode"))
|
||||
.filter(o => o instanceof Object);
|
||||
.filter(o => !!Object.keys(o).length);
|
||||
|
||||
if (valid.length) {
|
||||
this._props["barcode"] = valid[0];
|
||||
@@ -669,8 +669,11 @@ class Pass {
|
||||
}
|
||||
|
||||
let modelPath = path.resolve(options.model) + (!!options.model && !path.extname(options.model) ? ".pass" : "");
|
||||
const filteredOpts = schema.getValidated(options.overrides, "supportedOptions");
|
||||
|
||||
const filteredOpts = schema.filter(options.overrides, "supportedOptions");
|
||||
if (!Object.keys(filteredOpts).length) {
|
||||
throw new Error(formatMessage("OVV_KEYS_BADFORMAT"))
|
||||
}
|
||||
|
||||
return {
|
||||
model: modelPath,
|
||||
|
||||
Reference in New Issue
Block a user