@ocap/message 1.30.2 → 1.30.3

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/esm/provider.mjs CHANGED
@@ -3,8 +3,10 @@ const providers = [];
3
3
  const enums = {};
4
4
  const messages = {};
5
5
  function getMessageType(type) {
6
- const provider = providers.find((x) => x.getMessageType(type).fn);
7
- if (provider) return provider.getMessageType(type);
6
+ const withFn = providers.find((x) => x.getMessageType(type).fn);
7
+ if (withFn) return withFn.getMessageType(type);
8
+ const withFields = providers.find((x) => x.getMessageType(type).fields);
9
+ if (withFields) return withFields.getMessageType(type);
8
10
  return {};
9
11
  }
10
12
  function toTypeUrl(type) {
package/lib/provider.cjs CHANGED
@@ -4,8 +4,10 @@ const providers = [];
4
4
  const enums = {};
5
5
  const messages = {};
6
6
  function getMessageType(type) {
7
- const provider = providers.find((x) => x.getMessageType(type).fn);
8
- if (provider) return provider.getMessageType(type);
7
+ const withFn = providers.find((x) => x.getMessageType(type).fn);
8
+ if (withFn) return withFn.getMessageType(type);
9
+ const withFields = providers.find((x) => x.getMessageType(type).fields);
10
+ if (withFields) return withFields.getMessageType(type);
9
11
  return {};
10
12
  }
11
13
  function toTypeUrl(type) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ocap/message",
3
3
  "description": "Utility functions to encode and decode message that can send to forge",
4
- "version": "1.30.2",
4
+ "version": "1.30.3",
5
5
  "author": {
6
6
  "name": "wangshijun",
7
7
  "email": "shijun@arcblock.io",
@@ -18,8 +18,8 @@
18
18
  "access": "public"
19
19
  },
20
20
  "dependencies": {
21
- "@ocap/proto": "1.30.2",
22
- "@ocap/util": "1.30.2",
21
+ "@ocap/proto": "1.30.3",
22
+ "@ocap/util": "1.30.3",
23
23
  "debug": "^4.4.3",
24
24
  "google-protobuf": "3.21.0",
25
25
  "lodash": "^4.17.23"