@hatchet-dev/typescript-sdk 0.7.2 → 0.8.0-alpha.0

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/util/parse.js CHANGED
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseJSON = void 0;
4
4
  function parseJSON(json) {
5
+ // TODO why is this needed?
6
+ if (json.startsWith('ey')) {
7
+ const decoded = Buffer.from(json, 'base64').toString('utf8');
8
+ return JSON.parse(decoded);
9
+ }
5
10
  try {
6
11
  const firstParse = JSON.parse(json);
7
12
  // Hatchet engine versions <=0.14.0 return JSON as a quoted string which needs to be parsed again.