mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 14:25:17 +00:00
Improved examples code
This commit is contained in:
@@ -32,11 +32,11 @@ export function removeHidden(from: Array<string>): Array<string> {
|
|||||||
async function readFileOrDirectory(filePath: string) {
|
async function readFileOrDirectory(filePath: string) {
|
||||||
if ((await fs.lstat(filePath)).isDirectory()) {
|
if ((await fs.lstat(filePath)).isDirectory()) {
|
||||||
return Promise.all(await readDirectory(filePath));
|
return Promise.all(await readDirectory(filePath));
|
||||||
} else {
|
|
||||||
return fs
|
|
||||||
.readFile(filePath)
|
|
||||||
.then((content) => getObjectFromModelFile(filePath, content, 1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fileBuffer = await fs.readFile(filePath);
|
||||||
|
|
||||||
|
return getObjectFromModelFile(filePath, fileBuffer, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ app.route("/scratch/:modelName").get(async (request, response) => {
|
|||||||
"../../models/exampleBooking.pass/icon.png",
|
"../../models/exampleBooking.pass/icon.png",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
await getCertificates(),
|
getCertificates(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user