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