CsvDataBase.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. Object.defineProperty(i, "__esModule", {value: !0}),
  5. (i.CsvDataBase = void 0),
  6. (i.CsvDataBase = class {
  7. constructor() {
  8. this.id = null;
  9. }
  10. $parseData(e, i, s) {
  11. var o = e.length;
  12. for (let t = 0; t < o; t++)
  13. switch (i[t]) {
  14. case "int":
  15. this[s[t]] = parseInt(e[t]);
  16. break;
  17. case "float":
  18. this[s[t]] = parseFloat(e[t]);
  19. break;
  20. case "string":
  21. this[s[t]] = e[t];
  22. break;
  23. case "ints":
  24. this[s[t]] = e[t].split("|").map(t => parseInt(t));
  25. break;
  26. case "floats":
  27. this[s[t]] = e[t].split("|").map(t => parseFloat(t));
  28. break;
  29. case "strings":
  30. this[s[t]] = e[t].split("|");
  31. }
  32. return e[0];
  33. }
  34. });