@snapshot-labs/snapshot.js 0.11.14 → 0.11.15

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.
@@ -399,11 +399,14 @@ var Client = /** @class */ (function () {
399
399
  return [2 /*return*/, new Promise(function (resolve, reject) {
400
400
  fetch__default['default'](address, init)
401
401
  .then(function (res) {
402
+ var _a;
402
403
  if (res.ok)
403
404
  return resolve(res.json());
405
+ if ((_a = res.headers.get('content-type')) === null || _a === void 0 ? void 0 : _a.includes('application/json'))
406
+ return res.json().then(reject).catch(reject);
404
407
  throw res;
405
408
  })
406
- .catch(function (e) { return reject(e); });
409
+ .catch(reject);
407
410
  })];
408
411
  });
409
412
  });
@@ -389,11 +389,14 @@ var Client = /** @class */ (function () {
389
389
  return [2 /*return*/, new Promise(function (resolve, reject) {
390
390
  fetch(address, init)
391
391
  .then(function (res) {
392
+ var _a;
392
393
  if (res.ok)
393
394
  return resolve(res.json());
395
+ if ((_a = res.headers.get('content-type')) === null || _a === void 0 ? void 0 : _a.includes('application/json'))
396
+ return res.json().then(reject).catch(reject);
394
397
  throw res;
395
398
  })
396
- .catch(function (e) { return reject(e); });
399
+ .catch(reject);
397
400
  })];
398
401
  });
399
402
  });