Skip to content

Commit 50ec5a5

Browse files
committed
Use Object.hasOwn instead of in operator
Apparently, the `in` operator will check inherited properties too.
1 parent 5aea817 commit 50ec5a5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎scripts/changetool/cli/validate.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ export function hasValidChangenoteCategory(
6464
): boolean {
6565
const category = frontmatter["category"];
6666
return (
67-
typeof category === "string" && category in VALID_CHANGE_NOTE_CATEGORIES
67+
typeof category === "string" &&
68+
Object.hasOwn(VALID_CHANGE_NOTE_CATEGORIES, category)
6869
);
6970
}
7071

0 commit comments

Comments
 (0)