definition-generator-framework 1.12.6 → 1.12.7

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.
@@ -30,8 +30,6 @@ const helpers_lib_1 = require("helpers-lib");
30
30
  const context_1 = require("../context");
31
31
  const START_COMMAND = '// ---- INDEX OUTPUT ----';
32
32
  const END_COMMAND = '// ---- END ----';
33
- const NEW_LINE_LENGTH = 2;
34
- const FILE_EXTENSION_LENGTH = 3;
35
33
  class IndexFileGenerator {
36
34
  static { this.premadeInterfaces = []; }
37
35
  static addPremadeInterface(value) {
@@ -70,7 +68,7 @@ class IndexFileGenerator {
70
68
  }
71
69
  static generateExportsContent() {
72
70
  return context_1.Context.exports
73
- .map(exportItem => `export { ${exportItem.variableName} } from '.${exportItem.path.substring(0, exportItem.path.length - FILE_EXTENSION_LENGTH)}';`)
71
+ .map(exportItem => `export { ${exportItem.variableName} } from '.${exportItem.path.substring(0, exportItem.path.lastIndexOf('.'))}';`)
74
72
  .join('\n');
75
73
  }
76
74
  static generateInterfacesContent(fileUrls) {
@@ -108,7 +106,7 @@ class IndexFileGenerator {
108
106
  if (endIndex === -1) {
109
107
  throw new Error(`No end command found.`);
110
108
  }
111
- contents.push(fileContent.substring(index + START_COMMAND.length + NEW_LINE_LENGTH, endIndex));
109
+ contents.push(fileContent.substring(fileContent.indexOf('\n', index + START_COMMAND.length) + 1, endIndex));
112
110
  index = fileContent.indexOf(START_COMMAND, endIndex);
113
111
  }
114
112
  if (definitionsFound) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "definition-generator-framework",
3
- "version": "1.12.6",
3
+ "version": "1.12.7",
4
4
  "description": "Definition Generator Framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",