fix(core): avoid lint errors

pull/3359/head
Arman Ozak 6 years ago
parent d56f2c7f94
commit 6599c2a676

@ -796,7 +796,7 @@ describe('Linked List (Doubly)', () => {
const arr = [];
for (let value of list) {
for (const value of list) {
arr.push(value);
}

@ -1,3 +1,5 @@
/* tslint:disable:no-non-null-assertion */
import compare from 'just-compare';
export class ListNode<T = any> {
@ -25,7 +27,11 @@ export class LinkedList<T = any> {
return this.size;
}
private linkWith(value: T, previousNode: ListNode<T>, nextNode: ListNode<T>): ListNode<T> {
private linkWith(
value: T,
previousNode: ListNode<T> | undefined,
nextNode: ListNode<T> | undefined,
): ListNode<T> {
const node = new ListNode(value);
if (!previousNode) return this.addHead(value);
@ -154,7 +160,7 @@ export class LinkedList<T = any> {
for (let current = this.first, position = 0; current; position += 1, current = current.next) {
if (compareFn(current.value, value)) {
dropped.push(this.dropByIndex(position - dropped.length));
dropped.push(this.dropByIndex(position - dropped.length)!);
}
}

Loading…
Cancel
Save