config.ts 822 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { join } from "path";
  2. // 打包路径
  3. export const DistPath = join(__dirname, "../dist");
  4. // 实体描述
  5. export const Entity = {
  6. mapping: [
  7. {
  8. // 自定义匹配
  9. custom: ({ propertyName, type }) => {
  10. // status 原本是tinyint,如果是1的话,== true 是可以的,但是不能 === true,请谨慎使用
  11. if (propertyName === "status" && type == "tinyint") return "boolean";
  12. // 如果没有,返回null或者不返回,则继续遍历其他匹配规则
  13. return null;
  14. }
  15. },
  16. {
  17. type: "string",
  18. test: ["varchar", "text", "simple-json"]
  19. },
  20. {
  21. type: "string[]",
  22. test: ["simple-array"]
  23. },
  24. {
  25. type: "Date",
  26. test: ["datetime", "date"]
  27. },
  28. {
  29. type: "number",
  30. test: ["tinyint", "int", "decimal"]
  31. },
  32. {
  33. type: "BigInt",
  34. test: ["bigint"]
  35. }
  36. ]
  37. };