From a627286e25c63d666383ae28d0a226ae946ec6c5 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Sun, 10 Oct 2021 02:11:59 +0200 Subject: [PATCH] Added template validation --- src/PKPass.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/PKPass.ts b/src/PKPass.ts index 33f81bd..151642e 100644 --- a/src/PKPass.ts +++ b/src/PKPass.ts @@ -79,11 +79,7 @@ export default class PKPass extends Bundle { JSON.stringify(source[propsSymbol]), ); } else { - if (!source.model || typeof source.model !== "string") { - throw new TypeError( - "Cannot create PKPass from source: unknown model but expected a string.", - ); - } + Schemas.assertValidity(Schemas.Template, source); buffers = await getModelFolderContents(source.model); certificates = source.certificates;