mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
fix: use Object.hasOwn to check for existing frontmatter fields before injecting custom taxonomy slugs
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user