backendium 0.0.16 → 0.0.17

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/dist/request.js CHANGED
@@ -50,8 +50,7 @@ export default async function parseRequest(request, app, { bodyValidator, params
50
50
  };
51
51
  }
52
52
  catch (error) {
53
- if (error instanceof ParsingError)
54
- return error;
55
- throw error;
53
+ //if (error instanceof ParsingError) return error;
54
+ return error;
56
55
  }
57
56
  }
package/dist/ws.js CHANGED
@@ -12,6 +12,7 @@ export class BackendiumWebSocket {
12
12
  operations = new EventEmitter;
13
13
  useEvents = false;
14
14
  static rawDataParse(data) {
15
+ // @ts-ignore
15
16
  return data instanceof Buffer ? data : data instanceof ArrayBuffer ? Buffer.from(data) : data.reduce((prev, cur) => Buffer.concat([prev, cur]), Buffer.alloc(0));
16
17
  }
17
18
  parseEventHead(head, message, socket, app) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backendium",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "Express-based javascript backend framework with websocket support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  "chalk": "^5.3.0",
13
13
  "event-emitter-typescript": "^2.1.1",
14
14
  "express": "^4.21.0",
15
- "parsium": "^0.0.2",
15
+ "parsium": "^0.0.3",
16
16
  "websocket-express": "^3.1.1",
17
17
  "ws": "^8.18.0"
18
18
  },
@@ -26,4 +26,4 @@
26
26
  },
27
27
  "files": ["src", "dist", "package.json", "readme.md", "tsconfig.json"],
28
28
  "type": "module"
29
- }
29
+ }
package/src/request.ts CHANGED
@@ -88,7 +88,7 @@ export default async function parseRequest<BodyType, ParamsType, QueryType, Auth
88
88
  };
89
89
  }
90
90
  catch (error) {
91
- if (error instanceof ParsingError) return error;
92
- throw error;
91
+ //if (error instanceof ParsingError) return error;
92
+ return error as ParsingError;
93
93
  }
94
- }
94
+ }
package/src/ws.ts CHANGED
@@ -50,6 +50,7 @@ export class BackendiumWebSocket<InitDataType> {
50
50
  protected useEvents = false;
51
51
 
52
52
  public static rawDataParse(data: WebSocket.RawData): Buffer {
53
+ // @ts-ignore
53
54
  return data instanceof Buffer ? data : data instanceof ArrayBuffer ? Buffer.from(data) : data.reduce((prev, cur) => Buffer.concat([prev, cur]), Buffer.alloc(0));
54
55
  }
55
56