deal with no-prototype-builtins
This commit is contained in:
parent
fddb531ed2
commit
fc18673030
6 changed files with 12 additions and 6 deletions
|
|
@ -39,9 +39,9 @@ const qvitterStatusType = (status) => {
|
|||
|
||||
export const parseUser = (data) => {
|
||||
const output = {}
|
||||
const masto = data.hasOwnProperty('acct')
|
||||
const masto = Object.prototype.hasOwnProperty.call(data, 'acct')
|
||||
// case for users in "mentions" property for statuses in MastoAPI
|
||||
const mastoShort = masto && !data.hasOwnProperty('avatar')
|
||||
const mastoShort = masto && !Object.prototype.hasOwnProperty.call(data, 'avatar')
|
||||
|
||||
output.id = String(data.id)
|
||||
output._original = data // used for server-side settings
|
||||
|
|
@ -225,7 +225,7 @@ export const parseUser = (data) => {
|
|||
|
||||
export const parseAttachment = (data) => {
|
||||
const output = {}
|
||||
const masto = !data.hasOwnProperty('oembed')
|
||||
const masto = !Object.prototype.hasOwnProperty.call(data, 'oembed')
|
||||
|
||||
if (masto) {
|
||||
// Not exactly same...
|
||||
|
|
@ -246,7 +246,7 @@ export const parseAttachment = (data) => {
|
|||
|
||||
export const parseStatus = (data) => {
|
||||
const output = {}
|
||||
const masto = data.hasOwnProperty('account')
|
||||
const masto = Object.prototype.hasOwnProperty.call(data, 'account')
|
||||
|
||||
if (masto) {
|
||||
output.favorited = data.favourited
|
||||
|
|
@ -374,7 +374,7 @@ export const parseNotification = (data) => {
|
|||
favourite: 'like',
|
||||
reblog: 'repeat'
|
||||
}
|
||||
const masto = !data.hasOwnProperty('ntype')
|
||||
const masto = !Object.prototype.hasOwnProperty.call(data, 'ntype')
|
||||
const output = {}
|
||||
|
||||
if (masto) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ export class RegistrationError extends Error {
|
|||
// the error is probably a JSON object with a single key, "errors", whose value is another JSON object containing the real errors
|
||||
if (typeof error === 'string') {
|
||||
error = JSON.parse(error)
|
||||
// eslint-disable-next-line
|
||||
if (error.hasOwnProperty('error')) {
|
||||
error = JSON.parse(error.error)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue