defaults.js 860 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.getOptionSpecificExcludesFor = exports.getPlatformSpecificDefaultFor = void 0;
  6. const defaultWebIncludes = ["web.timers", "web.immediate", "web.dom.iterable"];
  7. const defaultExcludesForLooseMode = ["transform-typeof-symbol"];
  8. const getPlatformSpecificDefaultFor = targets => {
  9. const targetNames = Object.keys(targets);
  10. const isAnyTarget = !targetNames.length;
  11. const isWebTarget = targetNames.some(name => name !== "node");
  12. return isAnyTarget || isWebTarget ? defaultWebIncludes : null;
  13. };
  14. exports.getPlatformSpecificDefaultFor = getPlatformSpecificDefaultFor;
  15. const getOptionSpecificExcludesFor = ({
  16. loose
  17. }) => {
  18. if (loose) {
  19. return defaultExcludesForLooseMode;
  20. }
  21. return null;
  22. };
  23. exports.getOptionSpecificExcludesFor = getOptionSpecificExcludesFor;