Urara-Blog/node_modules/.pnpm-store/v3/files/fe/4462b879a946454c408f58e3ca8981d6de640936c5b1c72f5f8eb6c5ddef2a800cb1c77300ffa56833f00522d7bce4d6f757a1e443d868fb808f71d3174281
2022-08-14 01:14:53 +08:00

54 lines
No EOL
1.1 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parseSync = exports.parseAsync = 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;
0 && 0;