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
|
@ -311,7 +311,7 @@ export const roleList: Record<RoleId, Role> = {
|
|||
};
|
||||
|
||||
const hasRole = (role: keyof typeof roleList) => {
|
||||
return Object.prototype.hasOwnProperty.call(roleList, role);
|
||||
return Object.hasOwn(roleList, role);
|
||||
};
|
||||
|
||||
const canExecuteRole = (role: keyof typeof roleList) => {
|
||||
|
@ -336,7 +336,7 @@ export function getCheckStatus (role: RoleId) {
|
|||
}
|
||||
|
||||
export function shouldOverrideCheckStatus (role: RoleId) {
|
||||
return hasRole(role) && Object.prototype.hasOwnProperty.call(roleList[role], 'checked');
|
||||
return hasRole(role) && Object.hasOwn(roleList[role], 'checked');
|
||||
}
|
||||
|
||||
export function getDefaultAccelerator (role: RoleId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue