UNPKG

@gatling.io/core

Version:

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

46 lines (45 loc) 2.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.underlyingXWithSessionToSession = exports.underlyingXWithSessionTo = exports.underlyingSessionToDuration = exports.underlyingSessionToJava = exports.underlyingSessionTo = exports.underlyingSessionTransform = exports.wrapSession = void 0; const byteArrays_1 = require("./gatlingJvm/byteArrays"); const collections_1 = require("./gatlingJvm/collections"); const duration_1 = require("./utils/duration"); const wrapSession = (_underlying) => ({ _underlying, get: (key) => _underlying.get(key), set: (key, value) => { return (0, exports.wrapSession)(_underlying.set(key, (0, collections_1.asJava)(value))); }, setByteArray: (key, value) => (0, exports.wrapSession)(_underlying.set(key, (0, byteArrays_1.asByteArray)(value))), setAll: (newAttributes) => { let session = _underlying; for (const key in newAttributes) { session = session.set(key, (0, collections_1.asJava)(newAttributes[key])); } return (0, exports.wrapSession)(session); }, remove: (key) => (0, exports.wrapSession)(_underlying.remove(key)), reset: () => (0, exports.wrapSession)(_underlying.reset()), removeAll: (...keys) => (0, exports.wrapSession)(_underlying.removeAll(...keys)), contains: (key) => _underlying.contains(key), isFailed: () => _underlying.isFailed(), markAsSucceeded: () => (0, exports.wrapSession)(_underlying.markAsSucceeded()), markAsFailed: () => (0, exports.wrapSession)(_underlying.markAsFailed()), scenario: () => _underlying.scenario(), groups: () => _underlying.groups(), userId: () => _underlying.userId(), toString: () => _underlying.toString() }); exports.wrapSession = wrapSession; const underlyingSessionTransform = (f) => (jvmSession) => f((0, exports.wrapSession)(jvmSession))._underlying; exports.underlyingSessionTransform = underlyingSessionTransform; const underlyingSessionTo = (f) => (jvmSession) => f((0, exports.wrapSession)(jvmSession)); exports.underlyingSessionTo = underlyingSessionTo; const underlyingSessionToJava = (f) => (jvmSession) => (0, collections_1.asJava)(f((0, exports.wrapSession)(jvmSession))); exports.underlyingSessionToJava = underlyingSessionToJava; const underlyingSessionToDuration = (f) => (jvmSession) => (0, duration_1.toJvmDuration)(f((0, exports.wrapSession)(jvmSession))); exports.underlyingSessionToDuration = underlyingSessionToDuration; const underlyingXWithSessionTo = (f) => (x, jvmSession) => f(x, (0, exports.wrapSession)(jvmSession)); exports.underlyingXWithSessionTo = underlyingXWithSessionTo; const underlyingXWithSessionToSession = (f) => (x, jvmSession) => f(x, (0, exports.wrapSession)(jvmSession))._underlying; exports.underlyingXWithSessionToSession = underlyingXWithSessionToSession;