refactor: remove null comparisons
This commit is contained in:
@@ -14,7 +14,7 @@ export function patchDOMProp(
|
||||
parentSuspense: any,
|
||||
unmountChildren: any
|
||||
) {
|
||||
if ((key === 'innerHTML' || key === 'textContent') && prevChildren != null) {
|
||||
if ((key === 'innerHTML' || key === 'textContent') && prevChildren) {
|
||||
unmountChildren(prevChildren, parentComponent, parentSuspense)
|
||||
el[key] = value == null ? '' : value
|
||||
return
|
||||
|
||||
@@ -8,7 +8,7 @@ let tempSVGContainer: SVGElement
|
||||
|
||||
export const nodeOps: Omit<RendererOptions<Node, Element>, 'patchProp'> = {
|
||||
insert: (child, parent, anchor) => {
|
||||
if (anchor != null) {
|
||||
if (anchor) {
|
||||
parent.insertBefore(child, anchor)
|
||||
} else {
|
||||
parent.appendChild(child)
|
||||
@@ -17,7 +17,7 @@ export const nodeOps: Omit<RendererOptions<Node, Element>, 'patchProp'> = {
|
||||
|
||||
remove: child => {
|
||||
const parent = child.parentNode
|
||||
if (parent != null) {
|
||||
if (parent) {
|
||||
parent.removeChild(child)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user