Removed selected patching based on type for a direct replacement of the properties

This commit is contained in:
Alexander Cerutti
2019-06-27 23:49:52 +02:00
parent 53441a9b2f
commit 75b22daf73

View File

@@ -632,7 +632,7 @@ export class Pass implements PassIndexSignature {
*/ */
private _patch(passCoreBuffer: Buffer): Buffer { private _patch(passCoreBuffer: Buffer): Buffer {
const passFile = JSON.parse(passCoreBuffer.toString()); let passFile = JSON.parse(passCoreBuffer.toString());
if (Object.keys(this._props).length) { if (Object.keys(this._props).length) {
/* /*
@@ -645,15 +645,7 @@ export class Pass implements PassIndexSignature {
.filter(v => this._props[v] && !isValidRGB(this._props[v])) .filter(v => this._props[v] && !isValidRGB(this._props[v]))
.forEach(v => delete this._props[v]); .forEach(v => delete this._props[v]);
Object.keys(this._props).forEach(prop => { passFile = { ...passFile, ...this._props };
if (passFile[prop] && passFile[prop] instanceof Array) {
passFile[prop] = [ ...passFile[prop], ...this._props[prop] ];
} else if (passFile[prop] && passFile[prop] instanceof Object) {
passFile[prop] = { ...passFile[prop], ...this._props[prop] };
} else {
passFile[prop] = this._props[prop];
}
});
} }
this._fields.forEach(field => { this._fields.forEach(field => {