@module-federation/sdk
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -111,2 +111,12 @@ 'use strict'; | ||
var DEBUG_LOG = "[ FEDERATION DEBUG ]"; | ||
function safeGetLocalStorageItem() { | ||
try { | ||
if (typeof window !== "undefined" && window.localStorage) { | ||
return localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE; | ||
} | ||
} catch (error) { | ||
return typeof document !== "undefined"; | ||
} | ||
return false; | ||
} | ||
var Logger = /*#__PURE__*/ function() { | ||
@@ -118,3 +128,3 @@ function Logger(identifier) { | ||
this.identifier = identifier || DEBUG_LOG; | ||
if (isBrowserEnv() && localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE) { | ||
if (isBrowserEnv() && safeGetLocalStorageItem()) { | ||
this.enable = true; | ||
@@ -1098,3 +1108,3 @@ } else if (isDebugMode()) { | ||
if (attrs && exportedInterface && attrs["globalName"]) { | ||
container = exportedInterface[attrs["globalName"]]; | ||
container = exportedInterface[attrs["globalName"]] || exportedInterface; | ||
cb(undefined, container); | ||
@@ -1101,0 +1111,0 @@ return [ |
@@ -107,2 +107,12 @@ function _define_property$2(obj, key, value) { | ||
var DEBUG_LOG = "[ FEDERATION DEBUG ]"; | ||
function safeGetLocalStorageItem() { | ||
try { | ||
if (typeof window !== "undefined" && window.localStorage) { | ||
return localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE; | ||
} | ||
} catch (error) { | ||
return typeof document !== "undefined"; | ||
} | ||
return false; | ||
} | ||
var Logger = /*#__PURE__*/ function() { | ||
@@ -114,3 +124,3 @@ function Logger(identifier) { | ||
this.identifier = identifier || DEBUG_LOG; | ||
if (isBrowserEnv() && localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE) { | ||
if (isBrowserEnv() && safeGetLocalStorageItem()) { | ||
this.enable = true; | ||
@@ -1094,3 +1104,3 @@ } else if (isDebugMode()) { | ||
if (attrs && exportedInterface && attrs["globalName"]) { | ||
container = exportedInterface[attrs["globalName"]]; | ||
container = exportedInterface[attrs["globalName"]] || exportedInterface; | ||
cb(undefined, container); | ||
@@ -1097,0 +1107,0 @@ return [ |
{ | ||
"name": "@module-federation/sdk", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A sdk for support module federation", |
{ | ||
"name": "@module-federation/sdk", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A sdk for support module federation", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107231
2675