config2ts 2.3.1 → 2.3.3

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.
Files changed (2) hide show
  1. package/lib/config2ts.js +6 -6
  2. package/package.json +4 -3
package/lib/config2ts.js CHANGED
@@ -7,7 +7,7 @@ exports.GetValidFileList = GetValidFileList;
7
7
  exports.startConvert = startConvert;
8
8
  var path = require("path");
9
9
  var fs = require("fs");
10
- var d3 = require("d3");
10
+ var d3_dsv_1 = require("d3-dsv");
11
11
  var json5 = require("json5");
12
12
  var changeCase = require("change-case");
13
13
  var toml = require("toml");
@@ -30,7 +30,7 @@ exports.Convert = {
30
30
  };
31
31
  function csv2ts(csvString, moduleName) {
32
32
  var convert = {};
33
- var result = d3.csvParse(csvString, function (d, i) {
33
+ var result = (0, d3_dsv_1.csvParse)(csvString, function (d, i) {
34
34
  if (i === 0) {
35
35
  convert = d;
36
36
  return null;
@@ -198,17 +198,17 @@ function GetValidFileList(fileList) {
198
198
  function startConvert(dir, outDir, merge) {
199
199
  var fileList = fs.readdirSync(dir);
200
200
  if (merge) {
201
- fileList = config2ts.GetValidFileList(fileList).map(function (filename) {
201
+ fileList = GetValidFileList(fileList).map(function (filename) {
202
202
  return path.join(dir, filename);
203
203
  });
204
204
  var mergeFile = path.join(outDir, merge);
205
- fs.writeFileSync(mergeFile, config2ts.GetTsStringFromFileList(fileList), { encoding: 'utf-8' });
205
+ fs.writeFileSync(mergeFile, GetTsStringFromFileList(fileList), { encoding: 'utf-8' });
206
206
  console.log("config2ts, ".concat(fileList.length, " config files, merge into: ").concat(mergeFile));
207
207
  }
208
208
  else {
209
- config2ts.GetValidFileList(fileList).forEach(function (filename) {
209
+ GetValidFileList(fileList).forEach(function (filename) {
210
210
  var target = path.join(outDir, "".concat(filename, ".ts"));
211
- fs.writeFileSync(target, config2ts.GetTsString(path.join(dir, filename)), { encoding: 'utf-8' });
211
+ fs.writeFileSync(target, GetTsString(path.join(dir, filename)), { encoding: 'utf-8' });
212
212
  console.log("config2ts, convert: ".concat(filename, " , to: ").concat(target));
213
213
  });
214
214
  console.log('config2ts convert done!');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "config2ts",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
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"
@@ -39,6 +39,7 @@
39
39
  "@types/jest": "^30.0.0",
40
40
  "@types/node": "^24.5.2",
41
41
  "jest": "^29.5.0",
42
- "ts-jest": "^29.4.4"
42
+ "ts-jest": "^29.4.4",
43
+ "typescript": "^5.9.2"
43
44
  }
44
45
  }