Sha256: 49b2046fbdc3f96bbaac3246e6331f10862498f7636dc66b3feb7605e0f87dcd

Contents?: true

Size: 1.23 KB

Versions: 7

Compression:

Stored size: 1.23 KB

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.transformFromAstAsync = exports.transformFromAstSync = exports.transformFromAst = void 0;

function _gensync() {
  const data = require("gensync");

  _gensync = function () {
    return data;
  };

  return data;
}

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

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

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

const transformFromAst = function transformFromAst(ast, code, opts, callback) {
  if (typeof opts === "function") {
    callback = opts;
    opts = undefined;
  }

  if (callback === undefined) {
    return transformFromAstRunner.sync(ast, code, opts);
  }

  transformFromAstRunner.errback(ast, code, opts, callback);
};

exports.transformFromAst = transformFromAst;
const transformFromAstSync = transformFromAstRunner.sync;
exports.transformFromAstSync = transformFromAstSync;
const transformFromAstAsync = transformFromAstRunner.async;
exports.transformFromAstAsync = transformFromAstAsync;

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.16.1 test/dummy/node_modules/@babel/core/lib/transform-ast.js
disco_app-0.15.2 test/dummy/node_modules/@babel/core/lib/transform-ast.js
disco_app-0.18.4 test/dummy/node_modules/@babel/core/lib/transform-ast.js
disco_app-0.18.1 test/dummy/node_modules/@babel/core/lib/transform-ast.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/core/lib/transform-ast.js
disco_app-0.14.0 test/dummy/node_modules/@babel/core/lib/transform-ast.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/core/lib/transform-ast.js