From 84823794d82a3a268b7d900147e9e60d80d2727a Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Wed, 22 Sep 2021 22:58:54 +0200 Subject: [PATCH] Added partial implementation of addBuffer --- src/PKPass.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/PKPass.ts b/src/PKPass.ts index 1f8d822..946aceb 100644 --- a/src/PKPass.ts +++ b/src/PKPass.ts @@ -187,6 +187,24 @@ export default class PKPass extends Bundle { * @TODO exclude pass.json, manifest, signature files */ + if (/manifest|signature/.test(pathName)) { + return; + } + + if (/pass\.json/.test(pathName)) { + if (this[filesSymbol]["pass.json"]) { + /** + * Ignoring any further addition. In a + * future we might consider merging instead + */ + return; + } + + /** + * @TODO parse pass.json + */ + } + super.addBuffer(pathName, buffer); }