index.js 3.3 KB

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