2c71c68577a70a5f6def19a7ec9e7c1893f93f6fa3feac1117a346f6e74c95af4c82fc2b0dae9cd2bbc5d1f2e3996af8de541e1b720237068326bf1259e508 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _index = require("../generated/index.js");
  7. var _default = exports.default = createTypeAnnotationBasedOnTypeof;
  8. function createTypeAnnotationBasedOnTypeof(type) {
  9. switch (type) {
  10. case "string":
  11. return (0, _index.stringTypeAnnotation)();
  12. case "number":
  13. return (0, _index.numberTypeAnnotation)();
  14. case "undefined":
  15. return (0, _index.voidTypeAnnotation)();
  16. case "boolean":
  17. return (0, _index.booleanTypeAnnotation)();
  18. case "function":
  19. return (0, _index.genericTypeAnnotation)((0, _index.identifier)("Function"));
  20. case "object":
  21. return (0, _index.genericTypeAnnotation)((0, _index.identifier)("Object"));
  22. case "symbol":
  23. return (0, _index.genericTypeAnnotation)((0, _index.identifier)("Symbol"));
  24. case "bigint":
  25. return (0, _index.anyTypeAnnotation)();
  26. }
  27. throw new Error("Invalid typeof value: " + type);
  28. }
  29. //# sourceMappingURL=createTypeAnnotationBasedOnTypeof.js.map