Removed rgbValues as a variable for a direct approact;

Added comment to that part;
This commit is contained in:
Alexander Cerutti
2019-04-28 11:38:59 +02:00
parent 3de6547591
commit 37a9a051c6

View File

@@ -622,9 +622,12 @@ class Pass {
_patch(passFile) { _patch(passFile) {
if (Object.keys(this._props).length) { if (Object.keys(this._props).length) {
const rgbValues = ["backgroundColor", "foregroundColor", "labelColor"]; // We filter the existing (in passFile) and non-valid keys from
// the below array keys that accept rgb values
rgbValues.filter(v => this._props[v] && !isValidRGB(this._props[v])).forEach(v => delete this._props[v]); // and then delete it from the passFile.
["backgroundColor", "foregroundColor", "labelColor"]
.filter(v => this._props[v] && !isValidRGB(this._props[v]))
.forEach(v => delete this._props[v]);
if (this.shouldOverwrite) { if (this.shouldOverwrite) {
Object.assign(passFile, this._props); Object.assign(passFile, this._props);