@sebastianwessel/quickjs
Version:
A typescript package to execute JavaScript and TypeScript code in a WebAssembly QuickJS sandbox
17 lines (16 loc) • 601 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMaxIntervalAmount = void 0;
/**
* Determines the maximum allowed amount of concurrent intervals.
*
* @param runtimeOptions - The sandbox options containing `maxIntervalCount`.
* @returns The configured `maxIntervalCount` or `10` if none is set.
*/
const getMaxIntervalAmount = (runtimeOptions) => {
if (!runtimeOptions.maxIntervalCount || runtimeOptions.maxIntervalCount <= 0) {
return 10;
}
return runtimeOptions.maxIntervalCount;
};
exports.getMaxIntervalAmount = getMaxIntervalAmount;