@verii/common-fetchers 1.1.0-pre.1757916914 → 1.1.0-pre.1758002630

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verii/common-fetchers",
3
- "version": "1.1.0-pre.1757916914",
3
+ "version": "1.1.0-pre.1758002630",
4
4
  "description": "Set of fetchers used by Velocity Network servers",
5
5
  "repository": "https://github.com/LFDT-Verii/core",
6
6
  "main": "src/index.js",
@@ -36,5 +36,5 @@
36
36
  "lib"
37
37
  ]
38
38
  },
39
- "gitHead": "a44ef43958d01da618eb52394f20c1d5c7b8fdd6"
39
+ "gitHead": "b961d761dc0f0710df506d90222145afe3c35cf6"
40
40
  }
package/src/fetch-json.js CHANGED
@@ -1,4 +1,8 @@
1
- const fetchJson = async (link, { fetch }) => fetch.get(link, {}).json();
1
+ const fetchJson = async (link, { fetch }) => {
2
+ const response = await fetch.get(link, {});
3
+
4
+ return response.json();
5
+ };
2
6
 
3
7
  module.exports = {
4
8
  fetchJson,
@@ -33,10 +33,12 @@ const getCredentialTypeDescriptor = async (
33
33
  const response = await registrarFetch.get(path, options);
34
34
  return response.json();
35
35
  }
36
- return await registrarFetch.get(path, options).json();
36
+ const response = await registrarFetch(path, options);
37
+
38
+ return await response.json();
37
39
  } catch (e) {
38
40
  // ignore the 404s for particular types and return a basic version.
39
- if (e.response?.statusCode === 404) {
41
+ if (e.response?.statusCode ?? e.statusCode === 404) {
40
42
  return {
41
43
  id: type,
42
44
  name: type,
@@ -34,7 +34,8 @@ const getCredentialTypeMetadata = async (
34
34
  const response = await registrarFetch.get(path, options);
35
35
  return response.json();
36
36
  }
37
- return registrarFetch.get(path, options).json();
37
+ const response = await registrarFetch.get(path, options);
38
+ return response.json();
38
39
  };
39
40
 
40
41
  module.exports = { getCredentialTypeMetadata };