load-resources.js 773 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.loadResources = void 0;
  4. const get_resources_1 = require("./get-resources");
  5. const inject_resources_1 = require("./inject-resources");
  6. const normalize_options_1 = require("./normalize-options");
  7. const loadResources = async (ctx, source, callback) => {
  8. try {
  9. const options = (0, normalize_options_1.normalizeOptions)(ctx);
  10. const resources = await (0, get_resources_1.getResources)(ctx, options);
  11. const content = await (0, inject_resources_1.injectResources)(ctx, options, source, resources);
  12. callback(null, content);
  13. }
  14. catch (err) {
  15. callback(err);
  16. }
  17. };
  18. exports.loadResources = loadResources;
  19. //# sourceMappingURL=load-resources.js.map