Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored and astrobot-houston committed Jan 30, 2024
1 parent 13c3b71 commit a838317
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/astro/src/content/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ function getYAMLErrorLine(rawData: string | undefined, objectKey: string) {
return numNewlinesBeforeKey;
}


export function safeParseFrontmatter(source: string, id?: string) {
try {
return matter(source);
Expand All @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a838317

Please sign in to comment.