UNPKG

@sebastianwessel/quickjs

Version:

A typescript package to execute JavaScript and TypeScript code in a WebAssembly QuickJS sandbox

13 lines (12 loc) 432 B
/** * Determines the maximum allowed amount of concurrent timeouts. * * @param runtimeOptions - The sandbox options containing `maxTimeoutCount`. * @returns The configured `maxTimeoutCount` or `10` if none is set. */ export const getMaxTimeoutAmount = (runtimeOptions) => { if (!runtimeOptions.maxTimeoutCount || runtimeOptions.maxTimeoutCount <= 0) { return 10; } return runtimeOptions.maxTimeoutCount; };