@gatling.io/core
Version:
Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).
33 lines (32 loc) • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.foreachImpl = void 0;
const session_1 = require("../session");
const on_1 = require("./on");
const foreachImpl = (jvmForEach, wrap) => (seq, attributeName, counterName) => {
if (typeof seq === "function") {
if (counterName !== undefined) {
return (0, on_1.wrapOn)(jvmForEach.foreach((0, session_1.underlyingSessionTo)(seq), attributeName, counterName), wrap);
}
else {
return (0, on_1.wrapOn)(jvmForEach.foreach((0, session_1.underlyingSessionTo)(seq), attributeName), wrap);
}
}
else if (typeof seq === "string") {
if (counterName !== undefined) {
return (0, on_1.wrapOn)(jvmForEach.foreach(seq, attributeName, counterName), wrap);
}
else {
return (0, on_1.wrapOn)(jvmForEach.foreach(seq, attributeName), wrap);
}
}
else {
if (counterName !== undefined) {
return (0, on_1.wrapOn)(jvmForEach.foreach(seq, attributeName, counterName), wrap);
}
else {
return (0, on_1.wrapOn)(jvmForEach.foreach(seq, attributeName), wrap);
}
}
};
exports.foreachImpl = foreachImpl;