aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@babel/core/lib/transform-ast-sync.js
blob: a4946dd60a6a06f662466492bce0950ffdd7240a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = transformFromAstSync;

var _config = _interopRequireDefault(require("./config"));

var _transformation = require("./transformation");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function transformFromAstSync(ast, code, opts) {
  const config = (0, _config.default)(opts);
  if (config === null) return null;
  if (!ast) throw new Error("No AST given");
  return (0, _transformation.runSync)(config, code, ast);
}