inject-resources.js 586 B

123456789101112131415
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.injectResources = void 0;
  4. const error_message_1 = require("./error-message");
  5. const injectResources = async (ctx, options, source, resources) => {
  6. const { injector } = options;
  7. const dist = injector.call(ctx, source, resources);
  8. const content = await dist;
  9. if (typeof content !== 'string') {
  10. throw new Error(error_message_1.errorMessage.invalidInjectorReturn);
  11. }
  12. return content;
  13. };
  14. exports.injectResources = injectResources;
  15. //# sourceMappingURL=inject-resources.js.map