doublylinked
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -21,7 +21,7 @@ /* doublylinked | ||
constructor(...element) { | ||
this._cursor = null; | ||
this._head = null; | ||
this._tail = null; | ||
this._cursor = undefined; | ||
this._head = undefined; | ||
this._tail = undefined; | ||
this._length = 0; | ||
this._eof = null; | ||
this._eof = undefined; | ||
if (arguments.length) | ||
@@ -66,7 +66,7 @@ this.push.apply(this, arguments); | ||
* | ||
* @param {String} args... - Lists and/or values to concatenate into a new list | ||
* @param {String} element... - Lists and/or values to concatenate into a new list | ||
* @return {DoublyLinked} - A new DoublyLinked instance | ||
* @public | ||
*/ | ||
concat(...args) { | ||
concat(...element) { | ||
const result = new DoublyLinked(); | ||
@@ -78,3 +78,3 @@ const mergeFn = (acc, node) => { | ||
this.reduce(mergeFn, result); | ||
for (const arg of args) { | ||
for (const arg of element) { | ||
if (arg instanceof DoublyLinked) | ||
@@ -91,3 +91,3 @@ arg.reduce(mergeFn, result); | ||
* | ||
* @return {{next: next, _first: boolean}} | ||
* @return {{next: function}} | ||
*/ | ||
@@ -441,3 +441,3 @@ entries() { | ||
reset() { | ||
this._cursor = null; | ||
this._cursor = undefined; | ||
this._eof = false; | ||
@@ -584,4 +584,4 @@ return this; | ||
this.value = value; | ||
this.prev = null; | ||
this.next = null; | ||
this.prev = undefined; | ||
this.next = undefined; | ||
} | ||
@@ -593,4 +593,6 @@ | ||
if (this.prev) | ||
// noinspection JSUnresolvedVariable | ||
this.prev.next = this.next; | ||
if (this.next) | ||
// noinspection JSUnresolvedVariable | ||
this.next.prev = this.prev; | ||
@@ -604,5 +606,5 @@ if (this === this.list._cursor) | ||
this.list._length--; | ||
this.prev = null; | ||
this.next = null; | ||
this.list = null; | ||
this.prev = undefined; | ||
this.next = undefined; | ||
this.list = undefined; | ||
} | ||
@@ -615,2 +617,2 @@ } | ||
module.exports = DoublyLinked; | ||
module.exports = DoublyLinked; |
{ | ||
"name": "doublylinked", | ||
"description": "Doubly linked list implementation for JavaScript with iterator and array-like interface", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"author": "Panates Ltd.", | ||
@@ -21,7 +21,7 @@ "contributors": [ | ||
"devDependencies": { | ||
"babel-eslint": "^10.0.1", | ||
"eslint": "^5.7.0", | ||
"eslint-config-google": "^0.10.0", | ||
"nyc": "^13.0.1", | ||
"mocha": "^5.2.0" | ||
"babel-eslint": "^10.0.2", | ||
"eslint": "^6.1.0", | ||
"eslint-config-google": "^0.13.0", | ||
"mocha": "^6.2.0", | ||
"nyc": "^14.1.1" | ||
}, | ||
@@ -28,0 +28,0 @@ "engines": { |
36631
5
612