wiremock-mapper
Version:
DSL for setting up WireMock mappings.
28 lines • 1.06 kB
JavaScript
;
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;
};
return UrlMatchBuilder;
}());
exports.UrlMatchBuilder = UrlMatchBuilder;
//# sourceMappingURL=url_match_builder.js.map