imt-bridge-api-client-ts 0.0.29 → 0.0.30

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/dist/BridgeApi.js CHANGED
@@ -44,7 +44,7 @@ window.resolveAsyncPromise = (id, result) => {
44
44
  return;
45
45
  }
46
46
  const { resolve } = promiseMap.get(id);
47
- const jsonResult = JSON.parse(JSON.stringify(result));
47
+ const jsonResult = typeof result === 'string' ? JSON.parse(result) : result;
48
48
  console.log(`Resolving promise with ID ${id} with response result:`, jsonResult);
49
49
  resolve(jsonResult);
50
50
  promiseMap.delete(id);
@@ -55,7 +55,7 @@ window.rejectAsyncPromise = (id, error) => {
55
55
  return;
56
56
  }
57
57
  const { reject } = promiseMap.get(id);
58
- const errorJson = JSON.parse(JSON.stringify(error));
58
+ const errorJson = typeof error === 'string' ? JSON.parse(error) : error;
59
59
  console.error(`Rejecting promise with ID ${id} with response error:`, errorJson);
60
60
  reject(errorJson);
61
61
  promiseMap.delete(id);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "imt-bridge-api-client-ts",
3
3
  "private": false,
4
- "version": "0.0.29",
4
+ "version": "0.0.30",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",