collect-your-stuff 1.2.7 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +2525 -2525
  2. package/browser/collect-your-stuff.js +22766 -22761
  3. package/browser/collect-your-stuff.min.js +1 -1
  4. package/dist/collections/arrayable/ArrayElement.d.ts +36 -36
  5. package/dist/collections/arrayable/ArrayElement.js +64 -64
  6. package/dist/collections/arrayable/Arrayable.d.ts +108 -108
  7. package/dist/collections/arrayable/Arrayable.js +188 -188
  8. package/dist/collections/doubly-linked-list/DoubleLinker.d.ts +46 -46
  9. package/dist/collections/doubly-linked-list/DoubleLinker.js +69 -69
  10. package/dist/collections/doubly-linked-list/DoublyLinkedList.d.ts +113 -113
  11. package/dist/collections/doubly-linked-list/DoublyLinkedList.js +274 -269
  12. package/dist/collections/doubly-linked-list/DoublyLinkedList.min.js +1 -1
  13. package/dist/collections/linked-list/LinkedList.d.ts +109 -109
  14. package/dist/collections/linked-list/LinkedList.js +233 -233
  15. package/dist/collections/linked-list/Linker.d.ts +43 -43
  16. package/dist/collections/linked-list/Linker.js +80 -80
  17. package/dist/collections/linked-tree-list/LinkedTreeList.d.ts +135 -135
  18. package/dist/collections/linked-tree-list/LinkedTreeList.js +252 -252
  19. package/dist/collections/linked-tree-list/TreeLinker.d.ts +63 -63
  20. package/dist/collections/linked-tree-list/TreeLinker.js +79 -79
  21. package/dist/collections/queue/Queue.d.ts +63 -63
  22. package/dist/collections/queue/Queue.js +130 -130
  23. package/dist/collections/queue/Queueable.d.ts +77 -77
  24. package/dist/collections/queue/Queueable.js +141 -141
  25. package/dist/collections/stack/Stack.d.ts +63 -63
  26. package/dist/collections/stack/Stack.js +106 -106
  27. package/dist/collections/stack/Stackable.d.ts +56 -56
  28. package/dist/collections/stack/Stackable.js +83 -83
  29. package/dist/main.d.ts +40 -40
  30. package/dist/main.js +50 -50
  31. package/dist/recipes/ArrayIterator.d.ts +10 -10
  32. package/dist/recipes/ArrayIterator.js +29 -29
  33. package/dist/recipes/DoubleLinkerIterator.d.ts +9 -9
  34. package/dist/recipes/DoubleLinkerIterator.js +24 -24
  35. package/dist/recipes/IsArrayable.d.ts +105 -105
  36. package/dist/recipes/IsArrayable.js +5 -5
  37. package/dist/recipes/IsDoubleLinker.d.ts +14 -14
  38. package/dist/recipes/IsDoubleLinker.js +5 -5
  39. package/dist/recipes/IsElement.d.ts +14 -14
  40. package/dist/recipes/IsElement.js +5 -5
  41. package/dist/recipes/IsLinker.d.ts +10 -10
  42. package/dist/recipes/IsLinker.js +5 -5
  43. package/dist/recipes/IsTree.d.ts +11 -11
  44. package/dist/recipes/IsTree.js +5 -5
  45. package/dist/recipes/IsTreeNode.d.ts +29 -29
  46. package/dist/recipes/IsTreeNode.js +5 -5
  47. package/dist/recipes/LinkerIterator.d.ts +9 -9
  48. package/dist/recipes/LinkerIterator.js +24 -24
  49. package/dist/recipes/Runnable.d.ts +54 -54
  50. package/dist/recipes/Runnable.js +68 -68
  51. package/dist/recipes/TreeLinkerIterator.d.ts +9 -9
  52. package/dist/recipes/TreeLinkerIterator.js +25 -25
  53. package/dist/recipes/recipes.d.ts +15 -15
  54. package/dist/recipes/recipes.js +22 -22
  55. package/dist/services/parseTree.d.ts +9 -9
  56. package/dist/services/parseTree.js +24 -24
  57. package/dist/services/parseTreeNext.d.ts +14 -14
  58. package/dist/services/parseTreeNext.js +47 -47
  59. package/dist/services/services.d.ts +13 -13
  60. package/dist/services/services.js +22 -22
  61. package/package.json +1 -1
