@adviser/cement 0.2.43 → 0.2.45

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/index.d.cts CHANGED
@@ -602,7 +602,7 @@ declare class HeadersImpl extends Headers {
602
602
  }
603
603
  declare class HttpHeader {
604
604
  readonly _headers: Map<string, string[]>;
605
- static from(headers?: HeadersInit | NodeJS.Dict<string | string[]> | Headers): HttpHeader;
605
+ static from(headers?: HeadersInit | NodeJS.Dict<string | string[]> | Headers | HttpHeader): HttpHeader;
606
606
  _asStringString(): Map<string, string>;
607
607
  _key(key: string): string;
608
608
  Values(key: string): string[];
package/index.d.ts CHANGED
@@ -602,7 +602,7 @@ declare class HeadersImpl extends Headers {
602
602
  }
603
603
  declare class HttpHeader {
604
604
  readonly _headers: Map<string, string[]>;
605
- static from(headers?: HeadersInit | NodeJS.Dict<string | string[]> | Headers): HttpHeader;
605
+ static from(headers?: HeadersInit | NodeJS.Dict<string | string[]> | Headers | HttpHeader): HttpHeader;
606
606
  _asStringString(): Map<string, string>;
607
607
  _key(key: string): string;
608
608
  Values(key: string): string[];
package/index.js CHANGED
@@ -1325,7 +1325,14 @@ var LoggerImpl = class _LoggerImpl {
1325
1325
  }
1326
1326
  }
1327
1327
  if (err instanceof Error) {
1328
- this._attributes[key] = logValue(err.message, toLogValueCtx(this.levelHandler));
1328
+ if (err.cause) {
1329
+ this.coerceKey(key, {
1330
+ message: err.message,
1331
+ cause: err.cause
1332
+ });
1333
+ } else {
1334
+ this._attributes[key] = logValue(err.message, toLogValueCtx(this.levelHandler));
1335
+ }
1329
1336
  if (this.levelHandler.isStackExposed) {
1330
1337
  this._attributes["stack"] = logValue(
1331
1338
  (_a = err.stack) == null ? void 0 : _a.split("\n").map((s) => s.trim()),
@@ -1952,6 +1959,9 @@ var HttpHeader = class _HttpHeader {
1952
1959
  this._headers = /* @__PURE__ */ new Map();
1953
1960
  }
1954
1961
  static from(headers) {
1962
+ if (headers instanceof _HttpHeader) {
1963
+ return headers.Clone();
1964
+ }
1955
1965
  const h = new _HttpHeader();
1956
1966
  if (headers) {
1957
1967
  if (Array.isArray(headers)) {