Skip to content

Commit

Permalink
Add additional checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandapip1 committed May 15, 2023
1 parent cb8e7b7 commit 00e7916
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ export default withPwa(defineConfig({

let eipN = filenameToEipNumber(pageData.relativePath.split('/')[1]);
let frontmatter = eips.find(eip => eip.eip === eipN);
if (!frontmatter) {
throw new Error(`EIP ${eipN} not found`);
}

return [
// Regular Metadata
Expand Down Expand Up @@ -147,6 +150,11 @@ export default withPwa(defineConfig({
pageData = { ...pageData };
let eipN = filenameToEipNumber(pageData.relativePath.split('/')[1]);
pageData.frontmatter = eips.find(eip => eip.eip === eipN);

if (!pageData.frontmatter) {
throw new Error(`EIP ${eipN} not found`);
}

logger.info(`Transformed ${pageData.relativePath} (EIP)`, { timestamp: true });
return pageData;
} else if (pageData.frontmatter.listing) {
Expand Down

0 comments on commit 00e7916

Please sign in to comment.