defaults.js 860 Bytes
Newer Older
Patrick's avatar
Patrick committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getOptionSpecificExcludesFor = exports.getPlatformSpecificDefaultFor = void 0;
const defaultWebIncludes = ["web.timers", "web.immediate", "web.dom.iterable"];
const defaultExcludesForLooseMode = ["transform-typeof-symbol"];

const getPlatformSpecificDefaultFor = targets => {
  const targetNames = Object.keys(targets);
  const isAnyTarget = !targetNames.length;
  const isWebTarget = targetNames.some(name => name !== "node");
  return isAnyTarget || isWebTarget ? defaultWebIncludes : null;
};

exports.getPlatformSpecificDefaultFor = getPlatformSpecificDefaultFor;

const getOptionSpecificExcludesFor = ({
  loose
}) => {
  if (loose) {
    return defaultExcludesForLooseMode;
  }

  return null;
};

exports.getOptionSpecificExcludesFor = getOptionSpecificExcludesFor;