collect-your-stuff 2.1.2 → 2.2.0
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 +32 -3926
- package/browser/collect-your-stuff.js +912 -549
- package/browser/collect-your-stuff.min.js +1 -1
- package/dist/collections/arrayable/ArrayElement.d.ts +6 -11
- package/dist/collections/arrayable/ArrayElement.js +5 -7
- package/dist/collections/arrayable/Arrayable.d.ts +22 -37
- package/dist/collections/arrayable/Arrayable.js +208 -223
- package/dist/collections/doubly-linked-list/DoubleLinker.d.ts +9 -14
- package/dist/collections/doubly-linked-list/DoubleLinker.js +71 -73
- package/dist/collections/doubly-linked-list/DoublyLinkedList.d.ts +19 -36
- package/dist/collections/doubly-linked-list/DoublyLinkedList.js +310 -327
- package/dist/collections/linked-list/LinkedList.d.ts +20 -36
- package/dist/collections/linked-list/LinkedList.js +283 -296
- package/dist/collections/linked-list/Linker.d.ts +8 -13
- package/dist/collections/linked-list/Linker.js +82 -84
- package/dist/collections/linked-tree-list/LinkedTreeList.d.ts +24 -43
- package/dist/collections/linked-tree-list/LinkedTreeList.js +274 -294
- package/dist/collections/linked-tree-list/TreeLinker.d.ts +14 -20
- package/dist/collections/linked-tree-list/TreeLinker.js +91 -94
- package/dist/collections/queue/Queue.d.ts +10 -14
- package/dist/collections/queue/Queue.js +114 -121
- package/dist/collections/queue/Queueable.d.ts +13 -22
- package/dist/collections/queue/Queueable.js +142 -148
- package/dist/collections/queue/TaskQueue.d.ts +8 -17
- package/dist/collections/queue/TaskQueue.js +128 -137
- package/dist/collections/scoped-collection/ScopedCollection.d.ts +42 -0
- package/dist/collections/scoped-collection/ScopedCollection.js +81 -0
- package/dist/collections/scoped-collection/ScopedCollection.min.js +1 -0
- package/dist/collections/stack/Stack.d.ts +11 -15
- package/dist/collections/stack/Stack.js +122 -129
- package/dist/collections/stack/Stackable.d.ts +9 -16
- package/dist/collections/stack/Stackable.js +81 -85
- package/dist/collections/stack/TaskStack.d.ts +8 -17
- package/dist/collections/stack/TaskStack.js +98 -107
- package/dist/main.d.ts +67 -68
- package/dist/main.js +8 -4
- package/dist/main.min.js +1 -1
- package/dist/recipes/ArrayIterator.d.ts +4 -4
- package/dist/recipes/ArrayIterator.js +4 -4
- package/dist/recipes/DoubleLinkerIterator.d.ts +3 -3
- package/dist/recipes/DoubleLinkerIterator.js +3 -3
- package/dist/recipes/IsArrayable.d.ts +13 -33
- package/dist/recipes/IsQueue.d.ts +4 -9
- package/dist/recipes/IsScopedCollection.d.ts +27 -0
- package/dist/recipes/IsScopedCollection.js +5 -0
- package/dist/recipes/IsScopedCollection.min.js +1 -0
- package/dist/recipes/IsStack.d.ts +4 -9
- package/dist/recipes/IsTreeNode.d.ts +1 -1
- package/dist/recipes/LinkerIterator.d.ts +3 -3
- package/dist/recipes/LinkerIterator.js +3 -3
- package/dist/recipes/Runnable.d.ts +3 -16
- package/dist/recipes/Runnable.js +3 -9
- package/dist/recipes/TreeLinkerIterator.d.ts +4 -4
- package/dist/recipes/TreeLinkerIterator.js +36 -36
- package/dist/recipes/recipes.d.ts +1 -4
- package/dist/recipes/recipes.js +19 -22
- package/dist/services/parseTree.d.ts +2 -3
- package/dist/services/parseTree.js +23 -24
- package/dist/services/parseTreeNext.d.ts +2 -3
- package/dist/services/parseTreeNext.js +2 -3
- package/dist/services/services.d.ts +1 -4
- package/dist/services/services.js +19 -22
- package/package.json +4 -4
|
@@ -1,85 +1,81 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.Stackable = void 0
|
|
7
|
-
const _Linker = require('../linked-list/Linker')
|
|
8
|
-
/**
|
|
9
|
-
* Stackable represents a runnable entry in stack.
|
|
10
|
-
* @extends Linker
|
|
11
|
-
*/
|
|
12
|
-
class Stackable {
|
|
13
|
-
/**
|
|
14
|
-
* Create a stackable item that can be used in a stack.
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
*/
|
|
20
|
-
constructor ({
|
|
21
|
-
task = null,
|
|
22
|
-
next = null,
|
|
23
|
-
ready = false
|
|
24
|
-
} = {}) {
|
|
25
|
-
/** The task (or data) this stackable holds. */
|
|
26
|
-
this.data = null
|
|
27
|
-
/** The stackable below this one, or null when this is the bottom. */
|
|
28
|
-
this.next = null
|
|
29
|
-
this.classType = Stackable
|
|
30
|
-
this.data = task
|
|
31
|
-
this.next = next
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Retrieve the data which should be formed as a task.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
* @param {IsLinker} [classType=Stackable] Provide the type of IsLinker to use.
|
|
83
|
-
* @returns {{head: Stackable, tail: Stackable}}
|
|
84
|
-
*/
|
|
85
|
-
Stackable.fromArray = (values = [], classType = Stackable) => _Linker.Linker.fromArray(values, classType)
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.Stackable = void 0
|
|
7
|
+
const _Linker = require('../linked-list/Linker')
|
|
8
|
+
/**
|
|
9
|
+
* Stackable represents a runnable entry in stack.
|
|
10
|
+
* @extends Linker
|
|
11
|
+
*/
|
|
12
|
+
class Stackable {
|
|
13
|
+
/**
|
|
14
|
+
* Create a stackable item that can be used in a stack.
|
|
15
|
+
* @param stackData The settings for the new stackable.
|
|
16
|
+
* @param stackData.task The data to be stored in this stackable
|
|
17
|
+
* @param stackData.next The reference to the next stackable if any
|
|
18
|
+
* @param stackData.ready Indicate if the stackable is ready to run
|
|
19
|
+
*/
|
|
20
|
+
constructor ({
|
|
21
|
+
task = null,
|
|
22
|
+
next = null,
|
|
23
|
+
ready = false
|
|
24
|
+
} = {}) {
|
|
25
|
+
/** The task (or data) this stackable holds. */
|
|
26
|
+
this.data = null
|
|
27
|
+
/** The stackable below this one, or null when this is the bottom. */
|
|
28
|
+
this.next = null
|
|
29
|
+
this.classType = Stackable
|
|
30
|
+
this.data = task
|
|
31
|
+
this.next = next
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve the data which should be formed as a task.
|
|
36
|
+
*/
|
|
37
|
+
get task () {
|
|
38
|
+
if (typeof this.data === 'function') {
|
|
39
|
+
return this.data
|
|
40
|
+
}
|
|
41
|
+
return () => this.data
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Run the stacked task.
|
|
46
|
+
*/
|
|
47
|
+
run () {
|
|
48
|
+
return this.task()
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Make a new Stackable from the data given if it is not already a valid Stackable.
|
|
53
|
+
* @param stackable Return a valid Stackable instance from given data, or even an already valid one.
|
|
54
|
+
* @param classType Provide the type of IsLinker to use.
|
|
55
|
+
*/
|
|
56
|
+
exports.Stackable = Stackable
|
|
57
|
+
Stackable.make = (stackable, classType = Stackable) => {
|
|
58
|
+
if (stackable === null || typeof stackable !== 'object') {
|
|
59
|
+
// It is not an object (or it is null), so instantiate the Stackable with stackable as the data
|
|
60
|
+
return new classType({
|
|
61
|
+
task: stackable
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
if (stackable.classType) {
|
|
65
|
+
// Already valid Stackable, return as-is
|
|
66
|
+
return stackable
|
|
67
|
+
}
|
|
68
|
+
if (!('task' in stackable)) {
|
|
69
|
+
stackable = {
|
|
70
|
+
task: stackable
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Create the new node as the configured stackableClass
|
|
74
|
+
return new classType(stackable)
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Convert an array into Stackable instances, return the head and tail Stackables.
|
|
78
|
+
* @param values Provide an array of data that will be converted to a chain of stackable linkers.
|
|
79
|
+
* @param classType Provide the type of IsLinker to use.
|
|
80
|
+
*/
|
|
81
|
+
Stackable.fromArray = (values = [], classType = Stackable) => _Linker.Linker.fromArray(values, classType)
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
-
* @version 1.0.0
|
|
5
|
-
* @memberOf module:collect-your-stuff
|
|
2
|
+
* task stack.
|
|
6
3
|
*/
|
|
7
4
|
import { Stackable } from './Stackable';
|
|
8
5
|
import { IsArrayable } from '../../recipes/IsArrayable';
|
|
@@ -19,47 +16,41 @@ export declare class TaskStack {
|
|
|
19
16
|
private stackableClass;
|
|
20
17
|
/**
|
|
21
18
|
* Instantiate the state with the starter stacked list.
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
19
|
+
* @param stackedList The list of stackables to start in this stack.
|
|
20
|
+
* @param listClass The type of list to create when no stacked list is given.
|
|
21
|
+
* @param stackableClass The class used to wrap stacked items.
|
|
25
22
|
*/
|
|
26
23
|
constructor(stackedList?: IsArrayable<any>, listClass?: any, stackableClass?: typeof Stackable);
|
|
27
24
|
/**
|
|
28
25
|
* Return true if the stack is empty (there are no tasks in the stacked list)
|
|
29
|
-
* @return {boolean}
|
|
30
26
|
*/
|
|
31
27
|
empty(): boolean;
|
|
32
28
|
/**
|
|
33
29
|
* Take a look at the next stacked task
|
|
34
|
-
* @return {Stackable}
|
|
35
30
|
*/
|
|
36
31
|
top(): IsLinker;
|
|
37
32
|
/**
|
|
38
33
|
* Remove the next stacked task and return it.
|
|
39
|
-
* @return {Stackable|null}
|
|
40
34
|
*/
|
|
41
35
|
pop(): Stackable | completeResponse | null;
|
|
42
36
|
/**
|
|
43
37
|
* Push a stackable task to the top of the stack.
|
|
44
|
-
* @param
|
|
38
|
+
* @param stackable Add a new stackable to the top of the stack
|
|
45
39
|
*/
|
|
46
40
|
push(stackable: any): void;
|
|
47
41
|
/**
|
|
48
42
|
* Remove the next stacked task and return it.
|
|
49
|
-
* @return {Stackable|null}
|
|
50
43
|
*/
|
|
51
44
|
remove(): Stackable | null;
|
|
52
45
|
/**
|
|
53
46
|
* Get the size of the current stack.
|
|
54
|
-
* @return {number}
|
|
55
47
|
*/
|
|
56
48
|
size(): number;
|
|
57
49
|
/**
|
|
58
50
|
* Convert an array to a TaskStack.
|
|
59
|
-
* @param
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
* @returns {TaskStack}
|
|
51
|
+
* @param values An array of values which will be converted to stackables in this queue
|
|
52
|
+
* @param stackableClass The class to use for each stackable
|
|
53
|
+
* @param listClass The class to use to manage the stackables
|
|
63
54
|
*/
|
|
64
55
|
static fromArray: (values?: Array<any>, stackableClass?: typeof Stackable, listClass?: any) => TaskStack;
|
|
65
56
|
}
|
|
@@ -1,107 +1,98 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.TaskStack = void 0
|
|
7
|
-
const _Stackable = require('./Stackable')
|
|
8
|
-
const _LinkedList = require('../linked-list/LinkedList')
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return this.stackedList.
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
* @param {TaskStack|Iterable} listClass The class to use to manage the stackables
|
|
100
|
-
* @returns {TaskStack}
|
|
101
|
-
*/
|
|
102
|
-
exports.TaskStack = TaskStack
|
|
103
|
-
TaskStack.fromArray = (values = [], stackableClass = _Stackable.Stackable, listClass = _LinkedList.LinkedList) => {
|
|
104
|
-
const list = new listClass(stackableClass)
|
|
105
|
-
list.initialize(stackableClass.fromArray(values, stackableClass).head)
|
|
106
|
-
return new TaskStack(list, listClass, stackableClass)
|
|
107
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.TaskStack = void 0
|
|
7
|
+
const _Stackable = require('./Stackable')
|
|
8
|
+
const _LinkedList = require('../linked-list/LinkedList')
|
|
9
|
+
/**
|
|
10
|
+
* task stack.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Store a collection of tasks (Stackables) which can only be inserted and removed from the top: pop() takes the task from
|
|
15
|
+
* the top and RUNS it. For a plain last-in-first-out collection of items use Stack.
|
|
16
|
+
*/
|
|
17
|
+
class TaskStack {
|
|
18
|
+
/**
|
|
19
|
+
* Instantiate the state with the starter stacked list.
|
|
20
|
+
* @param stackedList The list of stackables to start in this stack.
|
|
21
|
+
* @param listClass The type of list to create when no stacked list is given.
|
|
22
|
+
* @param stackableClass The class used to wrap stacked items.
|
|
23
|
+
*/
|
|
24
|
+
constructor (stackedList = null, listClass = _LinkedList.LinkedList, stackableClass = _Stackable.Stackable) {
|
|
25
|
+
this.listClass = listClass
|
|
26
|
+
this.stackableClass = stackableClass
|
|
27
|
+
if (stackedList === null) {
|
|
28
|
+
stackedList = new listClass(stackableClass)
|
|
29
|
+
}
|
|
30
|
+
this.stackedList = stackedList
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Return true if the stack is empty (there are no tasks in the stacked list)
|
|
35
|
+
*/
|
|
36
|
+
empty () {
|
|
37
|
+
return this.size() <= 0
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Take a look at the next stacked task
|
|
42
|
+
*/
|
|
43
|
+
top () {
|
|
44
|
+
return this.stackedList.first
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Remove the next stacked task and return it.
|
|
49
|
+
*/
|
|
50
|
+
pop () {
|
|
51
|
+
const next = this.remove()
|
|
52
|
+
if (!next) {
|
|
53
|
+
return {
|
|
54
|
+
success: 'No more stackable tasks in the stack',
|
|
55
|
+
error: false,
|
|
56
|
+
context: this.stackedList
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return next.run()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Push a stackable task to the top of the stack.
|
|
64
|
+
* @param stackable Add a new stackable to the top of the stack
|
|
65
|
+
*/
|
|
66
|
+
push (stackable) {
|
|
67
|
+
this.stackedList.prepend(stackable)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Remove the next stacked task and return it.
|
|
72
|
+
*/
|
|
73
|
+
remove () {
|
|
74
|
+
if (this.empty()) {
|
|
75
|
+
return null
|
|
76
|
+
}
|
|
77
|
+
return this.stackedList.remove(this.stackedList.first)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Get the size of the current stack.
|
|
82
|
+
*/
|
|
83
|
+
size () {
|
|
84
|
+
return this.stackedList.length
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Convert an array to a TaskStack.
|
|
89
|
+
* @param values An array of values which will be converted to stackables in this queue
|
|
90
|
+
* @param stackableClass The class to use for each stackable
|
|
91
|
+
* @param listClass The class to use to manage the stackables
|
|
92
|
+
*/
|
|
93
|
+
exports.TaskStack = TaskStack
|
|
94
|
+
TaskStack.fromArray = (values = [], stackableClass = _Stackable.Stackable, listClass = _LinkedList.LinkedList) => {
|
|
95
|
+
const list = new listClass(stackableClass)
|
|
96
|
+
list.initialize(stackableClass.fromArray(values, stackableClass).head)
|
|
97
|
+
return new TaskStack(list, listClass, stackableClass)
|
|
98
|
+
}
|
package/dist/main.d.ts
CHANGED
|
@@ -1,68 +1,67 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* All of the collections available.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
export type {
|
|
32
|
-
export type {
|
|
33
|
-
export type {
|
|
34
|
-
export type {
|
|
35
|
-
export type {
|
|
36
|
-
export type {
|
|
37
|
-
export type {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export default collectYourStuff;
|
|
1
|
+
/**
|
|
2
|
+
* All of the collections available.
|
|
3
|
+
*/
|
|
4
|
+
import { ArrayElement } from './collections/arrayable/ArrayElement';
|
|
5
|
+
import { Arrayable } from './collections/arrayable/Arrayable';
|
|
6
|
+
import { DoubleLinker } from './collections/doubly-linked-list/DoubleLinker';
|
|
7
|
+
import { DoublyLinkedList } from './collections/doubly-linked-list/DoublyLinkedList';
|
|
8
|
+
import { Linker } from './collections/linked-list/Linker';
|
|
9
|
+
import { LinkedList } from './collections/linked-list/LinkedList';
|
|
10
|
+
import { TreeLinker } from './collections/linked-tree-list/TreeLinker';
|
|
11
|
+
import { LinkedTreeList } from './collections/linked-tree-list/LinkedTreeList';
|
|
12
|
+
import { Queueable } from './collections/queue/Queueable';
|
|
13
|
+
import { Queue } from './collections/queue/Queue';
|
|
14
|
+
import { TaskQueue } from './collections/queue/TaskQueue';
|
|
15
|
+
import { ScopedCollection } from './collections/scoped-collection/ScopedCollection';
|
|
16
|
+
import { Stackable } from './collections/stack/Stackable';
|
|
17
|
+
import { Stack } from './collections/stack/Stack';
|
|
18
|
+
import { TaskStack } from './collections/stack/TaskStack';
|
|
19
|
+
import { recipes } from './recipes/recipes';
|
|
20
|
+
import { services } from './services/services';
|
|
21
|
+
/**
|
|
22
|
+
* TODO:
|
|
23
|
+
* 1. Create binary tree. Use the tree, but it has a limit of only two children per parent, and when adding / removing sort is applied. Add sort function in fromArray
|
|
24
|
+
* 2. Create a heap (both min and max heap variants) which is similar to binary tree in structure, but tree having its min / max value as root. and it must insert on the left-most lowest level, and removes from root. Be able to easily swap nodes to ensure min / max ordering.
|
|
25
|
+
* 3. Create a graph type which can have directional and undirectional variants for linking nodes
|
|
26
|
+
*/
|
|
27
|
+
export { ArrayElement, Arrayable, DoubleLinker, DoublyLinkedList, Linker, LinkedList, TreeLinker, LinkedTreeList, Queueable, Queue, TaskQueue, ScopedCollection, Stackable, Stack, TaskStack, recipes, services };
|
|
28
|
+
export type { IsArrayable, forEachCallback } from './recipes/IsArrayable';
|
|
29
|
+
export type { IsDoubleLinker } from './recipes/IsDoubleLinker';
|
|
30
|
+
export type { IsElement } from './recipes/IsElement';
|
|
31
|
+
export type { IsLinker } from './recipes/IsLinker';
|
|
32
|
+
export type { IsTree } from './recipes/IsTree';
|
|
33
|
+
export type { IsTreeNode } from './recipes/IsTreeNode';
|
|
34
|
+
export type { IsQueue } from './recipes/IsQueue';
|
|
35
|
+
export type { IsScopedCollection } from './recipes/IsScopedCollection';
|
|
36
|
+
export type { IsStack } from './recipes/IsStack';
|
|
37
|
+
export type { IsRunnable, completeResponse } from './recipes/Runnable';
|
|
38
|
+
/**
|
|
39
|
+
* All methods exported from this module are encapsulated within collect-your-stuff (this default export is the same
|
|
40
|
+
* set of classes as the named exports).
|
|
41
|
+
*/
|
|
42
|
+
declare const collectYourStuff: {
|
|
43
|
+
ArrayElement: typeof ArrayElement;
|
|
44
|
+
Arrayable: typeof Arrayable;
|
|
45
|
+
DoubleLinker: typeof DoubleLinker;
|
|
46
|
+
DoublyLinkedList: typeof DoublyLinkedList;
|
|
47
|
+
Linker: typeof Linker;
|
|
48
|
+
LinkedList: typeof LinkedList;
|
|
49
|
+
TreeLinker: typeof TreeLinker;
|
|
50
|
+
LinkedTreeList: typeof LinkedTreeList;
|
|
51
|
+
Queueable: typeof Queueable;
|
|
52
|
+
Queue: typeof Queue;
|
|
53
|
+
TaskQueue: typeof TaskQueue;
|
|
54
|
+
ScopedCollection: typeof ScopedCollection;
|
|
55
|
+
Stackable: typeof Stackable;
|
|
56
|
+
Stack: typeof Stack;
|
|
57
|
+
TaskStack: typeof TaskStack;
|
|
58
|
+
recipes: {
|
|
59
|
+
ArrayIterator: typeof import("./recipes/ArrayIterator").ArrayIterator;
|
|
60
|
+
Runnable: typeof import("./recipes/Runnable").Runnable;
|
|
61
|
+
};
|
|
62
|
+
services: {
|
|
63
|
+
parseTree: (tree: import("./main").IsTree, callback: import("./main").forEachCallback) => import("./main").IsTree;
|
|
64
|
+
parseTreeNext: (treeNode: import("./main").IsTreeNode, boundaryParent?: import("./main").IsTreeNode | null) => import("./main").IsTreeNode | null;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export default collectYourStuff;
|
package/dist/main.js
CHANGED
|
@@ -57,6 +57,12 @@ Object.defineProperty(exports, 'Queueable', {
|
|
|
57
57
|
return _Queueable.Queueable
|
|
58
58
|
}
|
|
59
59
|
})
|
|
60
|
+
Object.defineProperty(exports, 'ScopedCollection', {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _ScopedCollection.ScopedCollection
|
|
64
|
+
}
|
|
65
|
+
})
|
|
60
66
|
Object.defineProperty(exports, 'Stack', {
|
|
61
67
|
enumerable: true,
|
|
62
68
|
get: function () {
|
|
@@ -111,6 +117,7 @@ var _LinkedTreeList = require('./collections/linked-tree-list/LinkedTreeList')
|
|
|
111
117
|
var _Queueable = require('./collections/queue/Queueable')
|
|
112
118
|
var _Queue = require('./collections/queue/Queue')
|
|
113
119
|
var _TaskQueue = require('./collections/queue/TaskQueue')
|
|
120
|
+
var _ScopedCollection = require('./collections/scoped-collection/ScopedCollection')
|
|
114
121
|
var _Stackable = require('./collections/stack/Stackable')
|
|
115
122
|
var _Stack = require('./collections/stack/Stack')
|
|
116
123
|
var _TaskStack = require('./collections/stack/TaskStack')
|
|
@@ -118,10 +125,6 @@ var _recipes = require('./recipes/recipes')
|
|
|
118
125
|
var _services = require('./services/services')
|
|
119
126
|
/**
|
|
120
127
|
* All of the collections available.
|
|
121
|
-
* @file
|
|
122
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
123
|
-
* @version 1.0.0
|
|
124
|
-
* @module collect-your-stuff
|
|
125
128
|
*/
|
|
126
129
|
|
|
127
130
|
/**
|
|
@@ -149,6 +152,7 @@ const collectYourStuff = {
|
|
|
149
152
|
Queueable: _Queueable.Queueable,
|
|
150
153
|
Queue: _Queue.Queue,
|
|
151
154
|
TaskQueue: _TaskQueue.TaskQueue,
|
|
155
|
+
ScopedCollection: _ScopedCollection.ScopedCollection,
|
|
152
156
|
Stackable: _Stackable.Stackable,
|
|
153
157
|
Stack: _Stack.Stack,
|
|
154
158
|
TaskStack: _TaskStack.TaskStack,
|
package/dist/main.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ArrayElement",{enumerable:!0,get:function(){return _ArrayElement.ArrayElement}}),Object.defineProperty(exports,"Arrayable",{enumerable:!0,get:function(){return _Arrayable.Arrayable}}),Object.defineProperty(exports,"DoubleLinker",{enumerable:!0,get:function(){return _DoubleLinker.DoubleLinker}}),Object.defineProperty(exports,"DoublyLinkedList",{enumerable:!0,get:function(){return _DoublyLinkedList.DoublyLinkedList}}),Object.defineProperty(exports,"LinkedList",{enumerable:!0,get:function(){return _LinkedList.LinkedList}}),Object.defineProperty(exports,"LinkedTreeList",{enumerable:!0,get:function(){return _LinkedTreeList.LinkedTreeList}}),Object.defineProperty(exports,"Linker",{enumerable:!0,get:function(){return _Linker.Linker}}),Object.defineProperty(exports,"Queue",{enumerable:!0,get:function(){return _Queue.Queue}}),Object.defineProperty(exports,"Queueable",{enumerable:!0,get:function(){return _Queueable.Queueable}}),Object.defineProperty(exports,"Stack",{enumerable:!0,get:function(){return _Stack.Stack}}),Object.defineProperty(exports,"Stackable",{enumerable:!0,get:function(){return _Stackable.Stackable}}),Object.defineProperty(exports,"TaskQueue",{enumerable:!0,get:function(){return _TaskQueue.TaskQueue}}),Object.defineProperty(exports,"TaskStack",{enumerable:!0,get:function(){return _TaskStack.TaskStack}}),Object.defineProperty(exports,"TreeLinker",{enumerable:!0,get:function(){return _TreeLinker.TreeLinker}}),exports.default=void 0,Object.defineProperty(exports,"recipes",{enumerable:!0,get:function(){return _recipes.recipes}}),Object.defineProperty(exports,"services",{enumerable:!0,get:function(){return _services.services}});var _ArrayElement=require("./collections/arrayable/ArrayElement"),_Arrayable=require("./collections/arrayable/Arrayable"),_DoubleLinker=require("./collections/doubly-linked-list/DoubleLinker"),_DoublyLinkedList=require("./collections/doubly-linked-list/DoublyLinkedList"),_Linker=require("./collections/linked-list/Linker"),_LinkedList=require("./collections/linked-list/LinkedList"),_TreeLinker=require("./collections/linked-tree-list/TreeLinker"),_LinkedTreeList=require("./collections/linked-tree-list/LinkedTreeList"),_Queueable=require("./collections/queue/Queueable"),_Queue=require("./collections/queue/Queue"),_TaskQueue=require("./collections/queue/TaskQueue"),_Stackable=require("./collections/stack/Stackable"),_Stack=require("./collections/stack/Stack"),_TaskStack=require("./collections/stack/TaskStack"),_recipes=require("./recipes/recipes"),_services=require("./services/services");const collectYourStuff={ArrayElement:_ArrayElement.ArrayElement,Arrayable:_Arrayable.Arrayable,DoubleLinker:_DoubleLinker.DoubleLinker,DoublyLinkedList:_DoublyLinkedList.DoublyLinkedList,Linker:_Linker.Linker,LinkedList:_LinkedList.LinkedList,TreeLinker:_TreeLinker.TreeLinker,LinkedTreeList:_LinkedTreeList.LinkedTreeList,Queueable:_Queueable.Queueable,Queue:_Queue.Queue,TaskQueue:_TaskQueue.TaskQueue,Stackable:_Stackable.Stackable,Stack:_Stack.Stack,TaskStack:_TaskStack.TaskStack,recipes:_recipes.recipes,services:_services.services};var _default=exports.default=collectYourStuff;"undefined"!=typeof window&&(window.collectYourStuff=collectYourStuff);
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ArrayElement",{enumerable:!0,get:function(){return _ArrayElement.ArrayElement}}),Object.defineProperty(exports,"Arrayable",{enumerable:!0,get:function(){return _Arrayable.Arrayable}}),Object.defineProperty(exports,"DoubleLinker",{enumerable:!0,get:function(){return _DoubleLinker.DoubleLinker}}),Object.defineProperty(exports,"DoublyLinkedList",{enumerable:!0,get:function(){return _DoublyLinkedList.DoublyLinkedList}}),Object.defineProperty(exports,"LinkedList",{enumerable:!0,get:function(){return _LinkedList.LinkedList}}),Object.defineProperty(exports,"LinkedTreeList",{enumerable:!0,get:function(){return _LinkedTreeList.LinkedTreeList}}),Object.defineProperty(exports,"Linker",{enumerable:!0,get:function(){return _Linker.Linker}}),Object.defineProperty(exports,"Queue",{enumerable:!0,get:function(){return _Queue.Queue}}),Object.defineProperty(exports,"Queueable",{enumerable:!0,get:function(){return _Queueable.Queueable}}),Object.defineProperty(exports,"ScopedCollection",{enumerable:!0,get:function(){return _ScopedCollection.ScopedCollection}}),Object.defineProperty(exports,"Stack",{enumerable:!0,get:function(){return _Stack.Stack}}),Object.defineProperty(exports,"Stackable",{enumerable:!0,get:function(){return _Stackable.Stackable}}),Object.defineProperty(exports,"TaskQueue",{enumerable:!0,get:function(){return _TaskQueue.TaskQueue}}),Object.defineProperty(exports,"TaskStack",{enumerable:!0,get:function(){return _TaskStack.TaskStack}}),Object.defineProperty(exports,"TreeLinker",{enumerable:!0,get:function(){return _TreeLinker.TreeLinker}}),exports.default=void 0,Object.defineProperty(exports,"recipes",{enumerable:!0,get:function(){return _recipes.recipes}}),Object.defineProperty(exports,"services",{enumerable:!0,get:function(){return _services.services}});var _ArrayElement=require("./collections/arrayable/ArrayElement"),_Arrayable=require("./collections/arrayable/Arrayable"),_DoubleLinker=require("./collections/doubly-linked-list/DoubleLinker"),_DoublyLinkedList=require("./collections/doubly-linked-list/DoublyLinkedList"),_Linker=require("./collections/linked-list/Linker"),_LinkedList=require("./collections/linked-list/LinkedList"),_TreeLinker=require("./collections/linked-tree-list/TreeLinker"),_LinkedTreeList=require("./collections/linked-tree-list/LinkedTreeList"),_Queueable=require("./collections/queue/Queueable"),_Queue=require("./collections/queue/Queue"),_TaskQueue=require("./collections/queue/TaskQueue"),_ScopedCollection=require("./collections/scoped-collection/ScopedCollection"),_Stackable=require("./collections/stack/Stackable"),_Stack=require("./collections/stack/Stack"),_TaskStack=require("./collections/stack/TaskStack"),_recipes=require("./recipes/recipes"),_services=require("./services/services");const collectYourStuff={ArrayElement:_ArrayElement.ArrayElement,Arrayable:_Arrayable.Arrayable,DoubleLinker:_DoubleLinker.DoubleLinker,DoublyLinkedList:_DoublyLinkedList.DoublyLinkedList,Linker:_Linker.Linker,LinkedList:_LinkedList.LinkedList,TreeLinker:_TreeLinker.TreeLinker,LinkedTreeList:_LinkedTreeList.LinkedTreeList,Queueable:_Queueable.Queueable,Queue:_Queue.Queue,TaskQueue:_TaskQueue.TaskQueue,ScopedCollection:_ScopedCollection.ScopedCollection,Stackable:_Stackable.Stackable,Stack:_Stack.Stack,TaskStack:_TaskStack.TaskStack,recipes:_recipes.recipes,services:_services.services};var _default=exports.default=collectYourStuff;"undefined"!=typeof window&&(window.collectYourStuff=collectYourStuff);
|