CoolFace
Apppublic

Ejdjdososs/fable-ai

sourceHugging Facemitupdated 3mo agoView on Hugging Face
0likes
parse.js46 linesDownload Raw Back to lib
1"use strict";2 3Object.defineProperty(exports, "__esModule", {4  value: true5});6exports.parse = void 0;7exports.parseAsync = parseAsync;8exports.parseSync = parseSync;9function _gensync() {10  const data = require("gensync");11  _gensync = function () {12    return data;13  };14  return data;15}16var _index = require("./config/index.js");17var _index2 = require("./parser/index.js");18var _normalizeOpts = require("./transformation/normalize-opts.js");19var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");20const parseRunner = _gensync()(function* parse(code, opts) {21  const config = yield* (0, _index.default)(opts);22  if (config === null) {23    return null;24  }25  return yield* (0, _index2.default)(config.passes, (0, _normalizeOpts.default)(config), code);26});27const parse = exports.parse = function parse(code, opts, callback) {28  if (typeof opts === "function") {29    callback = opts;30    opts = undefined;31  }32  if (callback === undefined) {33    return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(code, opts);34  }35  (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.errback)(code, opts, callback);36};37function parseSync(...args) {38  return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(...args);39}40function parseAsync(...args) {41  return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.async)(...args);42}430 && 0;44 45//# sourceMappingURL=parse.js.map46