diff --git a/npm/ng-packs/packages/core/src/lib/tests/linked-list.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/linked-list.spec.ts index 77b748cf0d..d52050c0ad 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/linked-list.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/linked-list.spec.ts @@ -796,7 +796,7 @@ describe('Linked List (Doubly)', () => { const arr = []; - for (let value of list) { + for (const value of list) { arr.push(value); } diff --git a/npm/ng-packs/packages/core/src/lib/utils/linked-list.ts b/npm/ng-packs/packages/core/src/lib/utils/linked-list.ts index 9c47a6ad9b..6d2435acdb 100644 --- a/npm/ng-packs/packages/core/src/lib/utils/linked-list.ts +++ b/npm/ng-packs/packages/core/src/lib/utils/linked-list.ts @@ -1,3 +1,5 @@ +/* tslint:disable:no-non-null-assertion */ + import compare from 'just-compare'; export class ListNode { @@ -25,7 +27,11 @@ export class LinkedList { return this.size; } - private linkWith(value: T, previousNode: ListNode, nextNode: ListNode): ListNode { + private linkWith( + value: T, + previousNode: ListNode | undefined, + nextNode: ListNode | undefined, + ): ListNode { const node = new ListNode(value); if (!previousNode) return this.addHead(value); @@ -154,7 +160,7 @@ export class LinkedList { 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)!); } }