Sha256: c1320a7e825108b5f775e687d54ada26c79b124a67149457ef38f3b418e4a56a

Contents?: true

Size: 1.26 KB

Versions: 4

Compression:

Stored size: 1.26 KB

Contents

"use strict";

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

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

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

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

const gensync = require("gensync");

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

4 entries across 3 versions & 2 rubygems

Version Path
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/@babel/core/lib/transform-ast.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/@babel/core/lib/transform-ast.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/@babel/core/lib/transform-ast.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/@babel/core/lib/transform-ast.js