refactor: remove null comparisons
This commit is contained in:
@@ -139,7 +139,7 @@ function setText(node: TestText, text: string) {
|
||||
|
||||
function insert(child: TestNode, parent: TestElement, ref?: TestNode | null) {
|
||||
let refIndex
|
||||
if (ref != null) {
|
||||
if (ref) {
|
||||
refIndex = parent.children.indexOf(ref)
|
||||
if (refIndex === -1) {
|
||||
console.error('ref: ', ref)
|
||||
@@ -168,7 +168,7 @@ function insert(child: TestNode, parent: TestElement, ref?: TestNode | null) {
|
||||
|
||||
function remove(child: TestNode, logOp: boolean = true) {
|
||||
const parent = child.parentNode
|
||||
if (parent != null) {
|
||||
if (parent) {
|
||||
if (logOp) {
|
||||
logNodeOp({
|
||||
type: NodeOpTypes.REMOVE,
|
||||
|
||||
Reference in New Issue
Block a user