debug-utils.js 735 B

12345678910111213141516171819
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.presetEnvSilentDebugHeader = void 0;
  4. exports.stringifyTargets = stringifyTargets;
  5. exports.stringifyTargetsMultiline = stringifyTargetsMultiline;
  6. var _helperCompilationTargets = require("@babel/helper-compilation-targets");
  7. const presetEnvSilentDebugHeader = "#__secret_key__@babel/preset-env__don't_log_debug_header_and_resolved_targets";
  8. exports.presetEnvSilentDebugHeader = presetEnvSilentDebugHeader;
  9. function stringifyTargetsMultiline(targets) {
  10. return JSON.stringify((0, _helperCompilationTargets.prettifyTargets)(targets), null, 2);
  11. }
  12. function stringifyTargets(targets) {
  13. return JSON.stringify(targets).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }');
  14. }