Skip to content

Commit

Permalink
0.2.0 - Removed Queue structures for rework - finished test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
zimmed committed Oct 20, 2022
1 parent 83cd828 commit a0ffa83
Show file tree
Hide file tree
Showing 38 changed files with 1,312 additions and 6,423 deletions.
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ I considered adding parallel factory patterns instead of instance-based structur
- [LinkedList](#user-content-linkedlist-docs-src)
- [SizedLinkedList](#user-content-sizedlinkedlist-docs-src)
- [LinkedSet](#user-content-linkedset-docs-src)
- [SortedSet](#user-content-sortedset-docs-src)
- [LinkedCollection](#user-content-linkedcollection-docs-src)
- [Queue](#user-content-queue-docs-src)
- [UniQueue](#user-content-uniqueue-docs-src)
- [PriorityQueue](#user-content-priorityqueue-docs-src)
- [ObjectPool](#user-content-priorityqueue-docs-src)

### Inheritance Tree
Expand All @@ -64,18 +60,18 @@ I considered adding parallel factory patterns instead of instance-based structur
LinkedList
┣━ SizedLinkedList
┃ ┻━ Queue
┃ ┻━ Queue [Future]
┣━ LinkedSet
┃ ┃
┃ ╋━ UniQueue
┃ ╋━ UniQueue [Future]
┃ ┃
┃ ╋━ SortedSet
┃ ╹ ┻━ PriorityQueue
┃ ╋━ SortedSet [Future]
┃ ╹ ┻━ PriorityQueue [Future]
┣━ LinkedCollection
┃ ┃
╹ ┻━ SortedCollection [Coming soon]
╹ ┻━ SortedCollection [Future]
ObjectPool < LinkedList
```
Expand Down Expand Up @@ -149,7 +145,7 @@ const five = set.pop(); // -> 'five'
set.size; // -> 4
```

### SortedSet ([docs](docs/classes/SortedSet.md)) ([src](src/SortedSet.ts))
<!-- ### SortedSet ([docs](docs/classes/SortedSet.md)) ([src](src/SortedSet.ts))
##### (extends [LinkedSet](#user-content-linkedset-docs-src))
Expand All @@ -169,9 +165,9 @@ collection
.add({ name: 'bar' }) // -> SortedSet { 'bar' 'foo' }
.add({ name: 'baz' }) // -> SortedSet { 'bar' 'baz' 'foo' }
.delete(collection.find((x) => x.name === 'bar')); // -> SortedSet { 'baz' 'foo' }
```
``` -->

### Queue ([docs](docs/classes/Queue.md)) ([src](src/Queue.ts))
<!-- ### Queue ([docs](docs/classes/Queue.md)) ([src](src/Queue.ts))
##### (extends [SizedLinkedList](#user-content-sizedlinkedlist-docs-src))
Expand All @@ -193,9 +189,9 @@ stack.pop(); // -> 5
// fifo -> Queue { 3 4 3 }
// lifo -> Queue { 1 2 3 }
```
``` -->

### UniQueue ([docs](docs/classes/UniQueue.md)) ([src](src/UniQueue.ts))
<!-- ### UniQueue ([docs](docs/classes/UniQueue.md)) ([src](src/UniQueue.ts))
##### (extends [LinkedSet](#user-content-linkedset-docs-src))
Expand All @@ -209,9 +205,9 @@ import { UniQueue as Queue } from '@zimmed/prefab';
const q = Queue.from([1, 2, 3, 4, 4, 3]); // -> UniQueue { 1, 2, 3, 4 }
q.has(3); // -> Hashmap lookup time
```
``` -->

### PriorityQueue ([docs](docs/classes/PriorityQueue.md)) ([src](src/PriorityQueue.ts))
<!-- ### PriorityQueue ([docs](docs/classes/PriorityQueue.md)) ([src](src/PriorityQueue.ts))
##### (extends [SortedSet](#user-content-sortedset-docs-src))
Expand All @@ -230,7 +226,7 @@ q.enqueue(5, 1)
.insert(200) // -> PriorityQueue { 200, 100 10, 5, 6, 1, 2, 3, 4 }
.enqueue(31) // -> PriorityQueue { 200, 100 10, 5, 6, 1, 2, 3, 4, 31 }
.dequeue(); // -> 200
```
``` -->

### LinkedCollection ([docs](docs/classes/LinkedCollection.md)) ([src](src/LinkedCollection.ts))

Expand Down Expand Up @@ -277,7 +273,7 @@ const four = collection.pop(); // -> Item('four')
collection.size; // -> 4

// Introduces expected Map method and changes signatures to be key lookups instead of item lookups
collection.get('two'); // -> Item('two')
collection.select('two'); // -> Item('two')
collection.has('one'); // -> true
collection.delete('three'); // -> true

Expand All @@ -299,9 +295,10 @@ new LinkedCollection('id', [
new LinkedCollection('id', [new Item('one'), new Item('two')]).groupBy('id'); // -> { one: Item('one'), two: Item('two') }
```

<!--
### SortedCollection (Coming Soon...)
##### (extends [LinkedCollection](#user-content-linkedcollection-docs-src))
##### (extends [LinkedCollection](#user-content-linkedcollection-docs-src)) -->

### ObjectPool ([docs](docs/classes/ObjectPool.md)) ([src](src/ObjectPool.ts))

Expand Down
2 changes: 1 addition & 1 deletion coverage/badge-branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion coverage/badge-functions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion coverage/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion coverage/badge-statements.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 6 additions & 10 deletions coverage/coverage-summary.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{"total": {"lines":{"total":539,"covered":360,"skipped":0,"pct":66.79},"statements":{"total":610,"covered":405,"skipped":0,"pct":66.39},"functions":{"total":148,"covered":93,"skipped":0,"pct":62.83},"branches":{"total":242,"covered":107,"skipped":0,"pct":44.21},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
,"/Users/zimmed/Projects/prefab/src/LinkedCollection.ts": {"lines":{"total":62,"covered":62,"skipped":0,"pct":100},"functions":{"total":19,"covered":19,"skipped":0,"pct":100},"statements":{"total":67,"covered":67,"skipped":0,"pct":100},"branches":{"total":13,"covered":13,"skipped":0,"pct":100}}
,"/Users/zimmed/Projects/prefab/src/LinkedList.ts": {"lines":{"total":130,"covered":130,"skipped":0,"pct":100},"functions":{"total":36,"covered":36,"skipped":0,"pct":100},"statements":{"total":154,"covered":154,"skipped":0,"pct":100},"branches":{"total":56,"covered":56,"skipped":0,"pct":100}}
{"total": {"lines":{"total":394,"covered":394,"skipped":0,"pct":100},"statements":{"total":445,"covered":445,"skipped":0,"pct":100},"functions":{"total":112,"covered":112,"skipped":0,"pct":100},"branches":{"total":149,"covered":149,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
,"/Users/zimmed/Projects/prefab/src/LinkedCollection.ts": {"lines":{"total":63,"covered":63,"skipped":0,"pct":100},"functions":{"total":20,"covered":20,"skipped":0,"pct":100},"statements":{"total":68,"covered":68,"skipped":0,"pct":100},"branches":{"total":17,"covered":17,"skipped":0,"pct":100}}
,"/Users/zimmed/Projects/prefab/src/LinkedList.ts": {"lines":{"total":129,"covered":129,"skipped":0,"pct":100},"functions":{"total":34,"covered":34,"skipped":0,"pct":100},"statements":{"total":154,"covered":154,"skipped":0,"pct":100},"branches":{"total":57,"covered":57,"skipped":0,"pct":100}}
,"/Users/zimmed/Projects/prefab/src/LinkedSet.ts": {"lines":{"total":35,"covered":35,"skipped":0,"pct":100},"functions":{"total":13,"covered":13,"skipped":0,"pct":100},"statements":{"total":38,"covered":38,"skipped":0,"pct":100},"branches":{"total":9,"covered":9,"skipped":0,"pct":100}}
,"/Users/zimmed/Projects/prefab/src/ObjectPool.ts": {"lines":{"total":71,"covered":10,"skipped":0,"pct":14.08},"functions":{"total":17,"covered":0,"skipped":0,"pct":0},"statements":{"total":77,"covered":10,"skipped":0,"pct":12.98},"branches":{"total":51,"covered":0,"skipped":0,"pct":0}}
,"/Users/zimmed/Projects/prefab/src/PriorityQueue.ts": {"lines":{"total":34,"covered":8,"skipped":0,"pct":23.52},"functions":{"total":12,"covered":0,"skipped":0,"pct":0},"statements":{"total":38,"covered":8,"skipped":0,"pct":21.05},"branches":{"total":13,"covered":0,"skipped":0,"pct":0}}
,"/Users/zimmed/Projects/prefab/src/Queue.ts": {"lines":{"total":15,"covered":9,"skipped":0,"pct":60},"functions":{"total":6,"covered":1,"skipped":0,"pct":16.66},"statements":{"total":15,"covered":9,"skipped":0,"pct":60},"branches":{"total":5,"covered":2,"skipped":0,"pct":40}}
,"/Users/zimmed/Projects/prefab/src/ObjectPool.ts": {"lines":{"total":83,"covered":83,"skipped":0,"pct":100},"functions":{"total":20,"covered":20,"skipped":0,"pct":100},"statements":{"total":90,"covered":90,"skipped":0,"pct":100},"branches":{"total":38,"covered":38,"skipped":0,"pct":100}}
,"/Users/zimmed/Projects/prefab/src/SizedLinkedList.ts": {"lines":{"total":55,"covered":55,"skipped":0,"pct":100},"functions":{"total":12,"covered":12,"skipped":0,"pct":100},"statements":{"total":56,"covered":56,"skipped":0,"pct":100},"branches":{"total":8,"covered":8,"skipped":0,"pct":100}}
,"/Users/zimmed/Projects/prefab/src/SortedSet.ts": {"lines":{"total":89,"covered":9,"skipped":0,"pct":10.11},"functions":{"total":11,"covered":0,"skipped":0,"pct":0},"statements":{"total":105,"covered":9,"skipped":0,"pct":8.57},"branches":{"total":61,"covered":0,"skipped":0,"pct":0}}
,"/Users/zimmed/Projects/prefab/src/UniQueue.ts": {"lines":{"total":15,"covered":9,"skipped":0,"pct":60},"functions":{"total":6,"covered":1,"skipped":0,"pct":16.66},"statements":{"total":15,"covered":9,"skipped":0,"pct":60},"branches":{"total":5,"covered":2,"skipped":0,"pct":40}}
,"/Users/zimmed/Projects/prefab/src/decorators.ts": {"lines":{"total":23,"covered":23,"skipped":0,"pct":100},"functions":{"total":7,"covered":7,"skipped":0,"pct":100},"statements":{"total":26,"covered":26,"skipped":0,"pct":100},"branches":{"total":21,"covered":17,"skipped":0,"pct":80.95}}
,"/Users/zimmed/Projects/prefab/src/index.ts": {"lines":{"total":10,"covered":10,"skipped":0,"pct":100},"functions":{"total":9,"covered":4,"skipped":0,"pct":44.44},"statements":{"total":19,"covered":19,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/zimmed/Projects/prefab/src/decorators.ts": {"lines":{"total":23,"covered":23,"skipped":0,"pct":100},"functions":{"total":7,"covered":7,"skipped":0,"pct":100},"statements":{"total":27,"covered":27,"skipped":0,"pct":100},"branches":{"total":20,"covered":20,"skipped":0,"pct":100}}
,"/Users/zimmed/Projects/prefab/src/index.ts": {"lines":{"total":6,"covered":6,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":12,"covered":12,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
}
Loading

0 comments on commit a0ffa83

Please sign in to comment.