@taujs/server 0.4.3 → 0.4.4

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -614,8 +614,15 @@ var Logger = class _Logger {
614
614
  const boundSink = rawSink ? rawSink.bind(owner) : void 0;
615
615
  const consoleFallback = level === "error" ? console.error : level === "warn" ? console.warn : console.log;
616
616
  const hasCustom = !!boundSink;
617
- const merged = meta ?? {};
618
- const withCtx = wantCtx && Object.keys(this.context).length > 0 ? { context: this.context, ...merged } : merged;
617
+ let baseMeta;
618
+ if (meta && typeof meta === "object" && !Array.isArray(meta)) {
619
+ baseMeta = meta;
620
+ } else if (meta === void 0) {
621
+ baseMeta = {};
622
+ } else {
623
+ baseMeta = { value: meta };
624
+ }
625
+ const withCtx = wantCtx && Object.keys(this.context).length > 0 ? { context: this.context, ...baseMeta } : baseMeta;
619
626
  const finalMeta = this.shouldIncludeStack(level) ? withCtx : this.stripStacks(withCtx);
620
627
  const hasMeta = finalMeta && typeof finalMeta === "object" ? Object.keys(finalMeta).length > 0 : false;
621
628
  const levelText = level.toLowerCase() + (category ? `:${category.toLowerCase()}` : "");
@@ -644,8 +651,8 @@ var Logger = class _Logger {
644
651
  if (hasCustom) {
645
652
  const obj = hasMeta ? finalMeta : {};
646
653
  try {
647
- const result = boundSink(obj, formatted);
648
- } catch (err) {
654
+ boundSink(obj, formatted);
655
+ } catch {
649
656
  hasMeta ? consoleFallback(formatted, finalMeta) : consoleFallback(formatted);
650
657
  }
651
658
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taujs/server",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "τjs [ taujs ]",
5
5
  "author": "John Smith | Aoede <taujs@aoede.uk.net> (https://www.aoede.uk.net)",
6
6
  "license": "MIT",