Added template validation

This commit is contained in:
Alexander Cerutti
2021-10-10 02:11:59 +02:00
parent f50e38ca94
commit a627286e25

View File

@@ -79,11 +79,7 @@ export default class PKPass extends Bundle {
JSON.stringify(source[propsSymbol]), JSON.stringify(source[propsSymbol]),
); );
} else { } else {
if (!source.model || typeof source.model !== "string") { Schemas.assertValidity(Schemas.Template, source);
throw new TypeError(
"Cannot create PKPass from source: unknown model but expected a string.",
);
}
buffers = await getModelFolderContents(source.model); buffers = await getModelFolderContents(source.model);
certificates = source.certificates; certificates = source.certificates;