1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | Object.defineProperty(exports, "default", {
|
7 | enumerable: true,
|
8 | get: function () {
|
9 | return _full.default;
|
10 | }
|
11 | });
|
12 | exports.loadOptionsAsync = exports.loadOptionsSync = exports.loadOptions = exports.loadPartialConfigAsync = exports.loadPartialConfigSync = exports.loadPartialConfig = void 0;
|
13 |
|
14 | function _gensync() {
|
15 | const data = _interopRequireDefault(require("gensync"));
|
16 |
|
17 | _gensync = function () {
|
18 | return data;
|
19 | };
|
20 |
|
21 | return data;
|
22 | }
|
23 |
|
24 | var _full = _interopRequireDefault(require("./full"));
|
25 |
|
26 | var _partial = require("./partial");
|
27 |
|
28 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29 |
|
30 | const loadOptionsRunner = (0, _gensync().default)(function* (opts) {
|
31 | var _config$options;
|
32 |
|
33 | const config = yield* (0, _full.default)(opts);
|
34 | return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null;
|
35 | });
|
36 |
|
37 | const maybeErrback = runner => (opts, callback) => {
|
38 | if (callback === undefined && typeof opts === "function") {
|
39 | callback = opts;
|
40 | opts = undefined;
|
41 | }
|
42 |
|
43 | return callback ? runner.errback(opts, callback) : runner.sync(opts);
|
44 | };
|
45 |
|
46 | const loadPartialConfig = maybeErrback(_partial.loadPartialConfig);
|
47 | exports.loadPartialConfig = loadPartialConfig;
|
48 | const loadPartialConfigSync = _partial.loadPartialConfig.sync;
|
49 | exports.loadPartialConfigSync = loadPartialConfigSync;
|
50 | const loadPartialConfigAsync = _partial.loadPartialConfig.async;
|
51 | exports.loadPartialConfigAsync = loadPartialConfigAsync;
|
52 | const loadOptions = maybeErrback(loadOptionsRunner);
|
53 | exports.loadOptions = loadOptions;
|
54 | const loadOptionsSync = loadOptionsRunner.sync;
|
55 | exports.loadOptionsSync = loadOptionsSync;
|
56 | const loadOptionsAsync = loadOptionsRunner.async;
|
57 | exports.loadOptionsAsync = loadOptionsAsync; |
\ | No newline at end of file |