1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.createConfigItem = createConfigItem;
|
---|
7 | exports.createConfigItemAsync = createConfigItemAsync;
|
---|
8 | exports.createConfigItemSync = createConfigItemSync;
|
---|
9 | Object.defineProperty(exports, "default", {
|
---|
10 | enumerable: true,
|
---|
11 | get: function () {
|
---|
12 | return _full.default;
|
---|
13 | }
|
---|
14 | });
|
---|
15 | exports.loadOptions = loadOptions;
|
---|
16 | exports.loadOptionsAsync = loadOptionsAsync;
|
---|
17 | exports.loadOptionsSync = loadOptionsSync;
|
---|
18 | exports.loadPartialConfig = loadPartialConfig;
|
---|
19 | exports.loadPartialConfigAsync = loadPartialConfigAsync;
|
---|
20 | exports.loadPartialConfigSync = loadPartialConfigSync;
|
---|
21 | function _gensync() {
|
---|
22 | const data = require("gensync");
|
---|
23 | _gensync = function () {
|
---|
24 | return data;
|
---|
25 | };
|
---|
26 | return data;
|
---|
27 | }
|
---|
28 | var _full = require("./full.js");
|
---|
29 | var _partial = require("./partial.js");
|
---|
30 | var _item = require("./item.js");
|
---|
31 | var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js");
|
---|
32 | const loadPartialConfigRunner = _gensync()(_partial.loadPartialConfig);
|
---|
33 | function loadPartialConfigAsync(...args) {
|
---|
34 | return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.async)(...args);
|
---|
35 | }
|
---|
36 | function loadPartialConfigSync(...args) {
|
---|
37 | return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.sync)(...args);
|
---|
38 | }
|
---|
39 | function loadPartialConfig(opts, callback) {
|
---|
40 | if (callback !== undefined) {
|
---|
41 | (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(opts, callback);
|
---|
42 | } else if (typeof opts === "function") {
|
---|
43 | (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(undefined, opts);
|
---|
44 | } else {
|
---|
45 | {
|
---|
46 | return loadPartialConfigSync(opts);
|
---|
47 | }
|
---|
48 | }
|
---|
49 | }
|
---|
50 | function* loadOptionsImpl(opts) {
|
---|
51 | var _config$options;
|
---|
52 | const config = yield* (0, _full.default)(opts);
|
---|
53 | return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null;
|
---|
54 | }
|
---|
55 | const loadOptionsRunner = _gensync()(loadOptionsImpl);
|
---|
56 | function loadOptionsAsync(...args) {
|
---|
57 | return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.async)(...args);
|
---|
58 | }
|
---|
59 | function loadOptionsSync(...args) {
|
---|
60 | return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.sync)(...args);
|
---|
61 | }
|
---|
62 | function loadOptions(opts, callback) {
|
---|
63 | if (callback !== undefined) {
|
---|
64 | (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(opts, callback);
|
---|
65 | } else if (typeof opts === "function") {
|
---|
66 | (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(undefined, opts);
|
---|
67 | } else {
|
---|
68 | {
|
---|
69 | return loadOptionsSync(opts);
|
---|
70 | }
|
---|
71 | }
|
---|
72 | }
|
---|
73 | const createConfigItemRunner = _gensync()(_item.createConfigItem);
|
---|
74 | function createConfigItemAsync(...args) {
|
---|
75 | return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.async)(...args);
|
---|
76 | }
|
---|
77 | function createConfigItemSync(...args) {
|
---|
78 | return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.sync)(...args);
|
---|
79 | }
|
---|
80 | function createConfigItem(target, options, callback) {
|
---|
81 | if (callback !== undefined) {
|
---|
82 | (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, options, callback);
|
---|
83 | } else if (typeof options === "function") {
|
---|
84 | (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, undefined, callback);
|
---|
85 | } else {
|
---|
86 | {
|
---|
87 | return createConfigItemSync(target, options);
|
---|
88 | }
|
---|
89 | }
|
---|
90 | }
|
---|
91 | 0 && 0;
|
---|
92 |
|
---|
93 | //# sourceMappingURL=index.js.map
|
---|