@nestia/sdk 2.4.2 → 2.4.3
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/lib/NestiaSdkApplication.js +2 -6
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/analyses/AccessorAnalyzer.js.map +1 -1
- package/lib/analyses/ConfigAnalyzer.js +4 -8
- package/lib/analyses/ConfigAnalyzer.js.map +1 -1
- package/lib/analyses/ControllerAnalyzer.js +6 -8
- package/lib/analyses/ControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ExceptionAnalyzer.js.map +1 -1
- package/lib/analyses/GenericAnalyzer.js +1 -2
- package/lib/analyses/GenericAnalyzer.js.map +1 -1
- package/lib/analyses/ImportAnalyzer.js +4 -4
- package/lib/analyses/ImportAnalyzer.js.map +1 -1
- package/lib/analyses/PathAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectAnalyzer.js +7 -8
- package/lib/analyses/ReflectAnalyzer.js.map +1 -1
- package/lib/analyses/SecurityAnalyzer.js.map +1 -1
- package/lib/executable/internal/CommandParser.js.map +1 -1
- package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
- package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
- package/lib/executable/sdk.js +11 -11
- package/lib/executable/sdk.js.map +1 -1
- package/lib/generates/E2eGenerator.js.map +1 -1
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.js +5 -11
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/E2eFileProgrammer.js +2 -8
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
- package/lib/generates/internal/SdkDtoGenerator.js +3 -9
- package/lib/generates/internal/SdkDtoGenerator.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.js +4 -4
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkFunctionProgrammer.js +12 -20
- package/lib/generates/internal/SdkFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkImportWizard.js.map +1 -1
- package/lib/generates/internal/SdkRouteDirectory.js +1 -3
- package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
- package/lib/generates/internal/SdkSimulationProgrammer.js +5 -7
- package/lib/generates/internal/SdkSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkTypeDefiner.js +2 -5
- package/lib/generates/internal/SdkTypeDefiner.js.map +1 -1
- package/lib/generates/internal/SwaggerSchemaGenerator.js +29 -44
- package/lib/generates/internal/SwaggerSchemaGenerator.js.map +1 -1
- package/lib/generates/internal/SwaggerSchemaValidator.js +3 -9
- package/lib/generates/internal/SwaggerSchemaValidator.js.map +1 -1
- package/lib/structures/MethodType.js +1 -7
- package/lib/structures/MethodType.js.map +1 -1
- package/lib/structures/TypeEntry.js.map +1 -1
- package/lib/utils/ArrayUtil.js.map +1 -1
- package/lib/utils/FileRetriever.js.map +1 -1
- package/lib/utils/ImportDictionary.js +1 -4
- package/lib/utils/ImportDictionary.js.map +1 -1
- package/lib/utils/MapUtil.js.map +1 -1
- package/lib/utils/PathUtil.js.map +1 -1
- package/lib/utils/SourceFinder.js.map +1 -1
- package/package.json +4 -7
- package/src/INestiaConfig.ts +234 -234
- package/src/NestiaSdkApplication.ts +253 -268
- package/src/analyses/AccessorAnalyzer.ts +60 -60
- package/src/analyses/ConfigAnalyzer.ts +147 -164
- package/src/analyses/ControllerAnalyzer.ts +379 -399
- package/src/analyses/ExceptionAnalyzer.ts +115 -124
- package/src/analyses/GenericAnalyzer.ts +51 -57
- package/src/analyses/ImportAnalyzer.ts +138 -159
- package/src/analyses/PathAnalyzer.ts +98 -100
- package/src/analyses/ReflectAnalyzer.ts +425 -433
- package/src/analyses/SecurityAnalyzer.ts +20 -20
- package/src/executable/internal/CommandParser.ts +15 -15
- package/src/executable/internal/NestiaConfigLoader.ts +67 -68
- package/src/executable/internal/NestiaSdkCommand.ts +60 -64
- package/src/executable/sdk.ts +73 -73
- package/src/generates/E2eGenerator.ts +64 -67
- package/src/generates/SdkGenerator.ts +96 -100
- package/src/generates/SwaggerGenerator.ts +372 -410
- package/src/generates/internal/E2eFileProgrammer.ts +123 -129
- package/src/generates/internal/SdkDistributionComposer.ts +91 -91
- package/src/generates/internal/SdkDtoGenerator.ts +424 -450
- package/src/generates/internal/SdkFileProgrammer.ts +106 -111
- package/src/generates/internal/SdkFunctionProgrammer.ts +466 -501
- package/src/generates/internal/SdkImportWizard.ts +55 -55
- package/src/generates/internal/SdkRouteDirectory.ts +17 -19
- package/src/generates/internal/SdkSimulationProgrammer.ts +133 -142
- package/src/generates/internal/SdkTypeDefiner.ts +119 -124
- package/src/generates/internal/SwaggerSchemaGenerator.ts +382 -401
- package/src/generates/internal/SwaggerSchemaValidator.ts +198 -210
- package/src/index.ts +4 -4
- package/src/module.ts +2 -2
- package/src/structures/IController.ts +79 -81
- package/src/structures/IErrorReport.ts +6 -6
- package/src/structures/INestiaProject.ts +13 -13
- package/src/structures/INormalizedInput.ts +20 -20
- package/src/structures/IRoute.ts +40 -41
- package/src/structures/ISwagger.ts +91 -91
- package/src/structures/ISwaggerComponents.ts +29 -29
- package/src/structures/ISwaggerError.ts +8 -8
- package/src/structures/ISwaggerInfo.ts +80 -80
- package/src/structures/ISwaggerLazyProperty.ts +7 -7
- package/src/structures/ISwaggerLazySchema.ts +7 -7
- package/src/structures/ISwaggerRoute.ts +51 -51
- package/src/structures/ISwaggerSecurityScheme.ts +65 -65
- package/src/structures/ITypeTuple.ts +6 -6
- package/src/structures/MethodType.ts +5 -11
- package/src/structures/ParamCategory.ts +1 -1
- package/src/structures/TypeEntry.ts +22 -22
- package/src/utils/ArrayUtil.ts +26 -26
- package/src/utils/FileRetriever.ts +22 -22
- package/src/utils/ImportDictionary.ts +125 -128
- package/src/utils/MapUtil.ts +14 -14
- package/src/utils/PathUtil.ts +10 -10
- package/src/utils/SourceFinder.ts +66 -70
- package/src/utils/StripEnums.ts +5 -10
|
@@ -1,128 +1,125 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { HashMap } from "tstl/container/HashMap";
|
|
3
|
-
import { HashSet } from "tstl/container/HashSet";
|
|
4
|
-
import { Pair } from "tstl/utility/Pair";
|
|
5
|
-
|
|
6
|
-
export class ImportDictionary {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const NODE_MODULES = "node_modules/";
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { HashMap } from "tstl/container/HashMap";
|
|
3
|
+
import { HashSet } from "tstl/container/HashSet";
|
|
4
|
+
import { Pair } from "tstl/utility/Pair";
|
|
5
|
+
|
|
6
|
+
export class ImportDictionary {
|
|
7
|
+
private readonly components_: HashMap<Pair<string, boolean>, IComposition> =
|
|
8
|
+
new HashMap();
|
|
9
|
+
|
|
10
|
+
public constructor(public readonly file: string) {}
|
|
11
|
+
|
|
12
|
+
public empty(): boolean {
|
|
13
|
+
return this.components_.empty();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public external(props: ImportDictionary.IExternalProps): string {
|
|
17
|
+
const composition: IComposition = this.components_.take(
|
|
18
|
+
new Pair(props.library, props.type),
|
|
19
|
+
() => ({
|
|
20
|
+
location: `node_modules/${props.library}`,
|
|
21
|
+
elements: new HashSet(),
|
|
22
|
+
default: false,
|
|
23
|
+
type: props.type,
|
|
24
|
+
}),
|
|
25
|
+
);
|
|
26
|
+
if (props.instance === null) composition.default = true;
|
|
27
|
+
else composition.elements.insert(props.instance);
|
|
28
|
+
return props.instance ?? props.library;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public internal(props: ImportDictionary.IInternalProps): string {
|
|
32
|
+
const file: string = (() => {
|
|
33
|
+
if (props.file.substring(props.file.length - 5) === ".d.ts")
|
|
34
|
+
return props.file.substring(0, props.file.length - 5);
|
|
35
|
+
else if (props.file.substring(props.file.length - 3) === ".ts")
|
|
36
|
+
return props.file.substring(0, props.file.length - 3);
|
|
37
|
+
return props.file;
|
|
38
|
+
})();
|
|
39
|
+
const composition: IComposition = this.components_.take(
|
|
40
|
+
new Pair(file, props.type),
|
|
41
|
+
() => ({
|
|
42
|
+
location: file,
|
|
43
|
+
elements: new HashSet(),
|
|
44
|
+
default: false,
|
|
45
|
+
type: props.type,
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
if (props.instance === null) {
|
|
49
|
+
composition.default = true;
|
|
50
|
+
if (props.name) composition.name = props.name;
|
|
51
|
+
} else composition.elements.insert(props.instance);
|
|
52
|
+
return props.instance ?? file;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public toScript(outDir: string): string {
|
|
56
|
+
const external: string[] = [];
|
|
57
|
+
const internal: string[] = [];
|
|
58
|
+
|
|
59
|
+
const locator = (str: string) => {
|
|
60
|
+
const location: string = path.relative(outDir, str).split("\\").join("/");
|
|
61
|
+
const index: number = location.lastIndexOf(NODE_MODULES);
|
|
62
|
+
return index === -1
|
|
63
|
+
? location.startsWith("..")
|
|
64
|
+
? location
|
|
65
|
+
: `./${location}`
|
|
66
|
+
: location.substring(index + NODE_MODULES.length);
|
|
67
|
+
};
|
|
68
|
+
const enroll =
|
|
69
|
+
(filter: (str: string) => boolean) => (container: string[]) => {
|
|
70
|
+
const compositions: IComposition[] = this.components_
|
|
71
|
+
.toJSON()
|
|
72
|
+
.filter((c) => filter(c.second.location))
|
|
73
|
+
.map((e) => ({
|
|
74
|
+
...e.second,
|
|
75
|
+
location: locator(e.second.location),
|
|
76
|
+
}))
|
|
77
|
+
.sort((a, b) => a.location.localeCompare(b.location));
|
|
78
|
+
for (const c of compositions) {
|
|
79
|
+
const brackets: string[] = [];
|
|
80
|
+
if (c.default) brackets.push(c.name ?? c.location);
|
|
81
|
+
if (c.elements.empty() === false)
|
|
82
|
+
brackets.push(
|
|
83
|
+
`{ ${c.elements
|
|
84
|
+
.toJSON()
|
|
85
|
+
.sort((a, b) => a.localeCompare(b))
|
|
86
|
+
.join(", ")} }`,
|
|
87
|
+
);
|
|
88
|
+
container.push(
|
|
89
|
+
`import ${c.type ? "type " : ""}${brackets.join(", ")} from "${
|
|
90
|
+
c.location
|
|
91
|
+
}";`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
enroll((str) => str.indexOf(NODE_MODULES) !== -1)(external);
|
|
97
|
+
enroll((str) => str.indexOf(NODE_MODULES) === -1)(internal);
|
|
98
|
+
|
|
99
|
+
if (external.length && internal.length) external.push("");
|
|
100
|
+
return [...external, ...internal].join("\n");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export namespace ImportDictionary {
|
|
104
|
+
export interface IExternalProps {
|
|
105
|
+
type: boolean;
|
|
106
|
+
library: string;
|
|
107
|
+
instance: string | null;
|
|
108
|
+
}
|
|
109
|
+
export interface IInternalProps {
|
|
110
|
+
type: boolean;
|
|
111
|
+
file: string;
|
|
112
|
+
instance: string | null;
|
|
113
|
+
name?: string | null;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
interface IComposition {
|
|
118
|
+
location: string;
|
|
119
|
+
type: boolean;
|
|
120
|
+
default: boolean;
|
|
121
|
+
name?: string;
|
|
122
|
+
elements: HashSet<string>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const NODE_MODULES = "node_modules/";
|
package/src/utils/MapUtil.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export namespace MapUtil {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
1
|
+
export namespace MapUtil {
|
|
2
|
+
export function take<Key, T>(
|
|
3
|
+
dict: Map<Key, T>,
|
|
4
|
+
key: Key,
|
|
5
|
+
generator: () => T,
|
|
6
|
+
): T {
|
|
7
|
+
const oldbie: T | undefined = dict.get(key);
|
|
8
|
+
if (oldbie) return oldbie;
|
|
9
|
+
|
|
10
|
+
const value: T = generator();
|
|
11
|
+
dict.set(key, value);
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/src/utils/PathUtil.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export namespace PathUtil {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
export namespace PathUtil {
|
|
2
|
+
export const accessors = (path: string) =>
|
|
3
|
+
path
|
|
4
|
+
.split("/")
|
|
5
|
+
.filter((str) => str.length && str[0] !== ":")
|
|
6
|
+
.map(normalize);
|
|
7
|
+
|
|
8
|
+
const normalize = (str: string) =>
|
|
9
|
+
str.split("-").join("_").split(".").join("_");
|
|
10
|
+
}
|
|
@@ -1,70 +1,66 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import glob from "glob";
|
|
3
|
-
import path from "path";
|
|
4
|
-
|
|
5
|
-
export namespace SourceFinder {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
pattern.endsWith(".ts") &&
|
|
68
|
-
!pattern.endsWith(".d.ts") &&
|
|
69
|
-
fs.existsSync(pattern);
|
|
70
|
-
}
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import glob from "glob";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
export namespace SourceFinder {
|
|
6
|
+
interface IProps {
|
|
7
|
+
exclude?: string[];
|
|
8
|
+
include: string[];
|
|
9
|
+
filter: (location: string) => Promise<boolean>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const find = async (props: IProps): Promise<string[]> => {
|
|
13
|
+
const dict: Set<string> = new Set();
|
|
14
|
+
|
|
15
|
+
await emplace(props.filter)(props.include)((str) => dict.add(str));
|
|
16
|
+
if (props.exclude?.length)
|
|
17
|
+
await emplace(props.filter)(props.exclude)((str) => dict.delete(str));
|
|
18
|
+
|
|
19
|
+
return [...dict];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const emplace =
|
|
23
|
+
(filter: (file: string) => Promise<boolean>) =>
|
|
24
|
+
(input: string[]) =>
|
|
25
|
+
async (closure: (location: string) => void): Promise<void> => {
|
|
26
|
+
for (const pattern of input) {
|
|
27
|
+
if (_Is_file(pattern)) {
|
|
28
|
+
closure(path.resolve(pattern));
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
for (const file of await _Glob(pattern)) {
|
|
32
|
+
const stats: fs.Stats = await fs.promises.stat(file);
|
|
33
|
+
if (stats.isDirectory() === true)
|
|
34
|
+
await iterate(filter)(closure)(file);
|
|
35
|
+
else if (stats.isFile() && (await filter(file))) closure(file);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const iterate =
|
|
41
|
+
(filter: (location: string) => Promise<boolean>) =>
|
|
42
|
+
(closure: (location: string) => void) =>
|
|
43
|
+
async (location: string): Promise<void> => {
|
|
44
|
+
const directory: string[] = await fs.promises.readdir(location);
|
|
45
|
+
for (const file of directory) {
|
|
46
|
+
const next: string = path.resolve(`${location}/${file}`);
|
|
47
|
+
const stats: fs.Stats = await fs.promises.stat(next);
|
|
48
|
+
|
|
49
|
+
if (stats.isDirectory() === true) await iterate(filter)(closure)(next);
|
|
50
|
+
else if (stats.isFile() && (await filter(next))) closure(next);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const _Glob = (pattern: string): Promise<string[]> =>
|
|
55
|
+
new Promise((resolve, reject) => {
|
|
56
|
+
glob(pattern, (err, matches) => {
|
|
57
|
+
if (err) reject(err);
|
|
58
|
+
else resolve(matches.map((str) => path.resolve(str)));
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const _Is_file = (pattern: string): boolean =>
|
|
63
|
+
pattern.endsWith(".ts") &&
|
|
64
|
+
!pattern.endsWith(".d.ts") &&
|
|
65
|
+
fs.existsSync(pattern);
|
|
66
|
+
}
|
package/src/utils/StripEnums.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
export type StripEnums<T extends Record<string, any>> = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
| undefined
|
|
7
|
-
| any[]
|
|
8
|
-
? T[Key]
|
|
9
|
-
: any;
|
|
10
|
-
};
|
|
1
|
+
export type StripEnums<T extends Record<string, any>> = {
|
|
2
|
+
[Key in keyof T]: T[Key] extends string | boolean | object | undefined | any[]
|
|
3
|
+
? T[Key]
|
|
4
|
+
: any;
|
|
5
|
+
};
|