Skip to content

v4.0.2 - Enhanced Error Handling and Robust Testing

Compare
Choose a tag to compare
@jackie1santana jackie1santana released this 18 Jul 05:59
· 12 commits to development since this release
19e8342

What's New:
Enhanced Error Handling:

  • Added comprehensive validation for dateParam to ensure it accepts only valid ISO date strings or Date objects.
  • Explicit error messages for invalid, undefined, or null date parameters.
  • Improved handling for specific edge cases like future dates and exactly one year ago.
  • Improved Test Coverage
  • Added multiple test cases to cover various scenarios including valid dates, invalid dates, edge cases, and different time intervals.
  • Ensured robust testing for the core functionality and error handling of showtimeago.
  • Refactored Code

Cleaned up and optimized the showtimeago function for better readability and maintainability.
Streamlined the process of converting and formatting dates to human-readable "time ago" strings.