You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.5 KiB

2 years ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. function _export(target, all) {
  6. for(var name in all)Object.defineProperty(target, name, {
  7. enumerable: true,
  8. get: all[name]
  9. });
  10. }
  11. _export(exports, {
  12. dim: ()=>dim,
  13. default: ()=>_default
  14. });
  15. const _picocolors = /*#__PURE__*/ _interopRequireDefault(require("picocolors"));
  16. function _interopRequireDefault(obj) {
  17. return obj && obj.__esModule ? obj : {
  18. default: obj
  19. };
  20. }
  21. let alreadyShown = new Set();
  22. function log(type, messages, key) {
  23. if (typeof process !== "undefined" && process.env.JEST_WORKER_ID) return;
  24. if (key && alreadyShown.has(key)) return;
  25. if (key) alreadyShown.add(key);
  26. console.warn("");
  27. messages.forEach((message)=>console.warn(type, "-", message));
  28. }
  29. function dim(input) {
  30. return _picocolors.default.dim(input);
  31. }
  32. const _default = {
  33. info (key, messages) {
  34. log(_picocolors.default.bold(_picocolors.default.cyan("info")), ...Array.isArray(key) ? [
  35. key
  36. ] : [
  37. messages,
  38. key
  39. ]);
  40. },
  41. warn (key, messages) {
  42. log(_picocolors.default.bold(_picocolors.default.yellow("warn")), ...Array.isArray(key) ? [
  43. key
  44. ] : [
  45. messages,
  46. key
  47. ]);
  48. },
  49. risk (key, messages) {
  50. log(_picocolors.default.bold(_picocolors.default.magenta("risk")), ...Array.isArray(key) ? [
  51. key
  52. ] : [
  53. messages,
  54. key
  55. ]);
  56. }
  57. };