refactor: replace Object.prototype.hasOwnProperty() with Object.hasOwn() (#38929)
This commit is contained in:
parent
09669f9d21
commit
607e71d563
11 changed files with 13 additions and 17 deletions
|
@ -213,9 +213,7 @@ function areValidTemplateItems (template: (MenuItemConstructorOptions | MenuItem
|
|||
return template.every(item =>
|
||||
item != null &&
|
||||
typeof item === 'object' &&
|
||||
(Object.prototype.hasOwnProperty.call(item, 'label') ||
|
||||
Object.prototype.hasOwnProperty.call(item, 'role') ||
|
||||
item.type === 'separator'));
|
||||
(Object.hasOwn(item, 'label') || Object.hasOwn(item, 'role') || item.type === 'separator'));
|
||||
}
|
||||
|
||||
function sortTemplate (template: (MenuItemConstructorOptions | MenuItem)[]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue