From 4e3fa748c17911cfb08a123b282dd894609ed816 Mon Sep 17 00:00:00 2001 From: alexandercerutti Date: Sun, 26 Aug 2018 12:06:21 +0200 Subject: [PATCH] Added conditional pushing or replacing of fields inside fieldsName, based on this.shouldOverwrite --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index b916862..b95485e 100644 --- a/index.js +++ b/index.js @@ -526,7 +526,11 @@ class Pass { fieldsName.forEach(area => { 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); + } } });