@onekeyfe/cross-inpage-provider-core 1.1.43 → 1.1.44

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.
@@ -1,5 +1,5 @@
1
1
  import { CrossEventEmitter } from './CrossEventEmitter';
2
- import { IInjectedProviderNamesStrings, IJsBridgeConfig, IJsBridgeMessagePayload, IJsonRpcResponse, IDebugLogger } from '@onekeyfe/cross-inpage-provider-types';
2
+ import { IDebugLogger, IInjectedProviderNamesStrings, IJsBridgeConfig, IJsBridgeMessagePayload, IJsonRpcResponse } from '@onekeyfe/cross-inpage-provider-types';
3
3
  declare function isLegacyExtMessage(payload: unknown): boolean;
4
4
  declare abstract class JsBridgeBase extends CrossEventEmitter {
5
5
  constructor(config?: IJsBridgeConfig);
@@ -8,12 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  /* eslint-disable @typescript-eslint/ban-ts-comment */
11
- import { CrossEventEmitter } from './CrossEventEmitter';
12
11
  import isPlainObject from 'lodash/isPlainObject';
13
12
  import isString from 'lodash/isString';
13
+ import { CrossEventEmitter } from './CrossEventEmitter';
14
14
  import { appDebugLogger, consoleErrorInDev } from './loggers';
15
- import { IJsBridgeMessageTypes, } from '@onekeyfe/cross-inpage-provider-types';
16
15
  import { web3Errors } from '@onekeyfe/cross-inpage-provider-errors';
16
+ import { IJsBridgeMessageTypes, } from '@onekeyfe/cross-inpage-provider-types';
17
17
  import versionInfo from './versionInfo';
18
18
  function toPlainError(errorInfo) {
19
19
  return {
@@ -25,6 +25,7 @@ function toPlainError(errorInfo) {
25
25
  key: errorInfo.key,
26
26
  info: errorInfo.info,
27
27
  className: errorInfo.className,
28
+ autoToast: errorInfo.autoToast,
28
29
  };
29
30
  }
30
31
  function isLegacyExtMessage(payload) {
@@ -14,12 +14,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.isLegacyExtMessage = exports.JsBridgeBase = void 0;
16
16
  /* eslint-disable @typescript-eslint/ban-ts-comment */
17
- const CrossEventEmitter_1 = require("./CrossEventEmitter");
18
17
  const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
19
18
  const isString_1 = __importDefault(require("lodash/isString"));
19
+ const CrossEventEmitter_1 = require("./CrossEventEmitter");
20
20
  const loggers_1 = require("./loggers");
21
- const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
22
21
  const cross_inpage_provider_errors_1 = require("@onekeyfe/cross-inpage-provider-errors");
22
+ const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
23
23
  const versionInfo_1 = __importDefault(require("./versionInfo"));
24
24
  function toPlainError(errorInfo) {
25
25
  return {
@@ -31,6 +31,7 @@ function toPlainError(errorInfo) {
31
31
  key: errorInfo.key,
32
32
  info: errorInfo.info,
33
33
  className: errorInfo.className,
34
+ autoToast: errorInfo.autoToast,
34
35
  };
35
36
  }
36
37
  function isLegacyExtMessage(payload) {
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  * This is the web browser implementation of `debug()`.
19
19
  */
20
20
  const consts_1 = require("../consts");
21
+ const lodash_1 = require("lodash");
21
22
  const ms_1 = __importDefault(require("ms"));
22
23
  const storageKey = consts_1.DEBUG_LOGGER_STORAGE_KEY;
23
24
  const exportsBrowser = {};
@@ -222,7 +223,12 @@ function save(namespaces) {
222
223
  yield exportsBrowser.storage.setItem(storageKey, namespaces);
223
224
  }
224
225
  else {
225
- yield exportsBrowser.storage.removeItem(storageKey);
226
+ if ((0, lodash_1.isNil)(namespaces)) {
227
+ yield exportsBrowser.storage.removeItem(storageKey);
228
+ }
229
+ else {
230
+ yield exportsBrowser.storage.setItem(storageKey, '');
231
+ }
226
232
  }
227
233
  }
228
234
  catch (error) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const version = '1.1.43';
3
+ const version = '1.1.44';
4
4
  const versionBuild = '2020-0101-1';
5
5
  exports.default = {
6
6
  version,
@@ -13,6 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  * This is the web browser implementation of `debug()`.
14
14
  */
15
15
  import { DEBUG_LOGGER_STORAGE_KEY } from '../consts';
16
+ import { isNil } from 'lodash';
16
17
  import humanize from 'ms';
17
18
  const storageKey = DEBUG_LOGGER_STORAGE_KEY;
18
19
  const exportsBrowser = {};
@@ -217,7 +218,12 @@ function save(namespaces) {
217
218
  yield exportsBrowser.storage.setItem(storageKey, namespaces);
218
219
  }
219
220
  else {
220
- yield exportsBrowser.storage.removeItem(storageKey);
221
+ if (isNil(namespaces)) {
222
+ yield exportsBrowser.storage.removeItem(storageKey);
223
+ }
224
+ else {
225
+ yield exportsBrowser.storage.setItem(storageKey, '');
226
+ }
221
227
  }
222
228
  }
223
229
  catch (error) {
@@ -1,4 +1,4 @@
1
- const version = '1.1.43';
1
+ const version = '1.1.44';
2
2
  const versionBuild = '2020-0101-1';
3
3
  export default {
4
4
  version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/cross-inpage-provider-core",
3
- "version": "1.1.43",
3
+ "version": "1.1.44",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -29,12 +29,12 @@
29
29
  "build-version-info": "node ./scripts/buildVersionInfo.js"
30
30
  },
31
31
  "dependencies": {
32
- "@onekeyfe/cross-inpage-provider-errors": "1.1.43",
33
- "@onekeyfe/cross-inpage-provider-events": "1.1.43",
34
- "@onekeyfe/cross-inpage-provider-types": "1.1.43",
32
+ "@onekeyfe/cross-inpage-provider-errors": "1.1.44",
33
+ "@onekeyfe/cross-inpage-provider-events": "1.1.44",
34
+ "@onekeyfe/cross-inpage-provider-types": "1.1.44",
35
35
  "events": "^3.3.0",
36
36
  "lodash": "^4.17.21",
37
37
  "ms": "^2.1.3"
38
38
  },
39
- "gitHead": "9be95a09209e5dce1aa2af3847f6f8c48d226624"
39
+ "gitHead": "a6b373f9438503447b69f35c407add9d7df9fb35"
40
40
  }