Sha256: 0d4f590c518bca205b065c4945ea03056193721116cf648cc55a656ace97e048

Contents?: true

Size: 1.13 KB

Versions: 4

Compression:

Stored size: 1.13 KB

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.parseAsync = exports.parseSync = exports.parse = void 0;

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

var _parser = _interopRequireDefault(require("./parser"));

var _normalizeOpts = _interopRequireDefault(require("./transformation/normalize-opts"));

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

const gensync = require("gensync");

const parseRunner = gensync(function* parse(code, opts) {
  const config = yield* (0, _config.default)(opts);

  if (config === null) {
    return null;
  }

  return yield* (0, _parser.default)(config.passes, (0, _normalizeOpts.default)(config), code);
});

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

  if (callback === undefined) return parseRunner.sync(code, opts);
  parseRunner.errback(code, opts, callback);
};

exports.parse = parse;
const parseSync = parseRunner.sync;
exports.parseSync = parseSync;
const parseAsync = parseRunner.async;
exports.parseAsync = parseAsync;

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/parse.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/@babel/core/lib/parse.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/@babel/core/lib/parse.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/@babel/core/lib/parse.js