@gravity-ui/gateway 2.5.2 → 2.5.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.
@@ -15,7 +15,12 @@ function decodeAnyMessageRecursively(root, message) {
15
15
  const type = root.lookupType(typeName);
16
16
  const data = type.toObject(type.decode(message.value), constants_1.DEFAULT_PROTO_LOADER_OPTIONS);
17
17
  Object.keys(data).forEach((key) => {
18
- data[key] = decodeAnyMessageRecursively(root, data[key]);
18
+ if (Array.isArray(data[key])) {
19
+ data[key] = data[key].map((item) => decodeAnyMessageRecursively(root, item));
20
+ }
21
+ else {
22
+ data[key] = decodeAnyMessageRecursively(root, data[key]);
23
+ }
19
24
  });
20
25
  return data;
21
26
  }
@@ -182,7 +182,7 @@ function parseGrpcError(error, packageRoot, lang = constants_1.Lang.Ru) {
182
182
  message: String(description || DEFAULT_GATEWAY_MESSAGE),
183
183
  code: DEFAULT_GATEWAY_CODE,
184
184
  details: Object.assign({ title,
185
- description, grpcCode: code }, details),
185
+ description, grpcCode: code }, (typeof details === 'object' && !Array.isArray(details) ? details : { details })),
186
186
  };
187
187
  }
188
188
  exports.parseGrpcError = parseGrpcError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/gateway",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "build/index.js",