@@ -1,47 +1,47 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.parseTreeNext = void 0
7
- /**
8
- * Be able to parse over every node in a tree.
9
- * 1. Start at root (get root parent)
10
- * 2. Get first child (repeat until no children)
11
- * 3. Check next child
12
- * 4. Repeat 2
13
- * 5. Repeat 3
14
- * 6. If no next child, return to parent and repeat 3
15
- * 7. Stop at root (next is null and parent is null
16
- * @param {IsTreeNode} treeNode Provide a node in a tree and get the next node (left-first approach)
17
- * @returns {IsTreeNode|null}
18
- */
19
- const parseTreeNext = treeNode => {
20
- if (!treeNode) {
21
- return null
22
- }
23
- let test = null
24
- if (treeNode.children && treeNode.children.length) {
25
- // Go down the left side of the tree
26
- test = treeNode.children.first
27
- }
28
- if (!test) {
29
- // Reached the bottom, go the next node on the right
30
- test = treeNode.next
31
- }
32
- if (!test && treeNode.parent) {
33
- // No more child nodes, return to parent and check parent sibling on the right
34
- let parentNext = treeNode.parent.next
35
- let parent = treeNode.parent
36
- while (parent && !parentNext) {
37
- parentNext = parent.next
38
- // Keep checking parent next, until there are no more parents, or we find the parent sibling
39
- parent = parent.parent
40
- }
41
- // This may be the parent sibling, or it could be null indicating we are done
42
- test = parentNext
43
- }
44
- // Finally, either use the node we found, or it may be null
45
- return test
46
- }
47
- exports.parseTreeNext = parseTreeNext
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.parseTreeNext = void 0
7
+ /**
8
+ * Be able to parse over every node in a tree.
9
+ * 1. Start at root (get root parent)
10
+ * 2. Get first child (repeat until no children)
11
+ * 3. Check next child
12
+ * 4. Repeat 2
13
+ * 5. Repeat 3
14
+ * 6. If no next child, return to parent and repeat 3
15
+ * 7. Stop at root (next is null and parent is null
16
+ * @param {IsTreeNode} treeNode Provide a node in a tree and get the next node (left-first approach)
17
+ * @returns {IsTreeNode|null}
18
+ */
19
+ const parseTreeNext = treeNode => {
20
+ if (!treeNode) {
21
+ return null
22
+ }
23
+ let test = null
24
+ if (treeNode.children && treeNode.children.length) {
25
+ // Go down the left side of the tree
26
+ test = treeNode.children.first
27
+ }
28
+ if (!test) {
29
+ // Reached the bottom, go the next node on the right
30
+ test = treeNode.next
31
+ }
32
+ if (!test && treeNode.parent) {
33
+ // No more child nodes, return to parent and check parent sibling on the right
34
+ let parentNext = treeNode.parent.next
35
+ let parent = treeNode.parent
36
+ while (parent && !parentNext) {
37
+ parentNext = parent.next
38
+ // Keep checking parent next, until there are no more parents, or we find the parent sibling
39
+ parent = parent.parent
40
+ }
41
+ // This may be the parent sibling, or it could be null indicating we are done
42
+ test = parentNext
43
+ }
44
+ // Finally, either use the node we found, or it may be null
45
+ return test
46
+ }
47
+ exports.parseTreeNext = parseTreeNext
@@ -1,13 +1,13 @@
1
- /**
2
- * @file some useful resources when working with collections.
3
- * @author Joshua Heagle <joshuaheagle@gmail.com>
4
- * @version 1.1.0
5
- * @memberOf module:collect-your-stuff
6
- */
7
- /**
8
- * List helpful functions when dealing with collections.
9
- */
10
- export declare const services: {
11
- parseTree: (tree: import("../recipes/IsTree").IsTree, callback: import("../recipes/IsArrayable").forEachCallback) => import("../recipes/IsTree").IsTree;
12
- parseTreeNext: (treeNode: import("../recipes/IsTreeNode").IsTreeNode) => import("../recipes/IsTreeNode").IsTreeNode | null;
13
- };
1
+ /**
2
+ * @file some useful resources when working with collections.
3
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
4
+ * @version 1.1.0
5
+ * @memberOf module:collect-your-stuff
6
+ */
7
+ /**
8
+ * List helpful functions when dealing with collections.
9
+ */
10
+ export declare const services: {
11
+ parseTree: (tree: import("../recipes/IsTree").IsTree, callback: import("../recipes/IsArrayable").forEachCallback) => import("../recipes/IsTree").IsTree;
12
+ parseTreeNext: (treeNode: import("../recipes/IsTreeNode").IsTreeNode) => import("../recipes/IsTreeNode").IsTreeNode | null;
13
+ };
@@ -1,22 +1,22 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.services = void 0
7
- var _parseTree = require('./parseTree')
8
- var _parseTreeNext = require('./parseTreeNext')
9
- /**
10
- * @file some useful resources when working with collections.
11
- * @author Joshua Heagle <joshuaheagle@gmail.com>
12
- * @version 1.1.0
13
- * @memberOf module:collect-your-stuff
14
- */
15
-
16
- /**
17
- * List helpful functions when dealing with collections.
18
- */
19
- const services = exports.services = {
20
- parseTree: _parseTree.parseTree,
21
- parseTreeNext: _parseTreeNext.parseTreeNext
22
- }
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.services = void 0
7
+ var _parseTree = require('./parseTree')
8
+ var _parseTreeNext = require('./parseTreeNext')
9
+ /**
10
+ * @file some useful resources when working with collections.
11
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
12
+ * @version 1.1.0
13
+ * @memberOf module:collect-your-stuff
14
+ */
15
+
16
+ /**
17
+ * List helpful functions when dealing with collections.
18
+ */
19
+ const services = exports.services = {
20
+ parseTree: _parseTree.parseTree,
21
+ parseTreeNext: _parseTreeNext.parseTreeNext
22
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "collect-your-stuff",
3
3
  "description": "Use a variety of collections to collect your stuff when building code.",
4
- "version": "1.2.7",
4
+ "version": "1.2.8",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
7
7
  "author": "Joshua Heagle",