config2ts 2.3.0 → 2.3.2

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.
@@ -5,6 +5,5 @@ export declare const Convert: {
5
5
  };
6
6
  export declare function GetTsString(filePath: any): any;
7
7
  export declare function GetTsStringFromFileList(fileList: any): any;
8
- export declare function GetHeaderInfo(): string;
9
8
  export declare function GetValidFileList(fileList: any): any;
10
- export declare function startConvert(dir: string, outDir: string, merge: boolean): void;
9
+ export declare function startConvert(dir: string, outDir: string, merge: string | null): void;
package/lib/config2ts.js CHANGED
@@ -3,16 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Convert = void 0;
4
4
  exports.GetTsString = GetTsString;
5
5
  exports.GetTsStringFromFileList = GetTsStringFromFileList;
6
- exports.GetHeaderInfo = GetHeaderInfo;
7
6
  exports.GetValidFileList = GetValidFileList;
8
7
  exports.startConvert = startConvert;
9
8
  var path = require("path");
10
9
  var fs = require("fs");
11
- var d3 = require("d3");
10
+ var d3_dsv_1 = require("d3-dsv");
12
11
  var json5 = require("json5");
13
12
  var changeCase = require("change-case");
14
- var toml = require('toml');
15
- var packageJson = require('../package.json');
13
+ var toml = require("toml");
16
14
  var EnumStr = 'Enum';
17
15
  var EnumIndexStr = 'EnumIndex';
18
16
  var EnumArrayString = 'Enum[]';
@@ -32,7 +30,7 @@ exports.Convert = {
32
30
  };
33
31
  function csv2ts(csvString, moduleName) {
34
32
  var convert = {};
35
- var result = d3.csvParse(csvString, function (d, i) {
33
+ var result = (0, d3_dsv_1.csvParse)(csvString, function (d, i) {
36
34
  if (i === 0) {
37
35
  convert = d;
38
36
  return null;
@@ -192,11 +190,6 @@ function GetTsStringFromFileList(fileList) {
192
190
  return GetTsString(filePath);
193
191
  }).join('\n\n');
194
192
  }
195
- function GetHeaderInfo() {
196
- var header = "export let config2ts_version = \"".concat(packageJson.version, "\";\n\n");
197
- header += "export let config2ts_build_timestamp = ".concat(Date.now().toString(), ";\n\n");
198
- return header;
199
- }
200
193
  function GetValidFileList(fileList) {
201
194
  return fileList.filter(function (filePath) {
202
195
  return exports.Convert[GetFileExt(filePath)] != null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "config2ts",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "convert config to ts file.",
5
5
  "main": "lib/config2ts.js",
6
6
  "types": "lib/config2ts.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "change-case": "^4.1.2",
32
32
  "commander": "^9.5.0",
33
- "d3": "^4.12.2",
33
+ "d3-dsv": "^3.0.1",
34
34
  "ini": "^3.0.1",
35
35
  "json5": "^2.2.3",
36
36
  "toml": "^3.0.0"