Asserts that the given number is a valid hour (between 0 and 23). If the number is not a valid hour, it throws an error.
The number to be validated.
Will throw an error if the number is not a valid hour.
assertValidHours(12); // No errorassertValidHours(24); // Throws Error: 'Expected hours to be between 0 and 23. Got: 24' Copy
assertValidHours(12); // No errorassertValidHours(24); // Throws Error: 'Expected hours to be between 0 and 23. Got: 24'
Generated using TypeDoc
Asserts that the given number is a valid hour (between 0 and 23). If the number is not a valid hour, it throws an error.