Sha256: f7dd51790b44adb56b5fc08ba569143e90712cd51e1cca65f0546d82602c0f5f

Contents?: true

Size: 1.38 KB

Versions: 30

Compression:

Stored size: 1.38 KB

Contents

"use strict";

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

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

  _gensync = function () {
    return data;
  };

  return data;
}

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

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

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

const transformFromAstRunner = (0, _gensync().default)(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

30 entries across 30 versions & 5 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/core/lib/transform-ast.js
trusty-cms-5.0.7 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-5.0.6 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-5.0.5 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-5.0.4 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-5.0.3 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-5.0.2 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-5.0.1 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.3.5 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-5.0.0 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.3.4 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.3.3 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.3.2 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.3.1 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.3 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.2.3 node_modules/@babel/core/lib/transform-ast.js
tang-0.2.1 spec/tang_app/node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.2.2 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.2.1 node_modules/@babel/core/lib/transform-ast.js
trusty-cms-4.2 node_modules/@babel/core/lib/transform-ast.js