@blackglory/structures
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.1.6](https://github.com/BlackGlory/structures/compare/v0.1.5...v0.1.6) (2021-01-05) | ||
### Features | ||
* add empty ([d66a13b](https://github.com/BlackGlory/structures/commit/d66a13b3b737fd825e265079897640ba07996dda)) | ||
### [0.1.5](https://github.com/BlackGlory/structures/compare/v0.1.4...v0.1.5) (2021-01-04) | ||
@@ -7,0 +14,0 @@ |
@@ -51,2 +51,5 @@ (function (global, factory) { | ||
} | ||
empty() { | ||
__classPrivateFieldGet(this, _items).length = 0; | ||
} | ||
enqueue(...items) { | ||
@@ -53,0 +56,0 @@ __classPrivateFieldGet(this, _items).push(...items); |
@@ -15,3 +15,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Structures={})}(this,(function(e){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function t(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}var s,r,i,n=function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CustomError=void 0;class s extends Error{get name(){return this.constructor.name}}t.CustomError=s}));s=new WeakMap;class o extends n.CustomError{constructor(){super("Queue is empty.")}}class h{constructor(e){this.hash=e,r.set(this,new Map)}add(e){return t(this,r).set(this.hash(e),e),this}delete(e){return t(this,r).delete(this.hash(e))}has(e){return t(this,r).has(this.hash(e))}clear(){t(this,r).clear()}values(){return t(this,r).values()}get size(){return t(this,r).size}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}[Symbol.iterator](){return t(this,r).values()}}i=new WeakMap,e.Emitter=class{constructor(){i.set(this,new Map)}on(e,s){t(this,i).has(e)||t(this,i).set(e,new Set);t(this,i).get(e).add(s)}off(e,s){if(t(this,i).has(e)){const r=t(this,i).get(e);r.delete(s),0===r.size&&t(this,i).delete(e)}}emit(e,s){if(t(this,i).has(e)){t(this,i).get(e).forEach((e=>e(s)))}}},e.EmptyQueueError=o,e.HashSet=h,e.Queue=class{constructor(){s.set(this,[])}enqueue(...e){t(this,s).push(...e)}dequeue(){if(0===this.size)throw new o;return t(this,s).shift()}get size(){return t(this,s).length}},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */function t(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}var s,r,i,n=function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CustomError=void 0;class s extends Error{get name(){return this.constructor.name}}t.CustomError=s}));s=new WeakMap;class o extends n.CustomError{constructor(){super("Queue is empty.")}}class h{constructor(e){this.hash=e,r.set(this,new Map)}add(e){return t(this,r).set(this.hash(e),e),this}delete(e){return t(this,r).delete(this.hash(e))}has(e){return t(this,r).has(this.hash(e))}clear(){t(this,r).clear()}values(){return t(this,r).values()}get size(){return t(this,r).size}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}[Symbol.iterator](){return t(this,r).values()}}i=new WeakMap,e.Emitter=class{constructor(){i.set(this,new Map)}on(e,s){t(this,i).has(e)||t(this,i).set(e,new Set);t(this,i).get(e).add(s)}off(e,s){if(t(this,i).has(e)){const r=t(this,i).get(e);r.delete(s),0===r.size&&t(this,i).delete(e)}}emit(e,s){if(t(this,i).has(e)){t(this,i).get(e).forEach((e=>e(s)))}}},e.EmptyQueueError=o,e.HashSet=h,e.Queue=class{constructor(){s.set(this,[])}empty(){t(this,s).length=0}enqueue(...e){t(this,s).push(...e)}dequeue(){if(0===this.size)throw new o;return t(this,s).shift()}get size(){return t(this,s).length}},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.umd.min.js.map |
@@ -51,2 +51,5 @@ (function (global, factory) { | ||
} | ||
empty() { | ||
__classPrivateFieldGet(this, _items).length = 0; | ||
} | ||
enqueue(...items) { | ||
@@ -53,0 +56,0 @@ __classPrivateFieldGet(this, _items).push(...items); |
@@ -15,3 +15,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Structures={})}(this,(function(e){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function t(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}var s,r,i,n=function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CustomError=void 0;class s extends Error{get name(){return this.constructor.name}}t.CustomError=s}));s=new WeakMap;class o extends n.CustomError{constructor(){super("Queue is empty.")}}class h{constructor(e){this.hash=e,r.set(this,new Map)}add(e){return t(this,r).set(this.hash(e),e),this}delete(e){return t(this,r).delete(this.hash(e))}has(e){return t(this,r).has(this.hash(e))}clear(){t(this,r).clear()}values(){return t(this,r).values()}get size(){return t(this,r).size}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}[Symbol.iterator](){return t(this,r).values()}}i=new WeakMap,e.Emitter=class{constructor(){i.set(this,new Map)}on(e,s){t(this,i).has(e)||t(this,i).set(e,new Set);t(this,i).get(e).add(s)}off(e,s){if(t(this,i).has(e)){const r=t(this,i).get(e);r.delete(s),0===r.size&&t(this,i).delete(e)}}emit(e,s){if(t(this,i).has(e)){t(this,i).get(e).forEach((e=>e(s)))}}},e.EmptyQueueError=o,e.HashSet=h,e.Queue=class{constructor(){s.set(this,[])}enqueue(...e){t(this,s).push(...e)}dequeue(){if(0===this.size)throw new o;return t(this,s).shift()}get size(){return t(this,s).length}},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */function t(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}var s,r,i,n=function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CustomError=void 0;class s extends Error{get name(){return this.constructor.name}}t.CustomError=s}));s=new WeakMap;class o extends n.CustomError{constructor(){super("Queue is empty.")}}class h{constructor(e){this.hash=e,r.set(this,new Map)}add(e){return t(this,r).set(this.hash(e),e),this}delete(e){return t(this,r).delete(this.hash(e))}has(e){return t(this,r).has(this.hash(e))}clear(){t(this,r).clear()}values(){return t(this,r).values()}get size(){return t(this,r).size}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}[Symbol.iterator](){return t(this,r).values()}}i=new WeakMap,e.Emitter=class{constructor(){i.set(this,new Map)}on(e,s){t(this,i).has(e)||t(this,i).set(e,new Set);t(this,i).get(e).add(s)}off(e,s){if(t(this,i).has(e)){const r=t(this,i).get(e);r.delete(s),0===r.size&&t(this,i).delete(e)}}emit(e,s){if(t(this,i).has(e)){t(this,i).get(e).forEach((e=>e(s)))}}},e.EmptyQueueError=o,e.HashSet=h,e.Queue=class{constructor(){s.set(this,[])}empty(){t(this,s).length=0}enqueue(...e){t(this,s).push(...e)}dequeue(){if(0===this.size)throw new o;return t(this,s).shift()}get size(){return t(this,s).length}},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.umd.min.js.map |
import { CustomError } from '@blackglory/errors'; | ||
export declare class Queue<T> { | ||
#private; | ||
empty(): void; | ||
enqueue(...items: T[]): void; | ||
@@ -5,0 +6,0 @@ dequeue(): T; |
@@ -16,2 +16,5 @@ "use strict"; | ||
} | ||
empty() { | ||
__classPrivateFieldGet(this, _items).length = 0; | ||
} | ||
enqueue(...items) { | ||
@@ -18,0 +21,0 @@ __classPrivateFieldGet(this, _items).push(...items); |
import { CustomError } from '@blackglory/errors'; | ||
export declare class Queue<T> { | ||
#private; | ||
empty(): void; | ||
enqueue(...items: T[]): void; | ||
@@ -5,0 +6,0 @@ dequeue(): T; |
@@ -16,2 +16,5 @@ "use strict"; | ||
} | ||
empty() { | ||
__classPrivateFieldGet(this, _items).length = 0; | ||
} | ||
enqueue(...items) { | ||
@@ -18,0 +21,0 @@ __classPrivateFieldGet(this, _items).push(...items); |
{ | ||
"name": "@blackglory/structures", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170366
918