collect-your-stuff 1.2.6 → 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.
- package/README.md +2525 -2525
- package/browser/collect-your-stuff.js +22766 -22859
- package/browser/collect-your-stuff.min.js +1 -1
- package/dist/collections/arrayable/ArrayElement.d.ts +36 -36
- package/dist/collections/arrayable/ArrayElement.js +64 -70
- package/dist/collections/arrayable/ArrayElement.min.js +1 -1
- package/dist/collections/arrayable/Arrayable.d.ts +108 -108
- package/dist/collections/arrayable/Arrayable.js +188 -196
- package/dist/collections/arrayable/Arrayable.min.js +1 -1
- package/dist/collections/doubly-linked-list/DoubleLinker.d.ts +46 -46
- package/dist/collections/doubly-linked-list/DoubleLinker.js +69 -77
- package/dist/collections/doubly-linked-list/DoubleLinker.min.js +1 -1
- package/dist/collections/doubly-linked-list/DoublyLinkedList.d.ts +113 -113
- package/dist/collections/doubly-linked-list/DoublyLinkedList.js +274 -277
- package/dist/collections/doubly-linked-list/DoublyLinkedList.min.js +1 -1
- package/dist/collections/linked-list/LinkedList.d.ts +109 -109
- package/dist/collections/linked-list/LinkedList.js +233 -241
- package/dist/collections/linked-list/LinkedList.min.js +1 -1
- package/dist/collections/linked-list/Linker.d.ts +43 -43
- package/dist/collections/linked-list/Linker.js +80 -86
- package/dist/collections/linked-list/Linker.min.js +1 -1
- package/dist/collections/linked-tree-list/LinkedTreeList.d.ts +135 -135
- package/dist/collections/linked-tree-list/LinkedTreeList.js +252 -261
- package/dist/collections/linked-tree-list/LinkedTreeList.min.js +1 -1
- package/dist/collections/linked-tree-list/TreeLinker.d.ts +63 -63
- package/dist/collections/linked-tree-list/TreeLinker.js +79 -92
- package/dist/collections/linked-tree-list/TreeLinker.min.js +1 -1
- package/dist/collections/queue/Queue.d.ts +63 -63
- package/dist/collections/queue/Queue.js +130 -136
- package/dist/collections/queue/Queue.min.js +1 -1
- package/dist/collections/queue/Queueable.d.ts +77 -77
- package/dist/collections/queue/Queueable.js +141 -151
- package/dist/collections/queue/Queueable.min.js +1 -1
- package/dist/collections/stack/Stack.d.ts +63 -63
- package/dist/collections/stack/Stack.js +106 -112
- package/dist/collections/stack/Stack.min.js +1 -1
- package/dist/collections/stack/Stackable.d.ts +56 -56
- package/dist/collections/stack/Stackable.js +83 -91
- package/dist/collections/stack/Stackable.min.js +1 -1
- package/dist/main.d.ts +40 -40
- package/dist/main.js +50 -50
- package/dist/recipes/ArrayIterator.d.ts +10 -10
- package/dist/recipes/ArrayIterator.js +29 -30
- package/dist/recipes/ArrayIterator.min.js +1 -1
- package/dist/recipes/DoubleLinkerIterator.d.ts +9 -9
- package/dist/recipes/DoubleLinkerIterator.js +24 -24
- package/dist/recipes/IsArrayable.d.ts +105 -105
- package/dist/recipes/IsArrayable.js +5 -5
- package/dist/recipes/IsDoubleLinker.d.ts +14 -14
- package/dist/recipes/IsDoubleLinker.js +5 -5
- package/dist/recipes/IsElement.d.ts +14 -14
- package/dist/recipes/IsElement.js +5 -5
- package/dist/recipes/IsLinker.d.ts +10 -10
- package/dist/recipes/IsLinker.js +5 -5
- package/dist/recipes/IsTree.d.ts +11 -11
- package/dist/recipes/IsTree.js +5 -5
- package/dist/recipes/IsTreeNode.d.ts +29 -29
- package/dist/recipes/IsTreeNode.js +5 -5
- package/dist/recipes/LinkerIterator.d.ts +9 -9
- package/dist/recipes/LinkerIterator.js +24 -24
- package/dist/recipes/Runnable.d.ts +54 -54
- package/dist/recipes/Runnable.js +68 -69
- package/dist/recipes/Runnable.min.js +1 -1
- package/dist/recipes/TreeLinkerIterator.d.ts +9 -9
- package/dist/recipes/TreeLinkerIterator.js +25 -25
- package/dist/recipes/recipes.d.ts +15 -15
- package/dist/recipes/recipes.js +22 -22
- package/dist/services/parseTree.d.ts +9 -9
- package/dist/services/parseTree.js +24 -24
- package/dist/services/parseTreeNext.d.ts +14 -14
- package/dist/services/parseTreeNext.js +47 -47
- package/dist/services/services.d.ts +13 -13
- package/dist/services/services.js +22 -22
- package/package.json +2 -2
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
import { IsElement } from './IsElement';
|
|
2
|
-
/**
|
|
3
|
-
* Run this function for each element in this arrayable.
|
|
4
|
-
* @callback forEachCallback
|
|
5
|
-
* @param {number} index
|
|
6
|
-
* @param {IsArrayable} thisArg
|
|
7
|
-
* @returns void
|
|
8
|
-
*/
|
|
9
|
-
export type forEachCallback = (element: IsElement, index?: number, thisArg?: IsArrayable<any>) => void;
|
|
10
|
-
/**
|
|
11
|
-
* Arrayable represents a collection stored as Elements.
|
|
12
|
-
*/
|
|
13
|
-
export interface IsArrayable<T extends IsElement> {
|
|
14
|
-
/**
|
|
15
|
-
* Obnoxious typescript won't let me use typeof this class
|
|
16
|
-
* @property {IsArrayable} classType
|
|
17
|
-
*/
|
|
18
|
-
classType: any;
|
|
19
|
-
/**
|
|
20
|
-
* @property {Array<IsElement> | IsElement | null} innerList
|
|
21
|
-
*/
|
|
22
|
-
innerList: Array<T> | T | null;
|
|
23
|
-
/**
|
|
24
|
-
* @private {boolean} initialized
|
|
25
|
-
*/
|
|
26
|
-
initialized: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Initialize the inner list, should only run once.
|
|
29
|
-
* @param {IsArrayable|Array} initialList
|
|
30
|
-
* @return {IsArrayable}
|
|
31
|
-
*/
|
|
32
|
-
initialize(initialList: Array<T> | T): IsArrayable<any>;
|
|
33
|
-
/**
|
|
34
|
-
* Retrieve a copy of the innerList used.
|
|
35
|
-
* @returns {Array}
|
|
36
|
-
*/
|
|
37
|
-
get list(): Array<IsElement> | IsElement;
|
|
38
|
-
/**
|
|
39
|
-
* Retrieve the first Element from the Arrayable
|
|
40
|
-
* @returns {IsElement}
|
|
41
|
-
*/
|
|
42
|
-
get first(): T;
|
|
43
|
-
/**
|
|
44
|
-
* Retrieve the last Element from the Arrayable
|
|
45
|
-
* @returns {IsElement}
|
|
46
|
-
*/
|
|
47
|
-
get last(): T;
|
|
48
|
-
/**
|
|
49
|
-
* Return the length of the list.
|
|
50
|
-
* @returns {number}
|
|
51
|
-
*/
|
|
52
|
-
get length(): number;
|
|
53
|
-
/**
|
|
54
|
-
* Insert a new node (or data) after a node.
|
|
55
|
-
* @param {IsElement} node
|
|
56
|
-
* @param {IsElement|*} newNode
|
|
57
|
-
* @returns {IsArrayable}
|
|
58
|
-
*/
|
|
59
|
-
insertAfter(node: T, newNode: T | any): IsArrayable<any>;
|
|
60
|
-
/**
|
|
61
|
-
* Insert a new node (or data) before a node.
|
|
62
|
-
* @param {IsElement} node
|
|
63
|
-
* @param {IsElement|*} newNode
|
|
64
|
-
* @returns {IsArrayable}
|
|
65
|
-
*/
|
|
66
|
-
insertBefore(node: T, newNode: T | any): IsArrayable<any>;
|
|
67
|
-
/**
|
|
68
|
-
* Add a node (or data) after the given (or last) node in the list.
|
|
69
|
-
* @param {IsElement|*} node
|
|
70
|
-
* @param {IsElement} after
|
|
71
|
-
* @returns {IsArrayable}
|
|
72
|
-
*/
|
|
73
|
-
append(node: T | any, after?: T): IsArrayable<any>;
|
|
74
|
-
/**
|
|
75
|
-
* Add a node (or data) before the given (or first) node in the list.
|
|
76
|
-
* @param {IsElement|*} node
|
|
77
|
-
* @param {IsElement} before
|
|
78
|
-
* @returns {IsArrayable}
|
|
79
|
-
*/
|
|
80
|
-
prepend(node: T | any, before?: T): IsArrayable<any>;
|
|
81
|
-
/**
|
|
82
|
-
* Remove an element from this arrayable.
|
|
83
|
-
* @param {IsElement} node
|
|
84
|
-
* @return {IsElement}
|
|
85
|
-
*/
|
|
86
|
-
remove(node: T): T;
|
|
87
|
-
/**
|
|
88
|
-
* Retrieve an element item from this list by numeric index, otherwise return null.
|
|
89
|
-
* @param {number} index
|
|
90
|
-
* @return {IsElement|null}
|
|
91
|
-
*/
|
|
92
|
-
item(index: number): T | null;
|
|
93
|
-
/**
|
|
94
|
-
* Be able to run forEach on this Arrayable to iterate over the elements.
|
|
95
|
-
* @param {forEachCallback} callback
|
|
96
|
-
* @param {IsArrayable} thisArg
|
|
97
|
-
* @returns {IsArrayable}
|
|
98
|
-
*/
|
|
99
|
-
forEach(callback: forEachCallback, thisArg?: IsArrayable<any>): IsArrayable<any>;
|
|
100
|
-
/**
|
|
101
|
-
* Be able to iterate over this class.
|
|
102
|
-
* @returns {Iterator}
|
|
103
|
-
*/
|
|
104
|
-
[Symbol.iterator](): Iterator<T>;
|
|
105
|
-
}
|
|
1
|
+
import { IsElement } from './IsElement';
|
|
2
|
+
/**
|
|
3
|
+
* Run this function for each element in this arrayable.
|
|
4
|
+
* @callback forEachCallback
|
|
5
|
+
* @param {number} index
|
|
6
|
+
* @param {IsArrayable} thisArg
|
|
7
|
+
* @returns void
|
|
8
|
+
*/
|
|
9
|
+
export type forEachCallback = (element: IsElement, index?: number, thisArg?: IsArrayable<any>) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Arrayable represents a collection stored as Elements.
|
|
12
|
+
*/
|
|
13
|
+
export interface IsArrayable<T extends IsElement> {
|
|
14
|
+
/**
|
|
15
|
+
* Obnoxious typescript won't let me use typeof this class
|
|
16
|
+
* @property {IsArrayable} classType
|
|
17
|
+
*/
|
|
18
|
+
classType: any;
|
|
19
|
+
/**
|
|
20
|
+
* @property {Array<IsElement> | IsElement | null} innerList
|
|
21
|
+
*/
|
|
22
|
+
innerList: Array<T> | T | null;
|
|
23
|
+
/**
|
|
24
|
+
* @private {boolean} initialized
|
|
25
|
+
*/
|
|
26
|
+
initialized: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Initialize the inner list, should only run once.
|
|
29
|
+
* @param {IsArrayable|Array} initialList
|
|
30
|
+
* @return {IsArrayable}
|
|
31
|
+
*/
|
|
32
|
+
initialize(initialList: Array<T> | T): IsArrayable<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a copy of the innerList used.
|
|
35
|
+
* @returns {Array}
|
|
36
|
+
*/
|
|
37
|
+
get list(): Array<IsElement> | IsElement;
|
|
38
|
+
/**
|
|
39
|
+
* Retrieve the first Element from the Arrayable
|
|
40
|
+
* @returns {IsElement}
|
|
41
|
+
*/
|
|
42
|
+
get first(): T;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve the last Element from the Arrayable
|
|
45
|
+
* @returns {IsElement}
|
|
46
|
+
*/
|
|
47
|
+
get last(): T;
|
|
48
|
+
/**
|
|
49
|
+
* Return the length of the list.
|
|
50
|
+
* @returns {number}
|
|
51
|
+
*/
|
|
52
|
+
get length(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Insert a new node (or data) after a node.
|
|
55
|
+
* @param {IsElement} node
|
|
56
|
+
* @param {IsElement|*} newNode
|
|
57
|
+
* @returns {IsArrayable}
|
|
58
|
+
*/
|
|
59
|
+
insertAfter(node: T, newNode: T | any): IsArrayable<any>;
|
|
60
|
+
/**
|
|
61
|
+
* Insert a new node (or data) before a node.
|
|
62
|
+
* @param {IsElement} node
|
|
63
|
+
* @param {IsElement|*} newNode
|
|
64
|
+
* @returns {IsArrayable}
|
|
65
|
+
*/
|
|
66
|
+
insertBefore(node: T, newNode: T | any): IsArrayable<any>;
|
|
67
|
+
/**
|
|
68
|
+
* Add a node (or data) after the given (or last) node in the list.
|
|
69
|
+
* @param {IsElement|*} node
|
|
70
|
+
* @param {IsElement} after
|
|
71
|
+
* @returns {IsArrayable}
|
|
72
|
+
*/
|
|
73
|
+
append(node: T | any, after?: T): IsArrayable<any>;
|
|
74
|
+
/**
|
|
75
|
+
* Add a node (or data) before the given (or first) node in the list.
|
|
76
|
+
* @param {IsElement|*} node
|
|
77
|
+
* @param {IsElement} before
|
|
78
|
+
* @returns {IsArrayable}
|
|
79
|
+
*/
|
|
80
|
+
prepend(node: T | any, before?: T): IsArrayable<any>;
|
|
81
|
+
/**
|
|
82
|
+
* Remove an element from this arrayable.
|
|
83
|
+
* @param {IsElement} node
|
|
84
|
+
* @return {IsElement}
|
|
85
|
+
*/
|
|
86
|
+
remove(node: T): T;
|
|
87
|
+
/**
|
|
88
|
+
* Retrieve an element item from this list by numeric index, otherwise return null.
|
|
89
|
+
* @param {number} index
|
|
90
|
+
* @return {IsElement|null}
|
|
91
|
+
*/
|
|
92
|
+
item(index: number): T | null;
|
|
93
|
+
/**
|
|
94
|
+
* Be able to run forEach on this Arrayable to iterate over the elements.
|
|
95
|
+
* @param {forEachCallback} callback
|
|
96
|
+
* @param {IsArrayable} thisArg
|
|
97
|
+
* @returns {IsArrayable}
|
|
98
|
+
*/
|
|
99
|
+
forEach(callback: forEachCallback, thisArg?: IsArrayable<any>): IsArrayable<any>;
|
|
100
|
+
/**
|
|
101
|
+
* Be able to iterate over this class.
|
|
102
|
+
* @returns {Iterator}
|
|
103
|
+
*/
|
|
104
|
+
[Symbol.iterator](): Iterator<T>;
|
|
105
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IsLinker } from './IsLinker';
|
|
2
|
-
/**
|
|
3
|
-
* Define the common attributes of a DoubleLinker used in a linking structure chained with 'next' and sometimes 'prev'.
|
|
4
|
-
*/
|
|
5
|
-
export interface IsDoubleLinker extends IsLinker {
|
|
6
|
-
/**
|
|
7
|
-
* @property {IsDoubleLinker} [next=null]
|
|
8
|
-
*/
|
|
9
|
-
next: IsDoubleLinker;
|
|
10
|
-
/**
|
|
11
|
-
* @property {IsDoubleLinker} [prev=null]
|
|
12
|
-
*/
|
|
13
|
-
prev: IsDoubleLinker;
|
|
14
|
-
}
|
|
1
|
+
import { IsLinker } from './IsLinker';
|
|
2
|
+
/**
|
|
3
|
+
* Define the common attributes of a DoubleLinker used in a linking structure chained with 'next' and sometimes 'prev'.
|
|
4
|
+
*/
|
|
5
|
+
export interface IsDoubleLinker extends IsLinker {
|
|
6
|
+
/**
|
|
7
|
+
* @property {IsDoubleLinker} [next=null]
|
|
8
|
+
*/
|
|
9
|
+
next: IsDoubleLinker;
|
|
10
|
+
/**
|
|
11
|
+
* @property {IsDoubleLinker} [prev=null]
|
|
12
|
+
*/
|
|
13
|
+
prev: IsDoubleLinker;
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define the common attributes of an Element in a list.
|
|
3
|
-
*/
|
|
4
|
-
export interface IsElement {
|
|
5
|
-
/**
|
|
6
|
-
* Obnoxious typescript won't let me use typeof this class
|
|
7
|
-
* @property {IsElement} classType
|
|
8
|
-
*/
|
|
9
|
-
classType: any;
|
|
10
|
-
/**
|
|
11
|
-
* @property {*} data
|
|
12
|
-
*/
|
|
13
|
-
data: any;
|
|
14
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Define the common attributes of an Element in a list.
|
|
3
|
+
*/
|
|
4
|
+
export interface IsElement {
|
|
5
|
+
/**
|
|
6
|
+
* Obnoxious typescript won't let me use typeof this class
|
|
7
|
+
* @property {IsElement} classType
|
|
8
|
+
*/
|
|
9
|
+
classType: any;
|
|
10
|
+
/**
|
|
11
|
+
* @property {*} data
|
|
12
|
+
*/
|
|
13
|
+
data: any;
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IsElement } from './IsElement';
|
|
2
|
-
/**
|
|
3
|
-
* Define the common attributes of a Linker used in a linking structure chained with 'next' (and sometimes 'prev').
|
|
4
|
-
*/
|
|
5
|
-
export interface IsLinker extends IsElement {
|
|
6
|
-
/**
|
|
7
|
-
* @property {IsLinker} [next=null]
|
|
8
|
-
*/
|
|
9
|
-
next: IsLinker;
|
|
10
|
-
}
|
|
1
|
+
import { IsElement } from './IsElement';
|
|
2
|
+
/**
|
|
3
|
+
* Define the common attributes of a Linker used in a linking structure chained with 'next' (and sometimes 'prev').
|
|
4
|
+
*/
|
|
5
|
+
export interface IsLinker extends IsElement {
|
|
6
|
+
/**
|
|
7
|
+
* @property {IsLinker} [next=null]
|
|
8
|
+
*/
|
|
9
|
+
next: IsLinker;
|
|
10
|
+
}
|
package/dist/recipes/IsLinker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
package/dist/recipes/IsTree.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IsTreeNode } from './IsTreeNode';
|
|
2
|
-
import { IsArrayable } from './IsArrayable';
|
|
3
|
-
/**
|
|
4
|
-
* Arrayable represents a collection stored as Elements.
|
|
5
|
-
*/
|
|
6
|
-
export interface IsTree extends IsArrayable<IsTreeNode> {
|
|
7
|
-
/**
|
|
8
|
-
* @property {IsTreeNode} rootParent
|
|
9
|
-
*/
|
|
10
|
-
rootParent: IsTreeNode;
|
|
11
|
-
}
|
|
1
|
+
import { IsTreeNode } from './IsTreeNode';
|
|
2
|
+
import { IsArrayable } from './IsArrayable';
|
|
3
|
+
/**
|
|
4
|
+
* Arrayable represents a collection stored as Elements.
|
|
5
|
+
*/
|
|
6
|
+
export interface IsTree extends IsArrayable<IsTreeNode> {
|
|
7
|
+
/**
|
|
8
|
+
* @property {IsTreeNode} rootParent
|
|
9
|
+
*/
|
|
10
|
+
rootParent: IsTreeNode;
|
|
11
|
+
}
|
package/dist/recipes/IsTree.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { IsArrayable } from './IsArrayable';
|
|
2
|
-
import { IsDoubleLinker } from './IsDoubleLinker';
|
|
3
|
-
import { LinkedTreeList } from '../collections/linked-tree-list/LinkedTreeList';
|
|
4
|
-
/**
|
|
5
|
-
* Define the common attributes of a Tree Node for a tree structure.
|
|
6
|
-
*/
|
|
7
|
-
export interface IsTreeNode extends IsDoubleLinker {
|
|
8
|
-
/**
|
|
9
|
-
* @property {IsTreeNode} [next=null]
|
|
10
|
-
*/
|
|
11
|
-
next: IsTreeNode;
|
|
12
|
-
/**
|
|
13
|
-
* @property {IsTreeNode} [prev=null]
|
|
14
|
-
*/
|
|
15
|
-
prev: IsTreeNode;
|
|
16
|
-
/**
|
|
17
|
-
* @property {IsTreeNode|null} [parent=null]
|
|
18
|
-
*/
|
|
19
|
-
parent: IsTreeNode | null;
|
|
20
|
-
/**
|
|
21
|
-
* @property {IsArrayable<IsTreeNode>|null} [children=null]
|
|
22
|
-
*/
|
|
23
|
-
children: IsArrayable<IsTreeNode> | null;
|
|
24
|
-
/**
|
|
25
|
-
* Create the children for this tree from an array.
|
|
26
|
-
* @param {Array} children
|
|
27
|
-
*/
|
|
28
|
-
childrenFromArray(children: Array<any> | null): LinkedTreeList;
|
|
29
|
-
}
|
|
1
|
+
import { IsArrayable } from './IsArrayable';
|
|
2
|
+
import { IsDoubleLinker } from './IsDoubleLinker';
|
|
3
|
+
import { LinkedTreeList } from '../collections/linked-tree-list/LinkedTreeList';
|
|
4
|
+
/**
|
|
5
|
+
* Define the common attributes of a Tree Node for a tree structure.
|
|
6
|
+
*/
|
|
7
|
+
export interface IsTreeNode extends IsDoubleLinker {
|
|
8
|
+
/**
|
|
9
|
+
* @property {IsTreeNode} [next=null]
|
|
10
|
+
*/
|
|
11
|
+
next: IsTreeNode;
|
|
12
|
+
/**
|
|
13
|
+
* @property {IsTreeNode} [prev=null]
|
|
14
|
+
*/
|
|
15
|
+
prev: IsTreeNode;
|
|
16
|
+
/**
|
|
17
|
+
* @property {IsTreeNode|null} [parent=null]
|
|
18
|
+
*/
|
|
19
|
+
parent: IsTreeNode | null;
|
|
20
|
+
/**
|
|
21
|
+
* @property {IsArrayable<IsTreeNode>|null} [children=null]
|
|
22
|
+
*/
|
|
23
|
+
children: IsArrayable<IsTreeNode> | null;
|
|
24
|
+
/**
|
|
25
|
+
* Create the children for this tree from an array.
|
|
26
|
+
* @param {Array} children
|
|
27
|
+
*/
|
|
28
|
+
childrenFromArray(children: Array<any> | null): LinkedTreeList;
|
|
29
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IsLinker } from './IsLinker';
|
|
2
|
-
/**
|
|
3
|
-
* Class LinkerIterator returns the next value when using linkers of linked type lists.
|
|
4
|
-
*/
|
|
5
|
-
export declare class LinkerIterator implements Iterator<IsLinker> {
|
|
6
|
-
private current;
|
|
7
|
-
constructor(current: IsLinker);
|
|
8
|
-
next(value?: any): IteratorResult<IsLinker>;
|
|
9
|
-
}
|
|
1
|
+
import { IsLinker } from './IsLinker';
|
|
2
|
+
/**
|
|
3
|
+
* Class LinkerIterator returns the next value when using linkers of linked type lists.
|
|
4
|
+
*/
|
|
5
|
+
export declare class LinkerIterator implements Iterator<IsLinker> {
|
|
6
|
+
private current;
|
|
7
|
+
constructor(current: IsLinker);
|
|
8
|
+
next(value?: any): IteratorResult<IsLinker>;
|
|
9
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.LinkerIterator = void 0
|
|
7
|
-
/**
|
|
8
|
-
* Class LinkerIterator returns the next value when using linkers of linked type lists.
|
|
9
|
-
*/
|
|
10
|
-
class LinkerIterator {
|
|
11
|
-
constructor (current) {
|
|
12
|
-
this.current = current
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
next (value) {
|
|
16
|
-
const result = {
|
|
17
|
-
value: this.current,
|
|
18
|
-
done: !this.current
|
|
19
|
-
}
|
|
20
|
-
this.current = this.current ? this.current.next : null
|
|
21
|
-
return result
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.LinkerIterator = LinkerIterator
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.LinkerIterator = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Class LinkerIterator returns the next value when using linkers of linked type lists.
|
|
9
|
+
*/
|
|
10
|
+
class LinkerIterator {
|
|
11
|
+
constructor (current) {
|
|
12
|
+
this.current = current
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
next (value) {
|
|
16
|
+
const result = {
|
|
17
|
+
value: this.current,
|
|
18
|
+
done: !this.current
|
|
19
|
+
}
|
|
20
|
+
this.current = this.current ? this.current.next : null
|
|
21
|
+
return result
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.LinkerIterator = LinkerIterator
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Runnable class recipe.
|
|
3
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
-
* @version 1.0.0
|
|
5
|
-
* @memberOf module:collect-your-stuff
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Return results of the task.
|
|
9
|
-
* @typedef {Object} completeResponse
|
|
10
|
-
* @property {*} success
|
|
11
|
-
* @property {*} error
|
|
12
|
-
* @property {*} context
|
|
13
|
-
*/
|
|
14
|
-
export type completeResponse = {
|
|
15
|
-
success: boolean | any;
|
|
16
|
-
error: boolean | any;
|
|
17
|
-
context: any;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Specify a type of class that is Runnable.
|
|
21
|
-
*/
|
|
22
|
-
export interface IsRunnable {
|
|
23
|
-
data: any;
|
|
24
|
-
get task(): Function;
|
|
25
|
-
run(): completeResponse | any;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Identify a class that can be run.
|
|
29
|
-
*/
|
|
30
|
-
export declare class Runnable implements IsRunnable {
|
|
31
|
-
data: any;
|
|
32
|
-
/**
|
|
33
|
-
* Instantiate a Runnable class.
|
|
34
|
-
* @param {*} data
|
|
35
|
-
*/
|
|
36
|
-
constructor(data?: any);
|
|
37
|
-
/**
|
|
38
|
-
* Retrieve the data which should be formed as a task.
|
|
39
|
-
* @return {Function}
|
|
40
|
-
*/
|
|
41
|
-
get task(): Function;
|
|
42
|
-
/**
|
|
43
|
-
* Run the runnable task.
|
|
44
|
-
* @return {*}
|
|
45
|
-
*/
|
|
46
|
-
run(): completeResponse | any;
|
|
47
|
-
/**
|
|
48
|
-
* Check if a given thing is Runnable
|
|
49
|
-
* @memberof Runnable
|
|
50
|
-
* @param {*} thing
|
|
51
|
-
* @return {boolean}
|
|
52
|
-
*/
|
|
53
|
-
static isRunnable(thing: any): boolean;
|
|
54
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @file Runnable class recipe.
|
|
3
|
+
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
+
* @version 1.0.0
|
|
5
|
+
* @memberOf module:collect-your-stuff
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Return results of the task.
|
|
9
|
+
* @typedef {Object} completeResponse
|
|
10
|
+
* @property {*} success
|
|
11
|
+
* @property {*} error
|
|
12
|
+
* @property {*} context
|
|
13
|
+
*/
|
|
14
|
+
export type completeResponse = {
|
|
15
|
+
success: boolean | any;
|
|
16
|
+
error: boolean | any;
|
|
17
|
+
context: any;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Specify a type of class that is Runnable.
|
|
21
|
+
*/
|
|
22
|
+
export interface IsRunnable {
|
|
23
|
+
data: any;
|
|
24
|
+
get task(): Function;
|
|
25
|
+
run(): completeResponse | any;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Identify a class that can be run.
|
|
29
|
+
*/
|
|
30
|
+
export declare class Runnable implements IsRunnable {
|
|
31
|
+
data: any;
|
|
32
|
+
/**
|
|
33
|
+
* Instantiate a Runnable class.
|
|
34
|
+
* @param {*} data
|
|
35
|
+
*/
|
|
36
|
+
constructor(data?: any);
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve the data which should be formed as a task.
|
|
39
|
+
* @return {Function}
|
|
40
|
+
*/
|
|
41
|
+
get task(): Function;
|
|
42
|
+
/**
|
|
43
|
+
* Run the runnable task.
|
|
44
|
+
* @return {*}
|
|
45
|
+
*/
|
|
46
|
+
run(): completeResponse | any;
|
|
47
|
+
/**
|
|
48
|
+
* Check if a given thing is Runnable
|
|
49
|
+
* @memberof Runnable
|
|
50
|
+
* @param {*} thing
|
|
51
|
+
* @return {boolean}
|
|
52
|
+
*/
|
|
53
|
+
static isRunnable(thing: any): boolean;
|
|
54
|
+
}
|