From 287af36d7ddf10ec15811004c729973146f295a5 Mon Sep 17 00:00:00 2001 From: thuanbui Date: Thu, 12 Mar 2026 14:23:15 +0900 Subject: [PATCH] fix: use Object.hasOwn to check for existing frontmatter fields before injecting custom taxonomy slugs --- src/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.js b/src/parser.js index 0ac7f5c..e9225f6 100644 --- a/src/parser.js +++ b/src/parser.js @@ -226,7 +226,7 @@ function populateFrontmatter(posts) { // inject custom taxonomy slugs into frontmatter, each taxonomy as its own field Object.entries(post.customTaxonomies).forEach(([domain, slugs]) => { if (slugs.length > 0) { - if (post.frontmatter.hasOwnProperty(domain)) { + if (Object.hasOwn(post.frontmatter, domain)) { console.warn(`⚠️ Skipping custom taxonomy '${domain}' on post '${post.slug}' because it conflicts with an existing frontmatter field.`); return; }