mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 19:25:23 +00:00
Fixed problem with fieldsArray: field were being added even if the keys check was failing
This commit is contained in:
@@ -26,13 +26,13 @@ class FieldsArray extends Array {
|
|||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acc.some(e => e.key === current.key) || this[poolSymbol].has(current.key)) {
|
if (this[poolSymbol].has(current.key)) {
|
||||||
debug(`Field with key "${key}" discarded: fields must be unique in pass scope.`);
|
debug(`Field with key "${current.key}" discarded: fields must be unique in pass scope.`);
|
||||||
|
} else {
|
||||||
|
this[poolSymbol].add(current.key);
|
||||||
|
acc.push(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
this[poolSymbol].add(current.key)
|
|
||||||
acc.push(current)
|
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user