mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 18:25:24 +00:00
Removed early return in _patch since not needed (this.props is not the only property to be checked in _patch)
This commit is contained in:
9
index.js
9
index.js
@@ -499,13 +499,11 @@ class Pass {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
_patch(passBuffer) {
|
_patch(passBuffer) {
|
||||||
if (!Object.keys(this.props).length) {
|
|
||||||
return Promise.resolve(passBuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
const rgbValues = ["backgroundColor", "foregroundColor", "labelColor"];
|
|
||||||
let passFile = JSON.parse(passBuffer.toString("utf8"));
|
let passFile = JSON.parse(passBuffer.toString("utf8"));
|
||||||
|
|
||||||
|
if (Object.keys(this.props).length) {
|
||||||
|
const rgbValues = ["backgroundColor", "foregroundColor", "labelColor"];
|
||||||
|
|
||||||
rgbValues.filter(v => this.props[v] && !isValidRGB(this.props[v])).forEach(v => delete this.props[v]);
|
rgbValues.filter(v => this.props[v] && !isValidRGB(this.props[v])).forEach(v => delete this.props[v]);
|
||||||
|
|
||||||
if (this.shouldOverwrite) {
|
if (this.shouldOverwrite) {
|
||||||
@@ -523,6 +521,7 @@ class Pass {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fieldsName.forEach(area => {
|
fieldsName.forEach(area => {
|
||||||
if (this[area].fields.length) {
|
if (this[area].fields.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user