optional chaining
This commit is contained in:
parent
59f3ca65ca
commit
cf85b00c0a
26 changed files with 34 additions and 34 deletions
|
|
@ -14,7 +14,7 @@ export function StatusCodeError(statusCode, body, options, response) {
|
|||
this.name = 'StatusCodeError'
|
||||
this.statusCode = statusCode
|
||||
this.statusText = body.error || body.errors || body
|
||||
this.details = JSON && JSON.stringify ? JSON.stringify(body) : body
|
||||
this.details = JSON.stringify(body)
|
||||
this.errorData = body.error || body.errors
|
||||
this.message = this.statusCode + ' - ' + this.statusText
|
||||
this.error = body // legacy attribute
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ export const SLOT_ORDERED = topoSort(
|
|||
Object.entries(SLOT_INHERITANCE)
|
||||
.sort(
|
||||
([, aV], [, bV]) =>
|
||||
((aV && aV.priority) || 0) - ((bV && bV.priority) || 0),
|
||||
((aV?.priority) || 0) - ((bV && bV.priority) || 0),
|
||||
)
|
||||
.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {}),
|
||||
)
|
||||
|
|
@ -408,7 +408,7 @@ export const getColors = (sourceColors, sourceOpacity) =>
|
|||
delete outputColor.a
|
||||
} else {
|
||||
// Otherwise try to assign opacity
|
||||
if (dependencyColor && dependencyColor.a === 0) {
|
||||
if (dependencyColor?.a === 0) {
|
||||
// transparent dependency shall make dependents transparent too
|
||||
outputColor.a = 0
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@ const generateProfileLink = (id, screenName, restrictedNicknames) => {
|
|||
}
|
||||
}
|
||||
|
||||
const isExternal = (screenName) => screenName && screenName.includes('@')
|
||||
const isExternal = (screenName) => screenName?.includes('@')
|
||||
|
||||
export default generateProfileLink
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue