@quip/dts-bundle-generator
Advanced tools
Comparing version 6.2.0 to 6.2.1
@@ -1,2 +0,2 @@ | ||
// Generated by dts-bundle-generator v6.2.0 | ||
// Generated by dts-bundle-generator v6.2.1 | ||
@@ -47,2 +47,6 @@ export interface CompilationOptions { | ||
/** | ||
* Instead of declaring or preserving const enums, simply redefine them. | ||
*/ | ||
reDefineConstEnum?: boolean; | ||
/** | ||
* By default all interfaces, types and const enums are marked as exported even if they aren't exported directly. | ||
@@ -49,0 +53,0 @@ * This option allows you to disable this behavior so a node will be exported if it is exported from root source file only. |
@@ -1,2 +0,2 @@ | ||
// Generated by dts-bundle-generator v6.2.0 | ||
// Generated by dts-bundle-generator v6.2.1 | ||
@@ -47,2 +47,6 @@ export interface CompilationOptions { | ||
/** | ||
* Instead of declaring or preserving const enums, simply redefine them. | ||
*/ | ||
reDefineConstEnum?: boolean; | ||
/** | ||
* By default all interfaces, types and const enums are marked as exported even if they aren't exported directly. | ||
@@ -49,0 +53,0 @@ * This option allows you to disable this behavior so a node will be exported if it is exported from root source file only. |
@@ -58,2 +58,3 @@ "use strict"; | ||
respectPreserveConstEnum: check_schema_match_1.schemaPrimitiveValues.boolean, | ||
reDefineConstEnum: check_schema_match_1.schemaPrimitiveValues.boolean, | ||
exportReferencedTypes: check_schema_match_1.schemaPrimitiveValues.boolean, | ||
@@ -60,0 +61,0 @@ reExportAllDeclarations: check_schema_match_1.schemaPrimitiveValues.boolean, |
@@ -65,3 +65,3 @@ "use strict"; | ||
}) | ||
.map(function (statement) { return getStatementText(statement, params); }); | ||
.map(function (statement) { return getStatementText(statement, params, options); }); | ||
if (options.sortNodes) { | ||
@@ -77,5 +77,8 @@ statements.sort(compareStatementText); | ||
} | ||
// this is used to prevent importing non-exported nodes | ||
// see https://stackoverflow.com/questions/52583603/intentional-that-export-shuts-off-automatic-export-of-all-symbols-from-a-ty | ||
resultOutput += "\n\nexport {};\n"; | ||
if (!options.reExportAllDeclarations) { | ||
// this is used to prevent importing non-exported nodes | ||
// see https://stackoverflow.com/questions/52583603/intentional-that-export-shuts-off-automatic-export-of-all-symbols-from-a-ty | ||
// Behind `options.reExportAllDeclarations` check to reduce probable noise. | ||
resultOutput += "\n\nexport {};\n"; | ||
} | ||
return resultOutput; | ||
@@ -188,3 +191,7 @@ } | ||
} | ||
function getStatementText(statement, helpers) { | ||
function needStripDeclareKeyword(statement, options) { | ||
return ts.isEnumDeclaration(statement) && !!options.reDefineConstEnum; | ||
} | ||
// eslint-disable-next-line complexity | ||
function getStatementText(statement, helpers, options) { | ||
var shouldStatementHasExportKeyword = helpers.shouldStatementHasExportKeyword(statement); | ||
@@ -208,2 +215,10 @@ var needStripDefaultKeyword = helpers.needStripDefaultKeywordForStatement(statement); | ||
} | ||
if (needStripDeclareKeyword(statement, options)) { | ||
if (nodeText.startsWith('declare ')) { | ||
nodeText = nodeText.slice('declare '.length); | ||
} | ||
else if (nodeText.startsWith('export declare ')) { | ||
nodeText = 'export ' + nodeText.slice('export declare '.length); | ||
} | ||
} | ||
var result = { | ||
@@ -210,0 +225,0 @@ text: nodeText, |
{ | ||
"name": "@quip/dts-bundle-generator", | ||
"version": "6.2.0", | ||
"version": "6.2.1", | ||
"description": "DTS Bundle Generator (Quip)", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundle-generator.js", |
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
112906
2108