@hmawla/co-assistant 1.0.1 → 1.0.2

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/dist/index.js CHANGED
@@ -330,11 +330,19 @@ function resolveLogLevel() {
330
330
  const valid = ["fatal", "error", "warn", "info", "debug", "trace", "silent"];
331
331
  return envLevel && valid.includes(envLevel) ? envLevel : "info";
332
332
  }
333
+ function isPinoPrettyAvailable() {
334
+ try {
335
+ import.meta.resolve("pino-pretty");
336
+ return true;
337
+ } catch {
338
+ return false;
339
+ }
340
+ }
333
341
  function buildLoggerOptions() {
334
342
  const level = resolveLogLevel();
335
343
  const isProduction = process.env.NODE_ENV === "production";
336
344
  const opts = { level };
337
- if (!isProduction) {
345
+ if (!isProduction && isPinoPrettyAvailable()) {
338
346
  opts.transport = {
339
347
  target: "pino-pretty",
340
348
  options: {