@sebastianwessel/quickjs
Version:
A typescript package to execute JavaScript and TypeScript code in a WebAssembly QuickJS sandbox
13 lines (12 loc) • 439 B
JavaScript
/**
* 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.
*/
export const getMaxIntervalAmount = (runtimeOptions) => {
if (!runtimeOptions.maxIntervalCount || runtimeOptions.maxIntervalCount <= 0) {
return 10;
}
return runtimeOptions.maxIntervalCount;
};