Skip to content

Commit d277609

Browse files
committed
Remove workaround for bug fixed in vfile/vfile-matter#7
1 parent d154c57 commit d277609

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/meta.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,12 @@ const schema = {
4545
export function parse(file) {
4646
const vfile = new VFile(file.content);
4747

48-
try {
49-
const parseOptions = {
50-
customTags: [
51-
"timestamp", // Parse datetime fields according to YAML 1.1 spec
52-
],
53-
};
54-
matter(vfile, { strip: true, yaml: parseOptions });
55-
} catch (_) {
56-
throw new FrontmatterParseError(file.name);
57-
}
48+
const parseOptions = {
49+
customTags: [
50+
"timestamp", // Parse datetime fields according to YAML 1.1 spec
51+
],
52+
};
53+
matter(vfile, { strip: true, yaml: parseOptions });
5854

5955
const frontmatter = vfile.data.matter;
6056

tests/md.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe("md.parse", () => {
108108
try {
109109
await parse(file);
110110
} catch (error) {
111-
expect(error).toBeInstanceOf(FrontmatterParseError);
111+
expect(error).toBeInstanceOf(MissingFrontmatterError);
112112
}
113113
});
114114

0 commit comments

Comments
 (0)