mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 09:14:58 +00:00
Use Object.hasOwn instead of in operator
Apparently, the `in` operator will check inherited properties too.
This commit is contained in:
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user