wiremock-mapper
Version:
DSL for setting up WireMock mappings.
44 lines • 1.67 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UrlMatchBuilder = void 0;
var UrlMatchBuilder = /** @class */ (function () {
function UrlMatchBuilder(requestBuilder, path) {
if (path === void 0) { path = false; }
var _this = this;
this.requestBuilder = requestBuilder;
this.path = path;
this.jsonObject = {};
this.toJSON = function () { return _this.jsonObject; };
}
UrlMatchBuilder.prototype.equalTo = function (url) {
var _a;
var urlType = this.path ? 'urlPath' : 'url';
this.jsonObject = (_a = {}, _a[urlType] = url, _a);
return this.requestBuilder;
};
UrlMatchBuilder.prototype.matching = function (regexp) {
var _a;
var urlType = this.path ? 'urlPathPattern' : 'urlPattern';
this.jsonObject = (_a = {}, _a[urlType] = regexp, _a);
return this.requestBuilder;
};
UrlMatchBuilder.prototype.clone = function (newRequestBuilder) {
var clone = new UrlMatchBuilder(newRequestBuilder, this.path);
clone.jsonObject = __assign({}, this.jsonObject);
return clone;
};
return UrlMatchBuilder;
}());
exports.UrlMatchBuilder = UrlMatchBuilder;
//# sourceMappingURL=url_match_builder.js.map