All files / resizin/lib/buildUrl buildUrlFactory.js

61.54% Statements 8/13
37.5% Branches 3/8
33.33% Functions 1/3
61.54% Lines 8/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26    1x     1x   1x   1x   1x   1x                     1x 1x
"use strict";
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
 
var _constants = require("../constants");
 
var _buildUrl = _interopRequireDefault(require("./buildUrl"));
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
 
var buildUrlFactory = function buildUrlFactory(options) {
  return function (imageId, buildOptions) {
    if (!options.bucket) {
      throw new Error('You did not provide bucket name, which is required for building iamge url');
    }
 
    var serverUrl = options.serverUrl || _constants.DEFAULT_SERVER_URL;
    (0, _buildUrl["default"])(serverUrl, options.bucket, imageId, buildOptions);
  };
};
 
var _default = buildUrlFactory;
exports["default"] = _default;