1
+ import { getOutputExtension } from '../../../lib/plugin/utils/plugin-utils' ;
2
+
1
3
export const parameterPropertyDtoText = `
2
4
export class ParameterPropertyDto {
3
5
constructor(
4
- readonly readonlyValue?: string,
5
- private privateValue: string | null,
6
- public publicValue: ItemDto[],
6
+ readonly readonlyValue?: string,
7
+ private privateValue: string | null,
8
+ public publicValue: ItemDto[],
7
9
regularParameter: string
8
- protected protectedValue: string = '1234',
10
+ protected protectedValue: string = '1234',
9
11
) {}
10
12
}
11
13
@@ -20,7 +22,13 @@ export class ItemDto {
20
22
}
21
23
` ;
22
24
23
- export const parameterPropertyDtoTextTranspiled = `import * as openapi from "@nestjs/swagger";
25
+ export const parameterPropertyDtoTextTranspiled = ( esmCompatible ?: boolean ) => {
26
+ let fileName = 'parameter-property.dto' ;
27
+ if ( esmCompatible ) {
28
+ fileName += getOutputExtension ( fileName ) ;
29
+ }
30
+
31
+ return `import * as openapi from "@nestjs/swagger";
24
32
export class ParameterPropertyDto {
25
33
constructor(readonlyValue, privateValue, publicValue, regularParameter, protectedValue = '1234') {
26
34
this.readonlyValue = readonlyValue;
@@ -29,7 +37,7 @@ export class ParameterPropertyDto {
29
37
this.protectedValue = protectedValue;
30
38
}
31
39
static _OPENAPI_METADATA_FACTORY() {
32
- return { readonlyValue: { required: false, type: () => String }, privateValue: { required: true, type: () => String, nullable: true }, publicValue: { required: true, type: () => [require("./parameter-property.dto ").ItemDto] }, protectedValue: { required: true, type: () => String, default: "1234" } };
40
+ return { readonlyValue: { required: false, type: () => String }, privateValue: { required: true, type: () => String, nullable: true }, publicValue: { required: true, type: () => [require("./${ fileName } ").ItemDto] }, protectedValue: { required: true, type: () => String, default: "1234" } };
33
41
}
34
42
}
35
43
export var LettersEnum;
@@ -43,7 +51,8 @@ export class ItemDto {
43
51
this.enumValue = enumValue;
44
52
}
45
53
static _OPENAPI_METADATA_FACTORY() {
46
- return { enumValue: { required: true, enum: require("./parameter-property.dto ").LettersEnum } };
54
+ return { enumValue: { required: true, enum: require("./${ fileName } ").LettersEnum } };
47
55
}
48
56
}
49
57
` ;
58
+ } ;
0 commit comments