Sha256: 5c04de864e7026516a04b45dc258ca7cf90d312836dc5ebd0d7b3f6905c24497

Contents?: true

Size: 1.17 KB

Versions: 23

Compression:

Stored size: 1.17 KB

Contents

import type { ValidatedOptions } from "./validation/options.ts";
import getTargets, {
  type InputTargets,
} from "@babel/helper-compilation-targets";

import type { Targets } from "@babel/helper-compilation-targets";

export function resolveBrowserslistConfigFile(
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  browserslistConfigFile: string,
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  configFilePath: string,
): string | void {
  return undefined;
}

export function resolveTargets(
  options: ValidatedOptions,
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  root: string,
): Targets {
  const optTargets = options.targets;
  let targets: InputTargets;

  if (typeof optTargets === "string" || Array.isArray(optTargets)) {
    targets = { browsers: optTargets };
  } else if (optTargets) {
    if ("esmodules" in optTargets) {
      targets = { ...optTargets, esmodules: "intersect" };
    } else {
      // https://github.com/microsoft/TypeScript/issues/17002
      targets = optTargets as InputTargets;
    }
  }

  return getTargets(targets, {
    ignoreBrowserslistConfig: true,
    browserslistEnv: options.browserslistEnv,
  });
}

Version data entries

23 entries across 16 versions & 3 rubygems

Version Path
trusty-cms-6.3.1 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.51 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.51 node_modules/jscodeshift/node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.50 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.50 node_modules/jscodeshift/node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.49 node_modules/jscodeshift/node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.49 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.48 node_modules/jscodeshift/node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.48 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.47 node_modules/jscodeshift/node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.47 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.46 node_modules/jscodeshift/node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.46 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.45 node_modules/jscodeshift/node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.45 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.44 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.43 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.42 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.41 node_modules/@babel/core/src/config/resolve-targets-browser.ts
immosquare-cleaner-0.1.40 node_modules/@babel/core/src/config/resolve-targets-browser.ts