mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-29 18:09:05 +01:00
silence linter
those objects always have the normal prototype, and can't have `hasOwnProperty` redefined, let me call it normally (otherwise I'd have to write `Object.prototype.hasOwnProperty.call(newUser, field)` and that's ugly)
This commit is contained in:
parent
3164e7b4fc
commit
3ea85b14a3
1 changed files with 4 additions and 0 deletions
|
@ -588,11 +588,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
// `ApRendererService.renderPerson`
|
// `ApRendererService.renderPerson`
|
||||||
private userNeedsPublishing(oldUser: MiLocalUser, newUser: Partial<MiUser>): boolean {
|
private userNeedsPublishing(oldUser: MiLocalUser, newUser: Partial<MiUser>): boolean {
|
||||||
for (const field of ['avatarId', 'bannerId', 'backgroundId', 'isBot', 'username', 'name', 'isLocked', 'isExplorable', 'isCat', 'noindex', 'speakAsCat', 'movedToUri', 'alsoKnownAs'] as (keyof MiUser)[]) {
|
for (const field of ['avatarId', 'bannerId', 'backgroundId', 'isBot', 'username', 'name', 'isLocked', 'isExplorable', 'isCat', 'noindex', 'speakAsCat', 'movedToUri', 'alsoKnownAs'] as (keyof MiUser)[]) {
|
||||||
|
/* eslint-disable-next-line no-prototype-builtins */
|
||||||
if (newUser.hasOwnProperty(field) && oldUser[field] !== newUser[field]) {
|
if (newUser.hasOwnProperty(field) && oldUser[field] !== newUser[field]) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const arrayField of ['emojis', 'tags'] as (keyof MiUser)[]) {
|
for (const arrayField of ['emojis', 'tags'] as (keyof MiUser)[]) {
|
||||||
|
/* eslint-disable-next-line no-prototype-builtins */
|
||||||
if (newUser.hasOwnProperty(arrayField) !== oldUser.hasOwnProperty(arrayField)) {
|
if (newUser.hasOwnProperty(arrayField) !== oldUser.hasOwnProperty(arrayField)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -611,11 +613,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
private profileNeedsPublishing(oldProfile: MiUserProfile, newProfile: Partial<MiUserProfile>): boolean {
|
private profileNeedsPublishing(oldProfile: MiUserProfile, newProfile: Partial<MiUserProfile>): boolean {
|
||||||
for (const field of ['description', 'followedMessage', 'birthday', 'location', 'listenbrainz'] as (keyof MiUserProfile)[]) {
|
for (const field of ['description', 'followedMessage', 'birthday', 'location', 'listenbrainz'] as (keyof MiUserProfile)[]) {
|
||||||
|
/* eslint-disable-next-line no-prototype-builtins */
|
||||||
if (newProfile.hasOwnProperty(field) && oldProfile[field] !== newProfile[field]) {
|
if (newProfile.hasOwnProperty(field) && oldProfile[field] !== newProfile[field]) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const arrayField of ['fields'] as (keyof MiUserProfile)[]) {
|
for (const arrayField of ['fields'] as (keyof MiUserProfile)[]) {
|
||||||
|
/* eslint-disable-next-line no-prototype-builtins */
|
||||||
if (newProfile.hasOwnProperty(arrayField) !== oldProfile.hasOwnProperty(arrayField)) {
|
if (newProfile.hasOwnProperty(arrayField) !== oldProfile.hasOwnProperty(arrayField)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue