0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

[ci] format

This commit is contained in:
Nate Moore 2024-01-30 23:17:37 +00:00 committed by astrobot-houston
parent 13c3b712c7
commit a8383173da
2 changed files with 6 additions and 5 deletions

View file

@ -288,7 +288,6 @@ function getYAMLErrorLine(rawData: string | undefined, objectKey: string) {
return numNewlinesBeforeKey;
}
export function safeParseFrontmatter(source: string, id?: string) {
try {
return matter(source);
@ -297,9 +296,11 @@ export function safeParseFrontmatter(source: string, id?: string) {
name: 'MarkdownError',
message: err.message,
stack: err.stack,
location: id ? {
file: id,
} : undefined,
location: id
? {
file: id,
}
: undefined,
});
if (isYAMLException(err)) {

View file

@ -4,7 +4,7 @@ import { safeParseFrontmatter } from '../content/utils.js';
export const markdownContentEntryType: ContentEntryType = {
extensions: ['.md'],
async getEntryInfo({ contents, fileUrl }: { contents: string, fileUrl: URL }) {
async getEntryInfo({ contents, fileUrl }: { contents: string; fileUrl: URL }) {
const parsed = safeParseFrontmatter(contents, fileURLToPath(fileUrl));
return {
data: parsed.data,