optional chaining
This commit is contained in:
parent
0fc8eec293
commit
5ea3d462b9
34 changed files with 68 additions and 77 deletions
|
|
@ -245,7 +245,7 @@ export const OPACITIES = Object.entries(SLOT_INHERITANCE).reduce((acc, [k]) => {
|
|||
[opacity]: {
|
||||
defaultValue: DEFAULT_OPACITY[opacity] || 1,
|
||||
affectedSlots: [
|
||||
...((acc[opacity] && acc[opacity].affectedSlots) || []),
|
||||
...((acc[opacity]?.affectedSlots) || []),
|
||||
k,
|
||||
],
|
||||
},
|
||||
|
|
@ -413,7 +413,7 @@ export const getColors = (sourceColors, sourceOpacity) =>
|
|||
outputColor.a = Number(
|
||||
opacityOverriden
|
||||
? sourceOpacity[opacitySlot]
|
||||
: (OPACITIES[opacitySlot] || {}).defaultValue,
|
||||
: OPACITIES[opacitySlot]?.defaultValue,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue