@nevermined-io/core-kit 0.0.50 → 0.0.51

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AgentUtils.d.ts","sourceRoot":"","sources":["../../../src/nevermined/utils/AgentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,WAAW,EAAE,EAC7B,kBAAkB,GAAE,MAAM,EAAO,GAChC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,GAAG,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAoChE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAOvE"}
1
+ {"version":3,"file":"AgentUtils.d.ts","sourceRoot":"","sources":["../../../src/nevermined/utils/AgentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,WAAW,EAAE,EAC7B,kBAAkB,GAAE,MAAM,EAAO,GAChC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,GAAG,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAqChE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAOvE"}
@@ -6,17 +6,18 @@ export function isEndpointRequestedIncluded(requestEndpoint, requestedHTTPVerb,
6
6
  let urlMatching, verbMatching;
7
7
  const requestedUrl = new URL(requestEndpoint);
8
8
  // Is the endpoint an open endpoint?
9
- agentOpenEndpoints.forEach((openEndpoint) => {
9
+ for (const openEndpoint of agentOpenEndpoints) {
10
10
  const agentUrl = new URL(openEndpoint);
11
11
  if (areUrlsEqualIgnoringQuery(agentUrl, requestedUrl)) {
12
12
  urlMatching = new URL(openEndpoint);
13
13
  matches = true;
14
+ break;
14
15
  }
15
- });
16
+ }
16
17
  if (matches)
17
18
  return { matches: true, urlMatching };
18
19
  // check if the endpoint/verb is part of the list
19
- agentEndpoints.forEach((ep) => {
20
+ for (const ep of agentEndpoints) {
20
21
  const [verb, url] = Object.entries(ep)[0];
21
22
  const _url = new URL(url);
22
23
  const fn = match(_url.pathname, { decode: decodeURIComponent });
@@ -24,9 +25,9 @@ export function isEndpointRequestedIncluded(requestEndpoint, requestedHTTPVerb,
24
25
  matches = true;
25
26
  urlMatching = _url;
26
27
  verbMatching = verb;
27
- return;
28
+ break;
28
29
  }
29
- });
30
+ }
30
31
  return { matches, urlMatching, verbMatching };
31
32
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevermined-io/core-kit",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",