Use Object.hasOwn instead of in operator

Apparently, the `in` operator will check inherited properties too.
This commit is contained in:
Mario Campos
2026-08-26 22:23:00 -05:00
parent 5aea817801
commit 50ec5a5c18

View File

@@ -64,7 +64,8 @@ export function hasValidChangenoteCategory(
): boolean {
const category = frontmatter["category"];
return (
typeof category === "string" && category in VALID_CHANGE_NOTE_CATEGORIES
typeof category === "string" &&
Object.hasOwn(VALID_CHANGE_NOTE_CATEGORIES, category)
);
}