collect-your-stuff 1.2.0 → 1.2.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/browser/collect-your-stuff.js +1839 -1371
- package/browser/collect-your-stuff.min.js +1 -1
- package/dist/collections/arrayable/Arrayable.js +0 -1
- package/dist/collections/arrayable/Arrayable.min.js +1 -1
- package/dist/collections/doubly-linked-list/DoublyLinkedList.js +0 -1
- package/dist/collections/doubly-linked-list/DoublyLinkedList.min.js +1 -1
- package/dist/collections/linked-list/LinkedList.js +0 -1
- package/dist/collections/linked-list/LinkedList.min.js +1 -1
- package/dist/collections/linked-tree-list/LinkedTreeList.js +0 -1
- package/dist/collections/linked-tree-list/LinkedTreeList.min.js +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
4
4
|
value: true
|
|
5
5
|
})
|
|
6
6
|
exports.Arrayable = void 0
|
|
7
|
-
require('core-js/modules/web.dom-collections.iterator.js')
|
|
8
7
|
var _ArrayElement = require('./ArrayElement')
|
|
9
8
|
var _ArrayIterator = require('../../recipes/ArrayIterator')
|
|
10
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Arrayable=void 0
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Arrayable=void 0;var _ArrayElement=require("./ArrayElement"),_ArrayIterator=require("../../recipes/ArrayIterator");class Arrayable{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_ArrayElement.ArrayElement;this.classType=Arrayable,this.innerList=[],this.initialized=!1,this.elementClass=t}initialize(t){return this.initialized?(console.warn("Attempt to initialize non-empty list."),this):(this.initialized=!0,this.innerList=t,this)}get list(){return this.innerList}get first(){return this.innerList[0]}get last(){return this.innerList[this.length-1]}get length(){return this.innerList.length}insertAfter(t,e){const r=this.innerList.indexOf(t);return this.innerList.splice(r+1,0,this.elementClass.make(e)),this}insertBefore(t,e){const r=this.innerList.indexOf(t);return this.innerList.splice(r,0,this.elementClass.make(e)),this}append(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.last;return this.insertAfter(e,t)}prepend(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.first;return this.insertBefore(e,t)}remove(t){const e=this.innerList.indexOf(t);return this.innerList.splice(e,1),t}item(t){if(t>=this.length)return null;if(t>=0)return this.innerList[t];const e=this.length+t;return e<0?null:this.innerList[e]}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;for(let r=0;r<e.length;++r)t(e.item(r),r,e);return e}[Symbol.iterator](){return new _ArrayIterator.ArrayIterator(this.innerList,0)}}exports.Arrayable=Arrayable,Arrayable.fromArray=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_ArrayElement.ArrayElement;return new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Arrayable)(e).initialize(e.fromArray(t).head)};
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
4
4
|
value: true
|
|
5
5
|
})
|
|
6
6
|
exports.DoublyLinkedList = void 0
|
|
7
|
-
require('core-js/modules/web.dom-collections.iterator.js')
|
|
8
7
|
var _DoubleLinker = require('./DoubleLinker')
|
|
9
8
|
var _DoubleLinkerIterator = require('../../recipes/DoubleLinkerIterator')
|
|
10
9
|
var _LinkedList = require('../linked-list/LinkedList')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DoublyLinkedList=void 0
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DoublyLinkedList=void 0;var _DoubleLinker=require("./DoubleLinker"),_DoubleLinkerIterator=require("../../recipes/DoubleLinkerIterator"),_LinkedList=require("../linked-list/LinkedList");class DoublyLinkedList{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_DoubleLinker.DoubleLinker;this.classType=DoublyLinkedList,this.innerList=null,this.initialized=!1,this.linkerClass=e}initialize(e){return _LinkedList.LinkedList.prototype.initialize.call(this,e)}get list(){return this.innerList}get first(){return this.reset()}get last(){let e=this.innerList;if(null===e)return null;let t=e.next;for(;null!==t;)e=t,t=e.next;return e}get length(){let e=this.first,t=0;for(;null!==e;)++t,e=e.next;return t}insertAfter(e,t){return t=this.linkerClass.make(t),null!==e&&(t.next=e.next,t.prev=e,e.next=t),t.next&&(t.next.prev=t),this.length||(this.innerList=t),this.reset(),this}insertBefore(e,t){return t=this.linkerClass.make(t),null!==e&&(t.prev=e.prev,t.next=e,e.prev=t),t.prev&&(t.prev.next=t),this.length||(this.innerList=t),this.reset(),this}append(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.last;return this.insertAfter(t,e)}prepend(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.first;return this.insertBefore(t,e)}remove(e){return null===e?null:(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),this.reset(),e)}reset(){let e=this.innerList;if(null===e)return null;let t=e.next;for(;null!==t;)e=t,t=e.next;let i=e.prev;for(;null!==i;)e=i,i=e.prev;return this.innerList=e,e}item(e){if(e>=0){let t=this.first,i=-1;for(;++i<e&&null!==t;)t=t.next;return i===e?t:null}let t=this.last,i=this.length;const r=this.length+e;if(r<0)return null;for(;--i>r&&null!==t;)t=t.prev;return i===r?t:null}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;return _LinkedList.LinkedList.prototype.forEach.call(this,e,t)}[Symbol.iterator](){let e=this.first;return new _DoubleLinkerIterator.DoubleLinkerIterator(e)}}exports.DoublyLinkedList=DoublyLinkedList,DoublyLinkedList.fromArray=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_DoubleLinker.DoubleLinker,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:DoublyLinkedList;return _LinkedList.LinkedList.fromArray(e,t,i)};
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
4
4
|
value: true
|
|
5
5
|
})
|
|
6
6
|
exports.LinkedList = void 0
|
|
7
|
-
require('core-js/modules/web.dom-collections.iterator.js')
|
|
8
7
|
var _Linker = require('./Linker')
|
|
9
8
|
var _LinkerIterator = require('../../recipes/LinkerIterator')
|
|
10
9
|
var _Arrayable = require('../arrayable/Arrayable')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinkedList=void 0
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinkedList=void 0;var _Linker=require("./Linker"),_LinkerIterator=require("../../recipes/LinkerIterator"),_Arrayable=require("../arrayable/Arrayable");class LinkedList{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_Linker.Linker;this.classType=LinkedList,this.innerList=null,this.initialized=!1,this.linkerClass=t}initialize(t){return _Arrayable.Arrayable.prototype.initialize.call(this,t)}get list(){return this.innerList}get first(){return this.innerList}get last(){let t=this.innerList;if(null===t)return null;let e=t.next;for(;null!==e;)t=e,e=t.next;return t}get length(){let t=this.first,e=0;for(;null!==t;)++e,t=t.next;return e}insertAfter(t,e){return e=this.linkerClass.make(e),null!==t&&(e.next=t.next,t.next=e),this.length||(this.innerList=e),this}insertBefore(t,e){e=this.linkerClass.make(e);let r=null,i=this.first;for(;i!==t;)r=i,i=i.next;return e.next=t,r&&(r.next=e),t!==this.first&&null!==t||(this.innerList=e),this}append(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.last;return this.insertAfter(e,t)}prepend(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.first;return this.insertBefore(e,t)}remove(t){let e=null,r=this.first;for(;r!==t;)e=r,r=r.next;return e&&(e.next=t.next),t===this.first&&null!==t&&(this.innerList=t.next),t}item(t){if(t>=0){let e=this.first,r=-1;for(;++r<t&&null!==e;)e=e.next;return r===t?e:null}let e=this.first,r=0;const i=this.length+t;if(i<0)return null;for(;r<i&&null!==e;)e=e.next,++r;return r===i?e:null}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=0,i=e.first;for(;null!==i;)t(i,r,e),i=i.next,++r;return e}[Symbol.iterator](){return new _LinkerIterator.LinkerIterator(this.first)}}exports.LinkedList=LinkedList,LinkedList.fromArray=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_Linker.Linker;return new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:LinkedList)(e).initialize(e.fromArray(t).head)};
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
4
4
|
value: true
|
|
5
5
|
})
|
|
6
6
|
exports.LinkedTreeList = void 0
|
|
7
|
-
require('core-js/modules/web.dom-collections.iterator.js')
|
|
8
7
|
var _TreeLinker = require('./TreeLinker')
|
|
9
8
|
var _TreeLinkerIterator = require('../../recipes/TreeLinkerIterator')
|
|
10
9
|
var _DoublyLinkedList = require('../doubly-linked-list/DoublyLinkedList')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinkedTreeList=void 0
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinkedTreeList=void 0;var _TreeLinker=require("./TreeLinker"),_TreeLinkerIterator=require("../../recipes/TreeLinkerIterator"),_DoublyLinkedList=require("../doubly-linked-list/DoublyLinkedList");class LinkedTreeList{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_TreeLinker.TreeLinker;this.classType=LinkedTreeList,this.innerList=null,this.initialized=!1,this.linkerClass=e}initialize(e){return this.initialized?(console.warn("Attempt to initialize LinkedTreeList which is not empty."),this):(this.initialized=!0,this.innerList=e,this)}get list(){return this.innerList}get first(){return this.reset()}get last(){let e=this.innerList;if(null===e)return null;let t=e.next;for(;null!==t;)e=t,t=e.next;return e}get length(){let e=this.first,t=0;for(;null!==e;)++t,e=e.next;return t}get parent(){return null===this.first?null:this.first.parent}set parent(e){let t=this.first;for(;null!==t;)t.parent=e,t=t.next;e&&(e.children=this)}get rootParent(){let e=this.first;if(!e)return null;let t=this.first.parent;for(;null!==t;)e=t,t=e.parent;return e}setChildren(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Array.from(this).indexOf(e)<0&&console.error("item is not a child of this"),t.parent=e}insertAfter(e,t){return _DoublyLinkedList.DoublyLinkedList.prototype.insertAfter.call(this,e,t)}insertBefore(e,t){return _DoublyLinkedList.DoublyLinkedList.prototype.insertBefore.call(this,e,t)}append(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.last;return _DoublyLinkedList.DoublyLinkedList.prototype.append.call(this,e,t)}prepend(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.first;return _DoublyLinkedList.DoublyLinkedList.prototype.prepend.call(this,e,t)}remove(e){return _DoublyLinkedList.DoublyLinkedList.prototype.remove.call(this,e)}reset(){return _DoublyLinkedList.DoublyLinkedList.prototype.reset.call(this)}item(e){return _DoublyLinkedList.DoublyLinkedList.prototype.item.call(this,e)}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,i=0,r=t.first;for(;null!==r;)e(r,i,t),r=r.next,++i;return t}[Symbol.iterator](){let e=this.rootParent;return new _TreeLinkerIterator.TreeLinkerIterator(e)}}exports.LinkedTreeList=LinkedTreeList,LinkedTreeList.fromArray=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_TreeLinker.TreeLinker;return new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:LinkedTreeList)(t).initialize(t.fromArray(e).head)};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "collect-your-stuff",
|
|
3
3
|
"description": "Use a variety of collections to collect your stuff when building code.",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
7
7
|
"author": "Joshua Heagle",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"watch:test": "gulp watchTest"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"js-build-tools": "^
|
|
27
|
+
"js-build-tools": "^4.0.4"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|