@piggly/ddd-toolkit
Advanced tools
Comparing version 3.6.0 to 3.7.0
@@ -140,2 +140,16 @@ "use strict"; | ||
/** | ||
* Remove an item by its hash from the collection. | ||
* | ||
* @param {string} hash | ||
* @returns {this} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
removeHash(hash) { | ||
this._items.delete(hash); | ||
return this; | ||
} | ||
/** | ||
* Check if the collection has a id. | ||
@@ -180,16 +194,33 @@ * | ||
/** | ||
* Get an item by its id from the collection. | ||
* Check if the collection has a hash. | ||
* | ||
* @param {Attribute} item | ||
* @param {string} hash | ||
* @returns {boolean} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
hasHash(hash) { | ||
return this._items.has(hash); | ||
} | ||
/** | ||
* Get an item by its hash from the collection. | ||
* | ||
* @param {string} hash | ||
* @returns {Attribute | undefined} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.4.0 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
get(item) { | ||
return this._items.get(item.hash()); | ||
get(hash) { | ||
const found = this._items.get(hash); | ||
if (!found) { | ||
return undefined; | ||
} | ||
return found; | ||
} | ||
/** | ||
* Find an item by its id from the collection. | ||
* Find an item by its hash from the collection. | ||
* | ||
@@ -200,7 +231,7 @@ * @param {Attribute} item | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.4.0 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
find(item) { | ||
const found = this.get(item); | ||
const found = this._items.get(item.hash()); | ||
if (!found) { | ||
@@ -207,0 +238,0 @@ return undefined; |
@@ -167,2 +167,16 @@ "use strict"; | ||
/** | ||
* Remove an item by its hash from the collection. | ||
* | ||
* @param {string} hash | ||
* @returns {this} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
removeHash(hash) { | ||
this._items.delete(hash); | ||
return this; | ||
} | ||
/** | ||
* Check if the collection has a id. | ||
@@ -207,16 +221,20 @@ * | ||
/** | ||
* Get an item by its id from the collection. | ||
* Get an item by attr from the collection. | ||
* | ||
* @param {Attribute} item | ||
* @param {string} hash | ||
* @returns {Attribute | undefined} | ||
* @public | ||
* @memberof AbstractCollectionOfEnhancedAttributes | ||
* @since 3.4.1 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
get(item) { | ||
return this._items.get(item.hash()); | ||
get(hash) { | ||
const found = this._items.get(hash); | ||
if (!found) { | ||
return undefined; | ||
} | ||
return found; | ||
} | ||
/** | ||
* Find an item by its id from the collection. | ||
* Find an item by its hash from the collection. | ||
* | ||
@@ -227,7 +245,7 @@ * @param {Attribute} item | ||
* @memberof AbstractCollectionOfEnhancedAttributes | ||
* @since 3.4.1 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
find(item) { | ||
const found = this.get(item); | ||
const found = this._items.get(item.hash()); | ||
if (!found) { | ||
@@ -239,2 +257,15 @@ return undefined; | ||
/** | ||
* Check if the collection has a hash. | ||
* | ||
* @param {string} hash | ||
* @returns {boolean} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
hasHash(hash) { | ||
return this._items.has(hash); | ||
} | ||
/** | ||
* Evaluate if any attribute is modified. | ||
@@ -241,0 +272,0 @@ * |
@@ -137,2 +137,16 @@ /** | ||
/** | ||
* Remove an item by its hash from the collection. | ||
* | ||
* @param {string} hash | ||
* @returns {this} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
removeHash(hash) { | ||
this._items.delete(hash); | ||
return this; | ||
} | ||
/** | ||
* Check if the collection has a id. | ||
@@ -177,16 +191,33 @@ * | ||
/** | ||
* Get an item by its id from the collection. | ||
* Check if the collection has a hash. | ||
* | ||
* @param {Attribute} item | ||
* @param {string} hash | ||
* @returns {boolean} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
hasHash(hash) { | ||
return this._items.has(hash); | ||
} | ||
/** | ||
* Get an item by its hash from the collection. | ||
* | ||
* @param {string} hash | ||
* @returns {Attribute | undefined} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.4.0 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
get(item) { | ||
return this._items.get(item.hash()); | ||
get(hash) { | ||
const found = this._items.get(hash); | ||
if (!found) { | ||
return undefined; | ||
} | ||
return found; | ||
} | ||
/** | ||
* Find an item by its id from the collection. | ||
* Find an item by its hash from the collection. | ||
* | ||
@@ -197,7 +228,7 @@ * @param {Attribute} item | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.4.0 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
find(item) { | ||
const found = this.get(item); | ||
const found = this._items.get(item.hash()); | ||
if (!found) { | ||
@@ -204,0 +235,0 @@ return undefined; |
@@ -164,2 +164,16 @@ import { EventEmmiter } from './EventEmmiter.js'; | ||
/** | ||
* Remove an item by its hash from the collection. | ||
* | ||
* @param {string} hash | ||
* @returns {this} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
removeHash(hash) { | ||
this._items.delete(hash); | ||
return this; | ||
} | ||
/** | ||
* Check if the collection has a id. | ||
@@ -204,16 +218,20 @@ * | ||
/** | ||
* Get an item by its id from the collection. | ||
* Get an item by attr from the collection. | ||
* | ||
* @param {Attribute} item | ||
* @param {string} hash | ||
* @returns {Attribute | undefined} | ||
* @public | ||
* @memberof AbstractCollectionOfEnhancedAttributes | ||
* @since 3.4.1 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
get(item) { | ||
return this._items.get(item.hash()); | ||
get(hash) { | ||
const found = this._items.get(hash); | ||
if (!found) { | ||
return undefined; | ||
} | ||
return found; | ||
} | ||
/** | ||
* Find an item by its id from the collection. | ||
* Find an item by its hash from the collection. | ||
* | ||
@@ -224,7 +242,7 @@ * @param {Attribute} item | ||
* @memberof AbstractCollectionOfEnhancedAttributes | ||
* @since 3.4.1 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
find(item) { | ||
const found = this.get(item); | ||
const found = this._items.get(item.hash()); | ||
if (!found) { | ||
@@ -236,2 +254,15 @@ return undefined; | ||
/** | ||
* Check if the collection has a hash. | ||
* | ||
* @param {string} hash | ||
* @returns {boolean} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
hasHash(hash) { | ||
return this._items.has(hash); | ||
} | ||
/** | ||
* Evaluate if any attribute is modified. | ||
@@ -238,0 +269,0 @@ * |
@@ -111,2 +111,13 @@ import type { IAttribute } from './types'; | ||
/** | ||
* Remove an item by its hash from the collection. | ||
* | ||
* @param {string} hash | ||
* @returns {this} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
removeHash(hash: string): this; | ||
/** | ||
* Check if the collection has a id. | ||
@@ -145,14 +156,25 @@ * | ||
/** | ||
* Get an item by its id from the collection. | ||
* Check if the collection has a hash. | ||
* | ||
* @param {Attribute} item | ||
* @param {string} hash | ||
* @returns {boolean} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
hasHash(hash: string): boolean; | ||
/** | ||
* Get an item by its hash from the collection. | ||
* | ||
* @param {string} hash | ||
* @returns {Attribute | undefined} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.4.0 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
get(item: Attribute): Attribute | undefined; | ||
get(hash: string): Attribute | undefined; | ||
/** | ||
* Find an item by its id from the collection. | ||
* Find an item by its hash from the collection. | ||
* | ||
@@ -163,3 +185,3 @@ * @param {Attribute} item | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.4.0 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
@@ -166,0 +188,0 @@ */ |
@@ -132,2 +132,13 @@ import { EnhancedAttribute } from './EnhancedAttribute'; | ||
/** | ||
* Remove an item by its hash from the collection. | ||
* | ||
* @param {string} hash | ||
* @returns {this} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
removeHash(hash: string): this; | ||
/** | ||
* Check if the collection has a id. | ||
@@ -166,14 +177,14 @@ * | ||
/** | ||
* Get an item by its id from the collection. | ||
* Get an item by attr from the collection. | ||
* | ||
* @param {Attribute} item | ||
* @param {string} hash | ||
* @returns {Attribute | undefined} | ||
* @public | ||
* @memberof AbstractCollectionOfEnhancedAttributes | ||
* @since 3.4.1 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
get(item: Attribute): Attribute | undefined; | ||
get(hash: string): Attribute | undefined; | ||
/** | ||
* Find an item by its id from the collection. | ||
* Find an item by its hash from the collection. | ||
* | ||
@@ -184,3 +195,3 @@ * @param {Attribute} item | ||
* @memberof AbstractCollectionOfEnhancedAttributes | ||
* @since 3.4.1 | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
@@ -190,2 +201,13 @@ */ | ||
/** | ||
* Check if the collection has a hash. | ||
* | ||
* @param {string} hash | ||
* @returns {boolean} | ||
* @public | ||
* @memberof AbstractCollectionOfAttributes | ||
* @since 3.7.0 | ||
* @author Caique Araujo <caique@piggly.com.br> | ||
*/ | ||
hasHash(hash: string): boolean; | ||
/** | ||
* Evaluate if any attribute is modified. | ||
@@ -192,0 +214,0 @@ * |
{ | ||
"name": "@piggly/ddd-toolkit", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"description": "A bunch of tools to use Model-Driven Design and Domain-Driven Design architecture in a back-end application.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
437608
11665