collect-your-stuff 2.1.0 → 2.1.2
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 +898 -213
- package/browser/collect-your-stuff.js +2672 -20684
- package/browser/collect-your-stuff.min.js +1 -1
- package/dist/collections/arrayable/ArrayElement.d.ts +38 -38
- package/dist/collections/arrayable/ArrayElement.js +66 -66
- package/dist/collections/arrayable/Arrayable.d.ts +122 -122
- package/dist/collections/arrayable/Arrayable.js +2 -2
- package/dist/collections/doubly-linked-list/DoubleLinker.d.ts +50 -50
- package/dist/collections/doubly-linked-list/DoubleLinker.js +1 -1
- package/dist/collections/doubly-linked-list/DoublyLinkedList.d.ts +125 -125
- package/dist/collections/doubly-linked-list/DoublyLinkedList.js +3 -3
- package/dist/collections/linked-list/LinkedList.d.ts +126 -126
- package/dist/collections/linked-list/LinkedList.js +3 -3
- package/dist/collections/linked-list/Linker.d.ts +46 -46
- package/dist/collections/linked-list/Linker.js +1 -1
- package/dist/collections/linked-tree-list/LinkedTreeList.d.ts +159 -159
- package/dist/collections/linked-tree-list/LinkedTreeList.js +3 -3
- package/dist/collections/linked-tree-list/TreeLinker.d.ts +71 -71
- package/dist/collections/linked-tree-list/TreeLinker.js +2 -2
- package/dist/collections/queue/Queue.d.ts +59 -59
- package/dist/collections/queue/Queue.js +11 -9
- package/dist/collections/queue/Queueable.d.ts +83 -83
- package/dist/collections/queue/Queueable.js +9 -7
- package/dist/collections/queue/TaskQueue.d.ts +68 -68
- package/dist/collections/queue/TaskQueue.js +2 -2
- package/dist/collections/stack/Stack.d.ts +64 -64
- package/dist/collections/stack/Stack.js +11 -9
- package/dist/collections/stack/Stackable.d.ts +59 -59
- package/dist/collections/stack/Stackable.js +1 -1
- package/dist/collections/stack/TaskStack.d.ts +65 -65
- package/dist/collections/stack/TaskStack.js +2 -2
- package/dist/main.d.ts +68 -69
- package/dist/main.js +1 -2
- package/dist/main.min.js +1 -1
- package/dist/recipes/ArrayIterator.d.ts +20 -20
- package/dist/recipes/ArrayIterator.js +39 -39
- package/dist/recipes/DoubleLinkerIterator.d.ts +18 -18
- package/dist/recipes/DoubleLinkerIterator.js +33 -33
- 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/IsQueue.d.ts +37 -37
- package/dist/recipes/IsQueue.js +5 -5
- package/dist/recipes/IsStack.d.ts +36 -36
- package/dist/recipes/IsStack.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 +18 -18
- package/dist/recipes/LinkerIterator.js +33 -33
- package/dist/recipes/Runnable.d.ts +55 -55
- package/dist/recipes/Runnable.js +69 -69
- package/dist/recipes/TreeLinkerIterator.d.ts +20 -20
- package/dist/recipes/TreeLinkerIterator.js +1 -1
- package/dist/recipes/recipes.d.ts +15 -15
- package/dist/recipes/recipes.js +2 -2
- package/dist/services/parseTree.d.ts +9 -9
- package/dist/services/parseTree.js +1 -1
- package/dist/services/parseTreeNext.d.ts +17 -17
- package/dist/services/parseTreeNext.js +42 -42
- package/dist/services/services.d.ts +13 -13
- package/dist/services/services.js +2 -2
- 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
|
+
})
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Queue recipe.
|
|
3
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
-
* @version 1.0.0
|
|
5
|
-
* @memberOf module:collect-your-stuff
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Define a first-in-first-out queue: items are added to the back (enqueue) and taken from the front (dequeue).
|
|
9
|
-
* This is the shape which si-funciona's queueManager / queueTimeout expect of a queue.
|
|
10
|
-
*/
|
|
11
|
-
export interface IsQueue<T = any> {
|
|
12
|
-
/**
|
|
13
|
-
* Take the item from the front of the queue.
|
|
14
|
-
* @return {T|null} The item, or null when the queue is empty
|
|
15
|
-
*/
|
|
16
|
-
dequeue: () => T | null;
|
|
17
|
-
/**
|
|
18
|
-
* Check whether the queue has no items.
|
|
19
|
-
* @return {boolean}
|
|
20
|
-
*/
|
|
21
|
-
empty: () => boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Add an item to the back of the queue.
|
|
24
|
-
* @param {T} data The item to add
|
|
25
|
-
*/
|
|
26
|
-
enqueue: (data: T) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Look at the item at the front of the queue, without removing it.
|
|
29
|
-
* @return {T|null} The item, or null when the queue is empty
|
|
30
|
-
*/
|
|
31
|
-
peek: () => T | null;
|
|
32
|
-
/**
|
|
33
|
-
* Count the items in the queue.
|
|
34
|
-
* @return {number}
|
|
35
|
-
*/
|
|
36
|
-
size: () => number;
|
|
37
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @file Queue recipe.
|
|
3
|
+
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
+
* @version 1.0.0
|
|
5
|
+
* @memberOf module:collect-your-stuff
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Define a first-in-first-out queue: items are added to the back (enqueue) and taken from the front (dequeue).
|
|
9
|
+
* This is the shape which si-funciona's queueManager / queueTimeout expect of a queue.
|
|
10
|
+
*/
|
|
11
|
+
export interface IsQueue<T = any> {
|
|
12
|
+
/**
|
|
13
|
+
* Take the item from the front of the queue.
|
|
14
|
+
* @return {T|null} The item, or null when the queue is empty
|
|
15
|
+
*/
|
|
16
|
+
dequeue: () => T | null;
|
|
17
|
+
/**
|
|
18
|
+
* Check whether the queue has no items.
|
|
19
|
+
* @return {boolean}
|
|
20
|
+
*/
|
|
21
|
+
empty: () => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Add an item to the back of the queue.
|
|
24
|
+
* @param {T} data The item to add
|
|
25
|
+
*/
|
|
26
|
+
enqueue: (data: T) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Look at the item at the front of the queue, without removing it.
|
|
29
|
+
* @return {T|null} The item, or null when the queue is empty
|
|
30
|
+
*/
|
|
31
|
+
peek: () => T | null;
|
|
32
|
+
/**
|
|
33
|
+
* Count the items in the queue.
|
|
34
|
+
* @return {number}
|
|
35
|
+
*/
|
|
36
|
+
size: () => number;
|
|
37
|
+
}
|
package/dist/recipes/IsQueue.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,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Stack recipe.
|
|
3
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
-
* @version 1.0.0
|
|
5
|
-
* @memberOf module:collect-your-stuff
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Define a last-in-first-out stack: items are added to the top (push) and taken from the top (pop).
|
|
9
|
-
*/
|
|
10
|
-
export interface IsStack<T = any> {
|
|
11
|
-
/**
|
|
12
|
-
* Check whether the stack has no items.
|
|
13
|
-
* @return {boolean}
|
|
14
|
-
*/
|
|
15
|
-
empty: () => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Look at the item on the top of the stack, without removing it.
|
|
18
|
-
* @return {T|null} The item, or null when the stack is empty
|
|
19
|
-
*/
|
|
20
|
-
peek: () => T | null;
|
|
21
|
-
/**
|
|
22
|
-
* Take the item from the top of the stack.
|
|
23
|
-
* @return {T|null} The item, or null when the stack is empty
|
|
24
|
-
*/
|
|
25
|
-
pop: () => T | null;
|
|
26
|
-
/**
|
|
27
|
-
* Add an item to the top of the stack.
|
|
28
|
-
* @param {T} data The item to add
|
|
29
|
-
*/
|
|
30
|
-
push: (data: T) => void;
|
|
31
|
-
/**
|
|
32
|
-
* Count the items in the stack.
|
|
33
|
-
* @return {number}
|
|
34
|
-
*/
|
|
35
|
-
size: () => number;
|
|
36
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @file Stack recipe.
|
|
3
|
+
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
+
* @version 1.0.0
|
|
5
|
+
* @memberOf module:collect-your-stuff
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Define a last-in-first-out stack: items are added to the top (push) and taken from the top (pop).
|
|
9
|
+
*/
|
|
10
|
+
export interface IsStack<T = any> {
|
|
11
|
+
/**
|
|
12
|
+
* Check whether the stack has no items.
|
|
13
|
+
* @return {boolean}
|
|
14
|
+
*/
|
|
15
|
+
empty: () => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Look at the item on the top of the stack, without removing it.
|
|
18
|
+
* @return {T|null} The item, or null when the stack is empty
|
|
19
|
+
*/
|
|
20
|
+
peek: () => T | null;
|
|
21
|
+
/**
|
|
22
|
+
* Take the item from the top of the stack.
|
|
23
|
+
* @return {T|null} The item, or null when the stack is empty
|
|
24
|
+
*/
|
|
25
|
+
pop: () => T | null;
|
|
26
|
+
/**
|
|
27
|
+
* Add an item to the top of the stack.
|
|
28
|
+
* @param {T} data The item to add
|
|
29
|
+
*/
|
|
30
|
+
push: (data: T) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Count the items in the stack.
|
|
33
|
+
* @return {number}
|
|
34
|
+
*/
|
|
35
|
+
size: () => number;
|
|
36
|
+
}
|
package/dist/recipes/IsStack.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,18 +1,18 @@
|
|
|
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
|
-
/**
|
|
8
|
-
* Create an iterator starting at the given item.
|
|
9
|
-
* @param {IsLinker} current The item to start from.
|
|
10
|
-
*/
|
|
11
|
-
constructor(current: IsLinker);
|
|
12
|
-
/**
|
|
13
|
-
* Get the current item and move on to the following one.
|
|
14
|
-
* @param {*} [value] Not used, present to match the Iterator interface.
|
|
15
|
-
* @return {IteratorResult<IsLinker>} The current item, or done when there are no more.
|
|
16
|
-
*/
|
|
17
|
-
next(value?: any): IteratorResult<IsLinker>;
|
|
18
|
-
}
|
|
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
|
+
/**
|
|
8
|
+
* Create an iterator starting at the given item.
|
|
9
|
+
* @param {IsLinker} current The item to start from.
|
|
10
|
+
*/
|
|
11
|
+
constructor(current: IsLinker);
|
|
12
|
+
/**
|
|
13
|
+
* Get the current item and move on to the following one.
|
|
14
|
+
* @param {*} [value] Not used, present to match the Iterator interface.
|
|
15
|
+
* @return {IteratorResult<IsLinker>} The current item, or done when there are no more.
|
|
16
|
+
*/
|
|
17
|
+
next(value?: any): IteratorResult<IsLinker>;
|
|
18
|
+
}
|