Skip to content

Commit f089a43

Browse files
committed
chore(rollup): use undefined instead of null
1 parent e0775f4 commit f089a43

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/lib/LinkedList.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55

66
export class Node<T> {
7-
public left: Node<T> | null
8-
public right: Node<T> | null
7+
public left: Node<T> | undefined
8+
public right: Node<T> | undefined
99

1010
constructor (public value: T) {
11-
this.right = null
12-
this.left = null
11+
this.right = undefined
12+
this.left = undefined
1313
}
1414

1515
static of <T> (val: T) {
@@ -19,11 +19,11 @@ export class Node<T> {
1919

2020
export class LinkedList<T> {
2121
public length: number
22-
private __head: Node<T> | null
22+
private __head: Node<T> | undefined
2323

2424
constructor () {
2525
this.length = 0
26-
this.__head = null
26+
this.__head = undefined
2727
}
2828

2929
element () {
@@ -58,12 +58,12 @@ export class LinkedList<T> {
5858
}
5959
else if (n.left) {
6060
this.__head = n.left
61-
n.left.right = null
61+
n.left.right = undefined
6262
}
6363
else if (n.right) {
64-
n.right.left = null
64+
n.right.left = undefined
6565
} else {
66-
this.__head = null
66+
this.__head = undefined
6767
}
6868
this.length--
6969
}

0 commit comments

Comments
 (0)