@lionrapid/core 0.1.4-beta.2 → 0.2.1

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.
@@ -13,11 +13,12 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
13
13
  })(LogLevel || {});
14
14
 
15
15
  // src/utils/logger.ts
16
- var IS_PRODUCTION = true;
17
- var IS_DEVELOPMENT = false;
18
- var IS_CI = false;
19
- var LIONRAPID_DEV = false;
20
- var PERFORMANCE_TRACKING = false;
16
+ var _ENV = typeof process !== "undefined" && process.env ? process.env : {};
17
+ var IS_PRODUCTION = _ENV.NODE_ENV === "production";
18
+ var IS_DEVELOPMENT = _ENV.NODE_ENV === "development";
19
+ var IS_CI = _ENV.CI === "true";
20
+ var LIONRAPID_DEV = _ENV.LIONRAPID_DEV === "true";
21
+ var PERFORMANCE_TRACKING = _ENV.LIONRAPID_PERFORMANCE_TRACKING === "true";
21
22
  function readBrowserLogLevel() {
22
23
  try {
23
24
  if (typeof localStorage !== "undefined") {
@@ -28,7 +29,7 @@ function readBrowserLogLevel() {
28
29
  }
29
30
  return null;
30
31
  }
31
- var LOG_LEVEL_ENV = readBrowserLogLevel() || "" || "WARN";
32
+ var LOG_LEVEL_ENV = readBrowserLogLevel() || _ENV.LOG_LEVEL || "WARN";
32
33
  var Colors = {
33
34
  // Reset
34
35
  RESET: "\x1B[0m",
@@ -353,7 +354,9 @@ var EventEmitter = class {
353
354
  constructor() {
354
355
  // ✅ Properly typed event listeners without `any`
355
356
  __publicField(this, "eventListeners", /* @__PURE__ */ new Map());
356
- __publicField(this, "debugMode", false);
357
+ // Browser-safe: `process` is undeclared in browsers; guard before reading.
358
+ // Bundlers still substitute `process.env.NODE_ENV` at build time.
359
+ __publicField(this, "debugMode", typeof process !== "undefined" && false);
357
360
  }
358
361
  /**
359
362
  * Subscribe to events (PUBLIC API) - Fully type-safe
@@ -1210,7 +1213,8 @@ function prepareTranslationRequest(key, currentLocale, defaultValueOrParams, par
1210
1213
  function parseTranslationParams(secondParam, thirdParam) {
1211
1214
  let defaultValue;
1212
1215
  let params;
1213
- if (typeof secondParam === "object" && typeof thirdParam === "object" && false) {
1216
+ const _isNotProd = typeof process === "undefined" || false;
1217
+ if (typeof secondParam === "object" && typeof thirdParam === "object" && _isNotProd) {
1214
1218
  console.warn(
1215
1219
  "[LionRapid] Warning: Both secondParam and thirdParam are objects. Expected pattern: t(key, params, defaultValue) or t(key, defaultValue, params). Second object will be ignored as it cannot be a defaultValue."
1216
1220
  );