UNPKG

@gatling.io/core

Version:

Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).

15 lines (14 loc) 751 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.doSwitchOrElseImpl = void 0; const session_1 = require("../session"); const wrapOn = (jvmOn, wrap) => ({ on: (...choices) => wrapOrElse(jvmOn.on(choices.map((c) => c._underlying)), wrap) }); const wrapOrElse = (jvmOrElse, wrap) => ({ orElse: (executable, ...executables) => wrap(jvmOrElse.orElse(executable._underlying, ...executables.map((e) => e._underlying))) }); const doSwitchOrElseImpl = (jvmDoSwitchOrElse, wrap) => (actual) => wrapOn(typeof actual === "function" ? jvmDoSwitchOrElse.doSwitchOrElse((0, session_1.underlyingSessionTo)(actual)) : jvmDoSwitchOrElse.doSwitchOrElse(actual), wrap); exports.doSwitchOrElseImpl = doSwitchOrElseImpl;