Parse and validate a timeout string value.
Accepts only strings consisting entirely of digits (/^\d+$/), then verifies the resulting integer is positive and finite.
/^\d+$/
Raw string value (e.g. from --timeout argument or env var)
--timeout
Parsed positive integer, or undefined if invalid
undefined
parseTimeoutValue('90000'); // 90000parseTimeoutValue('10s'); // undefined (non-digit characters)parseTimeoutValue('0'); // undefined (not positive)parseTimeoutValue(''); // undefined Copy
parseTimeoutValue('90000'); // 90000parseTimeoutValue('10s'); // undefined (non-digit characters)parseTimeoutValue('0'); // undefined (not positive)parseTimeoutValue(''); // undefined
Parse and validate a timeout string value.
Accepts only strings consisting entirely of digits (
/^\d+$/), then verifies the resulting integer is positive and finite.