express-generator-typescript 2.5.3 → 2.5.5
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.
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
// **** Types **** //
|
|
10
10
|
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
-
type TFunc = (...args: any[]) => any;
|
|
13
11
|
type TBasicObj = Record<string, unknown>;
|
|
14
12
|
type TEnum = Record<string, string | number>;
|
|
15
13
|
|
|
@@ -35,7 +33,7 @@ export const isObj = _checkType<object>('object');
|
|
|
35
33
|
// Misc
|
|
36
34
|
export const parseObj = <U extends TSchema>(arg: U, onError?: TParseOnError<false>) =>
|
|
37
35
|
_parseObj<U, false, false, false>(arg, false, false, false, onError);
|
|
38
|
-
export const isEnumVal = <T>(arg: T) =>
|
|
36
|
+
export const isEnumVal = <T>(arg: T) => _isEnumVal<T, false, false>(arg, false, false);
|
|
39
37
|
|
|
40
38
|
// Util
|
|
41
39
|
export const transform = _transform;
|
|
@@ -85,7 +83,7 @@ function _isEnum(arg: unknown): arg is TEnum {
|
|
|
85
83
|
/**
|
|
86
84
|
* Check is value satisfies enum.
|
|
87
85
|
*/
|
|
88
|
-
function
|
|
86
|
+
function _isEnumVal<T,
|
|
89
87
|
O extends boolean,
|
|
90
88
|
N extends boolean
|
|
91
89
|
>(
|
|
@@ -229,13 +227,13 @@ function _parseObj<
|
|
|
229
227
|
/**
|
|
230
228
|
* Validate the schema.
|
|
231
229
|
*/
|
|
232
|
-
function _parseObjCore(
|
|
230
|
+
function _parseObjCore<A>(
|
|
233
231
|
optional: boolean,
|
|
234
232
|
nullable: boolean,
|
|
235
|
-
isArr:
|
|
233
|
+
isArr: A,
|
|
236
234
|
schema: TSchema,
|
|
237
235
|
arg: unknown,
|
|
238
|
-
onError?:
|
|
236
|
+
onError?: TParseOnError<A>,
|
|
239
237
|
) {
|
|
240
238
|
// Check "undefined"
|
|
241
239
|
if (arg === undefined) {
|
|
@@ -272,9 +270,10 @@ function _parseObjCore(
|
|
|
272
270
|
}
|
|
273
271
|
}
|
|
274
272
|
return resp;
|
|
275
|
-
}
|
|
276
273
|
// Default
|
|
277
|
-
|
|
274
|
+
} else {
|
|
275
|
+
return _parseObjCoreHelper(schema, arg, onError as TParseOnError<false>);
|
|
276
|
+
}
|
|
278
277
|
}
|
|
279
278
|
|
|
280
279
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-generator-typescript",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.5",
|
|
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",
|