mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 14:25:17 +00:00
Removed selected patching based on type for a direct replacement of the properties
This commit is contained in:
12
src/pass.ts
12
src/pass.ts
@@ -632,7 +632,7 @@ export class Pass implements PassIndexSignature {
|
||||
*/
|
||||
|
||||
private _patch(passCoreBuffer: Buffer): Buffer {
|
||||
const passFile = JSON.parse(passCoreBuffer.toString());
|
||||
let passFile = JSON.parse(passCoreBuffer.toString());
|
||||
|
||||
if (Object.keys(this._props).length) {
|
||||
/*
|
||||
@@ -645,15 +645,7 @@ export class Pass implements PassIndexSignature {
|
||||
.filter(v => this._props[v] && !isValidRGB(this._props[v]))
|
||||
.forEach(v => delete this._props[v]);
|
||||
|
||||
Object.keys(this._props).forEach(prop => {
|
||||
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];
|
||||
}
|
||||
});
|
||||
passFile = { ...passFile, ...this._props };
|
||||
}
|
||||
|
||||
this._fields.forEach(field => {
|
||||
|
||||
Reference in New Issue
Block a user