mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 21:25:26 +00:00
Added conditional pushing or replacing of fields inside fieldsName, based on this.shouldOverwrite
This commit is contained in:
6
index.js
6
index.js
@@ -526,7 +526,11 @@ class Pass {
|
|||||||
|
|
||||||
fieldsName.forEach(area => {
|
fieldsName.forEach(area => {
|
||||||
if (this[area].fields.length) {
|
if (this[area].fields.length) {
|
||||||
passFile[this.type][area].push(...this[area].fields);
|
if (this.shouldOverwrite) {
|
||||||
|
passFile[this.type][area] = this[area].fields;
|
||||||
|
} else {
|
||||||
|
passFile[this.type][area].push(...this[area].fields);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user