@module-federation/sdk 0.0.0-next-20240228065321 → 0.0.0-next-20240301023125
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.js +11 -1
- package/dist/index.esm.js +11 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -131,13 +131,23 @@ function safeToString(info) {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
var DEBUG_LOG = "[ FEDERATION DEBUG ]";
|
|
134
|
+
function safeGetLocalStorageItem() {
|
|
135
|
+
try {
|
|
136
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
137
|
+
return localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE;
|
|
138
|
+
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
return typeof document !== "undefined";
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
134
144
|
var Logger = /*#__PURE__*/ function() {
|
|
135
145
|
function Logger(identifier) {
|
|
136
146
|
_class_call_check(this, Logger);
|
|
137
147
|
_define_property$1(this, "enable", false);
|
|
138
148
|
_define_property$1(this, "identifier", void 0);
|
|
139
149
|
this.identifier = identifier || DEBUG_LOG;
|
|
140
|
-
if (isBrowserEnv() &&
|
|
150
|
+
if (isBrowserEnv() && safeGetLocalStorageItem()) {
|
|
141
151
|
this.enable = true;
|
|
142
152
|
} else if (isDebugMode()) {
|
|
143
153
|
this.enable = true;
|
package/dist/index.esm.js
CHANGED
|
@@ -127,13 +127,23 @@ function safeToString(info) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
var DEBUG_LOG = "[ FEDERATION DEBUG ]";
|
|
130
|
+
function safeGetLocalStorageItem() {
|
|
131
|
+
try {
|
|
132
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
133
|
+
return localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE;
|
|
134
|
+
}
|
|
135
|
+
} catch (error) {
|
|
136
|
+
return typeof document !== "undefined";
|
|
137
|
+
}
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
130
140
|
var Logger = /*#__PURE__*/ function() {
|
|
131
141
|
function Logger(identifier) {
|
|
132
142
|
_class_call_check(this, Logger);
|
|
133
143
|
_define_property$1(this, "enable", false);
|
|
134
144
|
_define_property$1(this, "identifier", void 0);
|
|
135
145
|
this.identifier = identifier || DEBUG_LOG;
|
|
136
|
-
if (isBrowserEnv() &&
|
|
146
|
+
if (isBrowserEnv() && safeGetLocalStorageItem()) {
|
|
137
147
|
this.enable = true;
|
|
138
148
|
} else if (isDebugMode()) {
|
|
139
149
|
this.enable = true;
|