@chainfuse/helpers 2.4.0 → 2.4.2

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/dist/net.mjs +26 -0
  2. package/package.json +2 -2
package/dist/net.mjs CHANGED
@@ -71,6 +71,30 @@ export class NetHelpers {
71
71
  .then(([{ Chalk }, { Helpers }]) => {
72
72
  const chalk = new Chalk({ level: 2 });
73
73
  loggingItems.splice(1, 1, chalk.rgb(...Helpers.uniqueIdColor(id))(`[${id}]`));
74
+ const initMethod = init?.method ?? 'GET';
75
+ /**
76
+ * @link https://github.com/swagger-api/swagger-ui/blob/master/src/style/_variables.scss#L48-L53
77
+ */
78
+ switch (initMethod) {
79
+ case 'POST':
80
+ loggingItems.splice(2, 1, chalk.hex('#49cc90')(initMethod));
81
+ break;
82
+ case 'GET':
83
+ loggingItems.splice(2, 1, chalk.hex('#61affe')(initMethod));
84
+ break;
85
+ case 'PUT':
86
+ loggingItems.splice(2, 1, chalk.hex('#fca130')(initMethod));
87
+ break;
88
+ case 'DELETE':
89
+ loggingItems.splice(2, 1, chalk.hex('#f93e3e')(initMethod));
90
+ break;
91
+ case 'HEAD':
92
+ loggingItems.splice(2, 1, chalk.hex('#9012fe')(initMethod));
93
+ break;
94
+ case 'PATCH':
95
+ loggingItems.splice(2, 1, chalk.hex('#50e3c2')(initMethod));
96
+ break;
97
+ }
74
98
  })
75
99
  // eslint-disable-next-line @typescript-eslint/no-empty-function
76
100
  .catch(() => { });
@@ -81,6 +105,7 @@ export class NetHelpers {
81
105
  }
82
106
  }
83
107
  else {
108
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
84
109
  await logger(...loggingItems);
85
110
  }
86
111
  return id;
@@ -114,6 +139,7 @@ export class NetHelpers {
114
139
  }
115
140
  }
116
141
  else {
142
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
117
143
  await logger(...loggingItems);
118
144
  }
119
145
  resolve(response);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainfuse/helpers",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "",
5
5
  "author": "ChainFuse",
6
6
  "homepage": "https://github.com/ChainFuse/packages/tree/main/packages/helpers#readme",
@@ -58,5 +58,5 @@
58
58
  "@cloudflare/workers-types": "^4.20250410.0",
59
59
  "@types/node": "^22.14.0"
60
60
  },
61
- "gitHead": "c480462d073b3d89c915eb003b0ba789fe79d414"
61
+ "gitHead": "f6da46cf1b8862c4607b7eb485f48125056907f9"
62
62
  }