mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 16:25:21 +00:00
Made constructor props optional
This commit is contained in:
@@ -146,7 +146,7 @@ export default class PKPass extends Bundle {
|
|||||||
constructor(
|
constructor(
|
||||||
buffers: Schemas.FileBuffers,
|
buffers: Schemas.FileBuffers,
|
||||||
certificates: Schemas.CertificatesSchema,
|
certificates: Schemas.CertificatesSchema,
|
||||||
props: Schemas.OverridablePassProps,
|
props?: Schemas.OverridablePassProps,
|
||||||
) {
|
) {
|
||||||
super("application/vnd.apple.pkpass");
|
super("application/vnd.apple.pkpass");
|
||||||
|
|
||||||
@@ -161,6 +161,7 @@ export default class PKPass extends Bundle {
|
|||||||
this.addBuffer(fileName, contentBuffer);
|
this.addBuffer(fileName, contentBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (props) {
|
||||||
/** Overrides validation and pushing in props */
|
/** Overrides validation and pushing in props */
|
||||||
const overridesValidation = Schemas.validate(
|
const overridesValidation = Schemas.validate(
|
||||||
Schemas.OverridablePassProps,
|
Schemas.OverridablePassProps,
|
||||||
@@ -168,6 +169,8 @@ export default class PKPass extends Bundle {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Object.assign(this[propsSymbol], overridesValidation);
|
Object.assign(this[propsSymbol], overridesValidation);
|
||||||
|
}
|
||||||
|
|
||||||
this.certificates = certificates;
|
this.certificates = certificates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user