openapi-gen-typescript
Advanced tools
Comparing version 0.4.4 to 0.4.6
@@ -19,2 +19,3 @@ "use strict"; | ||
const constants_1 = require("../constants"); | ||
const hasRefRegex = /.+\??\:\s+schemas\..+;/; | ||
const writeFileFromIFileCode = (props) => __awaiter(void 0, void 0, void 0, function* () { | ||
@@ -39,3 +40,5 @@ const { outputDir, fileCodeList, fetchModuleFile, schemasClassCode, schemasTypesCode, pathsCode, } = props; | ||
.join('/'), | ||
schemasClassCode.length > 0 ? `import * as schemas from '../schemas';\n` : '\n', | ||
schemasClassCode.length > 0 && hasRefRegex.test(el.code) | ||
? `import * as schemas from '../schemas';\n` | ||
: '\n', | ||
el.code, | ||
@@ -42,0 +45,0 @@ ].join('\n'); |
{ | ||
"name": "openapi-gen-typescript", | ||
"version": "0.4.4", | ||
"version": "0.4.6", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -18,2 +18,4 @@ // @ts-ignore | ||
const hasRefRegex = /.+\??\:\s+schemas\..+;/; | ||
export const writeFileFromIFileCode = async (props: IProps) => { | ||
@@ -47,3 +49,5 @@ const { | ||
.join('/'), | ||
schemasClassCode.length > 0 ? `import * as schemas from '../schemas';\n` : '\n', | ||
schemasClassCode.length > 0 && hasRefRegex.test(el.code) | ||
? `import * as schemas from '../schemas';\n` | ||
: '\n', | ||
el.code, | ||
@@ -50,0 +54,0 @@ ].join('\n'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92551
2171