Function assertValid

Asserts that the provided Luxon value is valid.

This function checks whether a Luxon date, duration, or interval is valid. If the value is invalid, it throws an error with details from the value's invalidReason and invalidExplanation properties.

The Luxon object to validate.

Optional custom header for the error message.

If the provided value is invalid.