Skip to content

Commit

Permalink
v1.2.34
Browse files Browse the repository at this point in the history
  • Loading branch information
clarketm committed Dec 1, 2018
1 parent b38361e commit 6f5d7c0
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions dist/super.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,7 @@ var LinkedList = function () {

this._size = size;
this._head = head.next;
this._tail = curr;
this._tail = prev;
}

/**
Expand Down Expand Up @@ -4650,7 +4650,7 @@ var Trie = function () {
return Trie;
}();

var version = "1.2.33";
var version = "1.2.34";

var Super = {
version: version,
Expand Down
4 changes: 2 additions & 2 deletions dist/super.js
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,7 @@

this._size = size;
this._head = head.next;
this._tail = curr;
this._tail = prev;
}

/**
Expand Down Expand Up @@ -4656,7 +4656,7 @@
return Trie;
}();

var version = "1.2.33";
var version = "1.2.34";

var Super = {
version: version,
Expand Down
4 changes: 2 additions & 2 deletions dist/super.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/ast/source/LinkedList/src/lib/LinkedList.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -1468,9 +1468,9 @@
"line": 46,
"column": 21
},
"identifierName": "curr"
"identifierName": "prev"
},
"name": "curr"
"name": "prev"
}
}
}
Expand Down Expand Up @@ -10011,9 +10011,9 @@
"line": 46,
"column": 21
},
"identifierName": "curr"
"identifierName": "prev"
},
"name": "curr"
"name": "prev"
}
}
}
Expand Down Expand Up @@ -20204,7 +20204,7 @@
"postfix": false,
"binop": null
},
"value": "curr",
"value": "prev",
"start": 642,
"end": 646,
"loc": {
Expand Down
2 changes: 1 addition & 1 deletion docs/file/packages/LinkedList/src/lib/LinkedList.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@

this._size = size;
this._head = head.next;
this._tail = curr;
this._tail = prev;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion docs/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,7 @@
"__docId__": 64,
"kind": "file",
"name": "packages/LinkedList/src/lib/LinkedList.js",
"content": "/**\n * @flow\n * @module super/linkedlist\n */\n\nimport { ListNode } from \"./ListNode\";\nimport type { Item } from \"../../../shared/src/types\";\n\n/**\n *\n * LinkedList with superpowers! 💪\n *\n * @public\n *\n */\nclass LinkedList {\n /** @private */\n _size: number;\n\n /** @private */\n _head: ?ListNode;\n\n /** @private */\n _tail: ?ListNode;\n\n /**\n * @public\n *\n * @desc Construct a LinkedList\n *\n * @param {Array<Item>} iterable\n */\n constructor(iterable: Array<Item> = []) {\n let head = new ListNode(0);\n let prev = null;\n let curr = head;\n let size = 0;\n\n for (let item: Item of iterable) {\n curr.next = new ListNode(item);\n curr = curr.next;\n\n curr.prev = prev;\n prev = curr;\n\n size++;\n }\n\n this._size = size;\n this._head = head.next;\n this._tail = curr;\n }\n\n /**\n * @public\n *\n * @desc Get the head of the list\n *\n * @returns {ListNode} head node\n */\n get head(): ?ListNode {\n return this._head;\n }\n\n /**\n * @public\n *\n * @desc Get the tail of the list\n *\n * @returns {ListNode} tail node\n */\n get tail(): ?ListNode {\n return this._tail;\n }\n\n /**\n * @public\n *\n * @desc Get the size of the list\n *\n * @returns {number} number of nodes in the list\n */\n get size(): number {\n return this._size;\n }\n\n /**\n * @public\n *\n * @desc Insert a node at a given position\n *\n * @param {number} position - position to insert node\n * @param {Item} value - value to insert into list\n * @returns {number} size after insertion\n */\n // TODO: insert by value\n insert(position: number, value: Item): number {\n if (position < 0) {\n return this.insert(Math.max(0, this.size + 1 - Math.abs(position)), value);\n }\n\n let prev = null;\n let curr = this.head;\n\n let p = 0;\n while (p < position && curr) {\n prev = curr;\n curr = curr.next;\n p++;\n }\n\n let node = new ListNode(value);\n node.prev = prev;\n node.next = curr;\n\n if (prev) prev.next = node;\n else this._head = node;\n\n if (curr) curr.prev = node;\n else this._tail = node;\n\n this._size++;\n\n return this._size;\n }\n\n /**\n * @public\n *\n * @alias insert(0, value)\n *\n * @desc Prepend a node to the front of the list\n *\n * @param {Item} value - value to prepend to list\n * @returns {number} size after insertion\n */\n prepend(value: Item): number {\n return this.insert(0, value);\n }\n\n /**\n * @public\n *\n * @alias insert(0, value)\n *\n * @desc Unshift a node to the front of the list\n *\n * @param {Item} value - value to unshift to list\n * @returns {number} size after insertion\n */\n unshift(value: Item): number {\n return this.prepend(value);\n }\n\n /**\n * @public\n *\n * @alias insert(list.size, value)\n *\n * @desc Append a node to the rear of the list\n *\n * @param {Item} value - value to append to list\n * @returns {number} size after insertion\n */\n append(value: Item): number {\n return this.insert(this.size, value);\n }\n\n /**\n * @public\n *\n * @alias insert(list.size, value)\n *\n * @desc Push a node to the rear of the list\n *\n * @param {Item} value - value to push to list\n * @returns {number} size after insertion\n */\n push(value: Item): number {\n return this.append(value);\n }\n\n /**\n * @public\n *\n * @desc Remove a node at a given position\n *\n * @param {number} position - position to remove node\n * @returns {Item} removed item\n */\n // TODO: remove by value\n remove(position: number): Item {\n if (position < 0) {\n return this.remove(Math.max(0, this.size - Math.abs(position)));\n }\n\n let prev = null;\n let curr = this.head;\n\n let p = 0;\n while (p < position && curr) {\n prev = curr;\n curr = curr.next;\n p++;\n }\n\n if (prev && curr && curr.next) {\n prev.next = curr.next;\n // $FlowFixMe\n curr.next.prev = prev;\n this._size--;\n } else if (prev && curr) {\n prev.next = null;\n this._tail = prev;\n this._size--;\n } else if (curr && curr.next) {\n curr.next.prev = null;\n this._head = curr.next;\n this._size--;\n }\n\n return curr;\n }\n\n /**\n * @public\n *\n * @alias remove(0)\n *\n * @desc Shift a node from the front of list\n *\n * @returns {Item} shifted item\n */\n shift(): Item {\n return this.remove(0);\n }\n\n /**\n * @public\n *\n * @alias remove(list.size - 1)\n *\n * @desc Pop a node from the rear of list\n *\n * @returns {Item} shifted item\n */\n pop(): Item {\n return this.remove(this.size - 1);\n }\n\n // TODO:\n // searchNodeAt (position: number)\n\n /**\n * @public\n *\n * @desc Convert the node and next nodes (recursively) to an array\n *\n * @returns {Array<Item>} array representation of the list\n */\n toArray(): Array<Item> {\n let array = [];\n let node = this.head;\n\n while (node) {\n array.push(node.value);\n node = node.next;\n }\n\n return array;\n }\n}\n\nexport { LinkedList };\n",
"content": "/**\n * @flow\n * @module super/linkedlist\n */\n\nimport { ListNode } from \"./ListNode\";\nimport type { Item } from \"../../../shared/src/types\";\n\n/**\n *\n * LinkedList with superpowers! 💪\n *\n * @public\n *\n */\nclass LinkedList {\n /** @private */\n _size: number;\n\n /** @private */\n _head: ?ListNode;\n\n /** @private */\n _tail: ?ListNode;\n\n /**\n * @public\n *\n * @desc Construct a LinkedList\n *\n * @param {Array<Item>} iterable\n */\n constructor(iterable: Array<Item> = []) {\n let head = new ListNode(0);\n let prev = null;\n let curr = head;\n let size = 0;\n\n for (let item: Item of iterable) {\n curr.next = new ListNode(item);\n curr = curr.next;\n\n curr.prev = prev;\n prev = curr;\n\n size++;\n }\n\n this._size = size;\n this._head = head.next;\n this._tail = prev;\n }\n\n /**\n * @public\n *\n * @desc Get the head of the list\n *\n * @returns {ListNode} head node\n */\n get head(): ?ListNode {\n return this._head;\n }\n\n /**\n * @public\n *\n * @desc Get the tail of the list\n *\n * @returns {ListNode} tail node\n */\n get tail(): ?ListNode {\n return this._tail;\n }\n\n /**\n * @public\n *\n * @desc Get the size of the list\n *\n * @returns {number} number of nodes in the list\n */\n get size(): number {\n return this._size;\n }\n\n /**\n * @public\n *\n * @desc Insert a node at a given position\n *\n * @param {number} position - position to insert node\n * @param {Item} value - value to insert into list\n * @returns {number} size after insertion\n */\n // TODO: insert by value\n insert(position: number, value: Item): number {\n if (position < 0) {\n return this.insert(Math.max(0, this.size + 1 - Math.abs(position)), value);\n }\n\n let prev = null;\n let curr = this.head;\n\n let p = 0;\n while (p < position && curr) {\n prev = curr;\n curr = curr.next;\n p++;\n }\n\n let node = new ListNode(value);\n node.prev = prev;\n node.next = curr;\n\n if (prev) prev.next = node;\n else this._head = node;\n\n if (curr) curr.prev = node;\n else this._tail = node;\n\n this._size++;\n\n return this._size;\n }\n\n /**\n * @public\n *\n * @alias insert(0, value)\n *\n * @desc Prepend a node to the front of the list\n *\n * @param {Item} value - value to prepend to list\n * @returns {number} size after insertion\n */\n prepend(value: Item): number {\n return this.insert(0, value);\n }\n\n /**\n * @public\n *\n * @alias insert(0, value)\n *\n * @desc Unshift a node to the front of the list\n *\n * @param {Item} value - value to unshift to list\n * @returns {number} size after insertion\n */\n unshift(value: Item): number {\n return this.prepend(value);\n }\n\n /**\n * @public\n *\n * @alias insert(list.size, value)\n *\n * @desc Append a node to the rear of the list\n *\n * @param {Item} value - value to append to list\n * @returns {number} size after insertion\n */\n append(value: Item): number {\n return this.insert(this.size, value);\n }\n\n /**\n * @public\n *\n * @alias insert(list.size, value)\n *\n * @desc Push a node to the rear of the list\n *\n * @param {Item} value - value to push to list\n * @returns {number} size after insertion\n */\n push(value: Item): number {\n return this.append(value);\n }\n\n /**\n * @public\n *\n * @desc Remove a node at a given position\n *\n * @param {number} position - position to remove node\n * @returns {Item} removed item\n */\n // TODO: remove by value\n remove(position: number): Item {\n if (position < 0) {\n return this.remove(Math.max(0, this.size - Math.abs(position)));\n }\n\n let prev = null;\n let curr = this.head;\n\n let p = 0;\n while (p < position && curr) {\n prev = curr;\n curr = curr.next;\n p++;\n }\n\n if (prev && curr && curr.next) {\n prev.next = curr.next;\n // $FlowFixMe\n curr.next.prev = prev;\n this._size--;\n } else if (prev && curr) {\n prev.next = null;\n this._tail = prev;\n this._size--;\n } else if (curr && curr.next) {\n curr.next.prev = null;\n this._head = curr.next;\n this._size--;\n }\n\n return curr;\n }\n\n /**\n * @public\n *\n * @alias remove(0)\n *\n * @desc Shift a node from the front of list\n *\n * @returns {Item} shifted item\n */\n shift(): Item {\n return this.remove(0);\n }\n\n /**\n * @public\n *\n * @alias remove(list.size - 1)\n *\n * @desc Pop a node from the rear of list\n *\n * @returns {Item} shifted item\n */\n pop(): Item {\n return this.remove(this.size - 1);\n }\n\n // TODO:\n // searchNodeAt (position: number)\n\n /**\n * @public\n *\n * @desc Convert the node and next nodes (recursively) to an array\n *\n * @returns {Array<Item>} array representation of the list\n */\n toArray(): Array<Item> {\n let array = [];\n let node = this.head;\n\n while (node) {\n array.push(node.value);\n node = node.next;\n }\n\n return array;\n }\n}\n\nexport { LinkedList };\n",
"static": true,
"longname": "/Users/clarketm/js/super/packages/LinkedList/src/lib/LinkedList.js",
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion docs/source.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<td class="coverage"><span data-ice="coverage">82 %</span><span data-ice="coverageCount" class="coverage-count">14/17</span></td>
<td style="display: none;" data-ice="size">5001 byte</td>
<td style="display: none;" data-ice="lines">274</td>
<td style="display: none;" data-ice="updated">2018-05-05 15:39:24 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-12-07 10:55:02 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/packages/LinkedList/src/lib/ListNode.js.html#errorLines=23,70,91">packages/LinkedList/src/lib/ListNode.js</a></span></td>
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
"version": "1.2.33"
"version": "1.2.34"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clarketm/super",
"version": "1.2.33",
"version": "1.2.34",
"description": "Data structures, data types, and algorithms with superpowers! 💪",
"main": "dist/super.js",
"module": "dist/super.es.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/LinkedList/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clarketm/superlinkedlist",
"version": "1.2.32",
"version": "1.2.34",
"description": "LinkedList with superpowers! 💪",
"main": "./lib/LinkedList.js",
"files": [
Expand Down

0 comments on commit 6f5d7c0

Please sign in to comment.