@gatling.io/core
Version:
Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).
27 lines (26 loc) • 979 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.doWhileImpl = void 0;
const session_1 = require("../session");
const on_1 = require("./on");
const doWhileImpl = (jvmDoWhile, wrap) => (condition, counterName) => {
if (counterName !== undefined) {
// doWhile(condition, counterName)
if (typeof condition === "function") {
return (0, on_1.wrapOn)(jvmDoWhile.doWhile((0, session_1.underlyingSessionTo)(condition), counterName), wrap);
}
else {
return (0, on_1.wrapOn)(jvmDoWhile.doWhile(condition, counterName), wrap);
}
}
else {
// doWhile(condition)
if (typeof condition === "function") {
return (0, on_1.wrapOn)(jvmDoWhile.doWhile((0, session_1.underlyingSessionTo)(condition)), wrap);
}
else {
return (0, on_1.wrapOn)(jvmDoWhile.doWhile(condition), wrap);
}
}
};
exports.doWhileImpl = doWhileImpl;