@piggly/ddd-toolkit
Advanced tools
Comparing version 3.2.1 to 3.2.2
@@ -77,3 +77,2 @@ "use strict"; | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
}; | ||
@@ -101,4 +100,4 @@ hidden.forEach((key) => { | ||
extra: this.extra ?? null, | ||
context: this._context ?? null, | ||
previous: this.previousToObject(), | ||
context: this.context ?? null, | ||
}; | ||
@@ -105,0 +104,0 @@ } |
@@ -77,3 +77,3 @@ "use strict"; | ||
* The extra error data. | ||
* Better to add data to inspect response. May be ignored on JSON. | ||
* Better to add data to client about a response. | ||
* | ||
@@ -90,3 +90,3 @@ * @type {Record<string, any>} | ||
* The error context. | ||
* Better to add context to client about a response. | ||
* Better to add data to inspect response. | ||
* | ||
@@ -100,3 +100,3 @@ * @type {Record<string, any>} | ||
*/ | ||
context; | ||
_context; | ||
/** | ||
@@ -145,3 +145,2 @@ * Creates an instance of DomainError. | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
}; | ||
@@ -169,3 +168,3 @@ hidden.forEach(prop => { | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
context: this._context ?? null, | ||
}; | ||
@@ -172,0 +171,0 @@ } |
@@ -67,2 +67,3 @@ "use strict"; | ||
* The extra error data. | ||
* Better to add data to client about a response. | ||
* | ||
@@ -79,3 +80,3 @@ * @type {Record<string, any>} | ||
* The error context. | ||
* Better to add context to client about a response. | ||
* Better to add data to inspect response. | ||
* | ||
@@ -89,3 +90,3 @@ * @type {Record<string, any>} | ||
*/ | ||
context; | ||
_context; | ||
/** | ||
@@ -146,3 +147,3 @@ * The previous error. | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
context: this._context ?? null, | ||
}; | ||
@@ -182,3 +183,3 @@ hidden.forEach((key) => { | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
context: this._context ?? null, | ||
previous: this.previousToObject(), | ||
@@ -185,0 +186,0 @@ }; |
@@ -74,3 +74,2 @@ import { DomainError } from './DomainError.js'; | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
}; | ||
@@ -98,4 +97,4 @@ hidden.forEach((key) => { | ||
extra: this.extra ?? null, | ||
context: this._context ?? null, | ||
previous: this.previousToObject(), | ||
context: this.context ?? null, | ||
}; | ||
@@ -102,0 +101,0 @@ } |
@@ -74,3 +74,3 @@ /** | ||
* The extra error data. | ||
* Better to add data to inspect response. May be ignored on JSON. | ||
* Better to add data to client about a response. | ||
* | ||
@@ -87,3 +87,3 @@ * @type {Record<string, any>} | ||
* The error context. | ||
* Better to add context to client about a response. | ||
* Better to add data to inspect response. | ||
* | ||
@@ -97,3 +97,3 @@ * @type {Record<string, any>} | ||
*/ | ||
context; | ||
_context; | ||
/** | ||
@@ -142,3 +142,2 @@ * Creates an instance of DomainError. | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
}; | ||
@@ -166,3 +165,3 @@ hidden.forEach(prop => { | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
context: this._context ?? null, | ||
}; | ||
@@ -169,0 +168,0 @@ } |
@@ -64,2 +64,3 @@ import { DomainError } from './DomainError.js'; | ||
* The extra error data. | ||
* Better to add data to client about a response. | ||
* | ||
@@ -76,3 +77,3 @@ * @type {Record<string, any>} | ||
* The error context. | ||
* Better to add context to client about a response. | ||
* Better to add data to inspect response. | ||
* | ||
@@ -86,3 +87,3 @@ * @type {Record<string, any>} | ||
*/ | ||
context; | ||
_context; | ||
/** | ||
@@ -143,3 +144,3 @@ * The previous error. | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
context: this._context ?? null, | ||
}; | ||
@@ -179,3 +180,3 @@ hidden.forEach((key) => { | ||
extra: this.extra ?? null, | ||
context: this.context ?? null, | ||
context: this._context ?? null, | ||
previous: this.previousToObject(), | ||
@@ -182,0 +183,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import { TOrNullable, TOrUndefined } from '../../types'; | ||
import type { TOrNull, TOrNullable, TOrUndefined } from '../../types'; | ||
import { DomainError } from './DomainError'; | ||
@@ -74,3 +74,5 @@ import type { ApplicationErrorJSON, DomainErrorHiddenProp, DomainErrorJSON, IApplicationError, PreviousError, PreviousErrorJSON } from './types'; | ||
*/ | ||
toObject(): ApplicationErrorJSON; | ||
toObject(): ApplicationErrorJSON & { | ||
context: TOrNull<Record<string, any>>; | ||
}; | ||
/** | ||
@@ -77,0 +79,0 @@ * Get the previous error as a JSON object. |
@@ -0,1 +1,2 @@ | ||
import { TOrNull } from '../../types'; | ||
import type { DomainErrorHiddenProp, DomainErrorJSON, IDomainError } from './types'; | ||
@@ -75,3 +76,3 @@ /** | ||
* The extra error data. | ||
* Better to add data to inspect response. May be ignored on JSON. | ||
* Better to add data to client about a response. | ||
* | ||
@@ -88,3 +89,3 @@ * @type {Record<string, any>} | ||
* The error context. | ||
* Better to add context to client about a response. | ||
* Better to add data to inspect response. | ||
* | ||
@@ -98,3 +99,3 @@ * @type {Record<string, any>} | ||
*/ | ||
readonly context?: Record<string, any>; | ||
protected _context?: Record<string, any>; | ||
/** | ||
@@ -136,3 +137,5 @@ * Creates an instance of DomainError. | ||
*/ | ||
toObject(): DomainErrorJSON; | ||
toObject(): DomainErrorJSON & { | ||
context: TOrNull<Record<string, any>>; | ||
}; | ||
/** | ||
@@ -139,0 +142,0 @@ * Check if the error is an instance of the given class. |
@@ -1,2 +0,2 @@ | ||
import type { TOrNullable, TOrUndefined } from '../../types'; | ||
import type { TOrNull, TOrNullable, TOrUndefined } from '../../types'; | ||
import type { ApplicationErrorJSON, DomainErrorHiddenProp, DomainErrorJSON, IRuntimeError, PreviousError, PreviousErrorJSON } from './types'; | ||
@@ -65,2 +65,3 @@ /** | ||
* The extra error data. | ||
* Better to add data to client about a response. | ||
* | ||
@@ -77,3 +78,3 @@ * @type {Record<string, any>} | ||
* The error context. | ||
* Better to add context to client about a response. | ||
* Better to add data to inspect response. | ||
* | ||
@@ -87,3 +88,3 @@ * @type {Record<string, any>} | ||
*/ | ||
readonly context?: Record<string, any>; | ||
protected _context?: Record<string, any>; | ||
/** | ||
@@ -146,3 +147,5 @@ * The previous error. | ||
*/ | ||
toObject(): ApplicationErrorJSON; | ||
toObject(): ApplicationErrorJSON & { | ||
context: TOrNull<Record<string, any>>; | ||
}; | ||
/** | ||
@@ -149,0 +152,0 @@ * Get the previous error as a JSON object. |
@@ -8,3 +8,2 @@ import type { JSONExportable, ObjectExportable, TOrNullable, TOrUndefined } from '../../../types'; | ||
extra: TOrNullable<Record<any, any>>; | ||
context: TOrNullable<Record<any, any>>; | ||
}; | ||
@@ -11,0 +10,0 @@ export type ApplicationErrorJSON = DomainErrorJSON & { |
{ | ||
"name": "@piggly/ddd-toolkit", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
8706
324013