godprotocol 2.3.23 → 2.3.24

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server/Utils_.js +21 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godprotocol",
3
- "version": "2.3.23",
3
+ "version": "2.3.24",
4
4
  "description": "A distributed computing environment for Web 4.0 — integrating AI, decentralisation, and virtual computation.",
5
5
  "main": "Index.js",
6
6
  "type": "module",
package/server/Utils_.js CHANGED
@@ -1,18 +1,28 @@
1
1
  class Utils {
2
- validateService = (name, service) => {
3
- if (!service) {
4
- console.error(`Service "${name}" is missing.`);
5
- return;
6
- }
2
+ validateService = (names, services) => {
3
+ let hasErrors = false;
7
4
 
8
- const hasUrlOrLocal = Boolean(service.url || service.local);
9
- const hasUri = Boolean(service.uri);
5
+ for (const name of names) {
6
+ const service = services[name];
10
7
 
11
- if (!hasUrlOrLocal || !hasUri) {
12
- console.error(
13
- `Service "${name}" must provide both (url or local) and uri properties.`,
14
- );
8
+ if (!service) {
9
+ console.error(`Service "${name}" is missing.`);
10
+ hasErrors = true;
11
+ continue;
12
+ }
13
+
14
+ const hasUrlOrLocal = Boolean(service.url || service.local);
15
+ const hasUri = Boolean(service.uri);
16
+
17
+ if (!hasUrlOrLocal || !hasUri) {
18
+ console.error(
19
+ `Service "${name}" must provide both (url or local) and uri properties.`,
20
+ );
21
+ hasErrors = true;
22
+ }
15
23
  }
24
+
25
+ return !hasErrors;
16
26
  };
17
27
 
18
28
  validateRouter = (name, services_config) => {