@autoplay/utils
Advanced tools
Comparing version 0.0.16 to 0.0.17
@@ -31,2 +31,3 @@ import { DevError } from "./DevError"; | ||
because(cause: DevString): DevString; | ||
because(tmpl: TemplateStringsArray, ...substitutions: any[]): DevString; | ||
record(key: string, value: unknown): DevString; | ||
@@ -33,0 +34,0 @@ asError(): DevError; |
@@ -26,12 +26,6 @@ import { DevError } from "./DevError"; | ||
} | ||
/** | ||
* @example | ||
* dev`login failure`.because(reason) | ||
* dev`failed token exchange with ${issuerURL}`.because(reason) | ||
* dev`Continue button to show`.because(reason) | ||
*/ | ||
because(cause) { | ||
because(cause, ...substitutions) { | ||
return new DevString(this._templateOrID, this._subs, { | ||
...this._values, | ||
cause: add(this._values?.cause, cause), | ||
cause: add(this._values?.cause, cause instanceof DevString ? cause : new DevString(cause, substitutions)), | ||
}); | ||
@@ -38,0 +32,0 @@ } |
{ | ||
"name": "@autoplay/utils", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"description": "Utilities designed for error management, parsing, and TypeScript domain modeling.", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -40,6 +40,8 @@ import { DevError } from "./DevError"; | ||
*/ | ||
because(cause: DevString): DevString { | ||
because(cause: DevString): DevString; | ||
because(tmpl: TemplateStringsArray, ...substitutions: any[]): DevString; | ||
because(cause: DevString | TemplateStringsArray, ...substitutions: any[]): DevString { | ||
return new DevString(this._templateOrID, this._subs, { | ||
...this._values, | ||
cause: add(this._values?.cause, cause), | ||
cause: add(this._values?.cause, cause instanceof DevString ? cause : new DevString(cause, substitutions)), | ||
}); | ||
@@ -46,0 +48,0 @@ } |
Sorry, the diff of this file is not supported yet
98799
2081