Sha256: 36bf72e71950f99d664f69c9cfa741deaad620562cbf25ce99fac9cadef18355

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 KB

Contents

"use strict";

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

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

  _gensync = function () {
    return data;
  };

  return data;
}

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

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

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

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

7 entries across 7 versions & 1 rubygems

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