mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 21:25:26 +00:00
Changed inner certificates mapping to a clearer implementation
This commit is contained in:
7
index.js
7
index.js
@@ -592,8 +592,13 @@ class Pass {
|
|||||||
|
|
||||||
let certPaths = Object.keys(options.certificates)
|
let certPaths = Object.keys(options.certificates)
|
||||||
.filter(v => v !== "dir")
|
.filter(v => v !== "dir")
|
||||||
.map((val) => readFile(path.resolve(typeof options.certificates[val] !== "object" ? options.certificates[val] : options.certificates[val]["keyFile"])));
|
.map((val) => {
|
||||||
|
const cert = options.certificates[val];
|
||||||
|
const filePath = !(cert instanceof Object) ? cert : cert["keyFile"];
|
||||||
|
const resolvedPath = path.resolve(filePath);
|
||||||
|
|
||||||
|
return readFile(resolvedPath);
|
||||||
|
});
|
||||||
|
|
||||||
return Promise.all(certPaths).then(contents => {
|
return Promise.all(certPaths).then(contents => {
|
||||||
contents.forEach(file => {
|
contents.forEach(file => {
|
||||||
|
|||||||
Reference in New Issue
Block a user