express-generator-typescript 2.5.0 → 2.5.1

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.
@@ -28,7 +28,7 @@ export class ValidationErr extends RouteError {
28
28
  public static MSG = 'The following parameter was missing or invalid.';
29
29
 
30
30
  public constructor(parameter: string, value?: unknown, moreInfo?: string) {
31
- const msgObj: Record<string, unknown> = {
31
+ const msgObj: IValidationErrFormat = {
32
32
  error: ValidationErr.MSG,
33
33
  parameter,
34
34
  value,
@@ -3,15 +3,15 @@ import UserService from '@src/services/UserService';
3
3
  import User from '@src/models/User';
4
4
  import { isNum, transform } from '@src/util/validators';
5
5
 
6
- import { reqParse, IReq, IRes } from './common';
6
+ import { parseReq, IReq, IRes } from './common';
7
7
 
8
8
 
9
9
  // **** Variables **** //
10
10
 
11
11
  const Validators = {
12
- add: reqParse({ user: User.test }),
13
- update: reqParse({ user: User.test }),
14
- delete: reqParse({ id: transform(Number, isNum) }),
12
+ add: parseReq({ user: User.test }),
13
+ update: parseReq({ user: User.test }),
14
+ delete: parseReq({ id: transform(Number, isNum) }),
15
15
  } as const;
16
16
 
17
17
 
@@ -16,14 +16,14 @@ export type IRes = Response<unknown, TObj>;
16
16
  /**
17
17
  * Parse a Request object property and throw a Validation error if it fails.
18
18
  */
19
- export function reqParse<U extends TSchema>(schema: U) {
20
- return parseObj<U>(schema, reqParseOnError);
19
+ export function parseReq<U extends TSchema>(schema: U) {
20
+ return parseObj<U>(schema, _parseReqOnError);
21
21
  }
22
22
 
23
23
  /**
24
24
  * Error handler for the request parse function above.
25
25
  */
26
- function reqParseOnError(
26
+ function _parseReqOnError(
27
27
  prop = 'undefined',
28
28
  value?: unknown,
29
29
  caughtErr?: unknown,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-generator-typescript",
3
- "version": "2.5.00",
3
+ "version": "2.5.1",
4
4
  "description": "Generate new Express applications similar to express-generate which but sets it up to use TypeScript instead",
5
5
  "scripts": {
6
6
  "express-generator-typescript": "node bin/cli.js",