elseware-nodejs 1.7.8 → 1.7.9

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.cjs CHANGED
@@ -347,29 +347,20 @@ function loadEnv(options) {
347
347
  return options.transform ? options.transform(result.data) : result.data;
348
348
  }
349
349
  function handleError(error) {
350
- logger.danger("Env validation failed");
350
+ logger.danger("ENV VALIDATION FAILED");
351
351
  const grouped = {};
352
352
  error.issues.forEach((err) => {
353
353
  const key = err.path.join(".") || "unknown";
354
- const rawValue = key !== "unknown" ? process.env[key] : void 0;
355
- const isSecret = key.toLowerCase().includes("secret");
356
- const safeValue = isSecret ? "***" : rawValue;
357
- const messageParts = [
358
- `message: ${err.message}`,
359
- `code: ${err.code}`,
360
- rawValue !== void 0 ? `value: ${JSON.stringify(safeValue)}` : null
361
- ].filter(Boolean);
362
- const fullMessage = messageParts.join(" | ");
363
354
  if (!grouped[key]) grouped[key] = [];
364
- grouped[key].push(fullMessage);
355
+ grouped[key].push(err.message);
365
356
  });
366
357
  Object.entries(grouped).forEach(([key, messages]) => {
367
358
  logger.info(`${key}`);
368
359
  messages.forEach((msg) => {
369
- logger.log(` - ${msg}`);
360
+ logger.log(`${msg}`);
370
361
  });
371
362
  });
372
- logger.danger("Application startup aborted!");
363
+ logger.danger("Application startup aborted.\n");
373
364
  process.exit(1);
374
365
  }
375
366