@onekeyfe/cross-inpage-provider-core
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -7,6 +7,9 @@ "use strict"; | ||
exports.fakeLogger = exports.appDebugLogger = exports.fakeDebugLogger = void 0; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
const debug_1 = __importDefault(require("./debug")); | ||
// enable debugLogger: | ||
// localStorage.setItem('$$ONEKEY_DEBUG_LOGGER', '*'); | ||
const fakeLogger = { | ||
// @ts-ignore | ||
_isFakeLogger: true, | ||
log: (...args) => undefined, | ||
@@ -52,14 +55,24 @@ warn: (...args) => undefined, | ||
super(); | ||
this._debugInstanceCreatedMap = {}; | ||
void (0, debug_1.default)().then((debug) => (this._debug = debug)); | ||
} | ||
_createDebugInstance(name) { | ||
if (this._debugInstanceCreatedMap[name]) { | ||
return; | ||
} | ||
this._debugInstanceCreatedMap[name] = true; | ||
if (name && this._debug && typeof this._debug === 'function') { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment | ||
const _instance = this._debug(name); | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
const _debugLog = this._debug(name); | ||
// @ts-ignore | ||
const _originLog = this[name]; | ||
// @ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment | ||
this[name] = (...args) => { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
_instance(...args); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
_debugLog(...args); | ||
if (_originLog && typeof _originLog === 'function') { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
_originLog(...args); | ||
} | ||
}; | ||
@@ -66,0 +79,0 @@ } |
@@ -1,5 +0,8 @@ | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
import createDebugAsync from './debug'; | ||
// enable debugLogger: | ||
// localStorage.setItem('$$ONEKEY_DEBUG_LOGGER', '*'); | ||
const fakeLogger = { | ||
// @ts-ignore | ||
_isFakeLogger: true, | ||
log: (...args) => undefined, | ||
@@ -44,14 +47,24 @@ warn: (...args) => undefined, | ||
super(); | ||
this._debugInstanceCreatedMap = {}; | ||
void createDebugAsync().then((debug) => (this._debug = debug)); | ||
} | ||
_createDebugInstance(name) { | ||
if (this._debugInstanceCreatedMap[name]) { | ||
return; | ||
} | ||
this._debugInstanceCreatedMap[name] = true; | ||
if (name && this._debug && typeof this._debug === 'function') { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment | ||
const _instance = this._debug(name); | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
const _debugLog = this._debug(name); | ||
// @ts-ignore | ||
const _originLog = this[name]; | ||
// @ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment | ||
this[name] = (...args) => { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
_instance(...args); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
_debugLog(...args); | ||
if (_originLog && typeof _originLog === 'function') { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
_originLog(...args); | ||
} | ||
}; | ||
@@ -58,0 +71,0 @@ } |
{ | ||
"name": "@onekeyfe/cross-inpage-provider-core", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"keywords": [ | ||
@@ -31,4 +31,4 @@ "cross-inpage-provider" | ||
"dependencies": { | ||
"@onekeyfe/cross-inpage-provider-errors": "^0.0.4", | ||
"@onekeyfe/cross-inpage-provider-types": "^0.0.4", | ||
"@onekeyfe/cross-inpage-provider-errors": "^0.0.5", | ||
"@onekeyfe/cross-inpage-provider-types": "^0.0.5", | ||
"eventemitter3": "^4.0.7", | ||
@@ -38,3 +38,3 @@ "lodash": "^4.17.21", | ||
}, | ||
"gitHead": "d47447804157874b2607aea82f92ff3a132c5e67" | ||
"gitHead": "fc053fe3c2920fca734addae381339a29a09b716" | ||
} |
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
122610
2984
+ Added@onekeyfe/cross-inpage-provider-errors@0.0.5(transitive)
+ Added@onekeyfe/cross-inpage-provider-types@0.0.5(transitive)
- Removed@onekeyfe/cross-inpage-provider-errors@0.0.4(transitive)
- Removed@onekeyfe/cross-inpage-provider-types@0.0.4(transitive)