@servicetitan/dte-unlayer 0.118.0 → 0.119.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,10 @@ export const DATE_RANGE_YEARS = 2;
23
23
  * Returns true if the date's year falls within [currentYear - DATE_RANGE_YEARS, currentYear + DATE_RANGE_YEARS].
24
24
  * Invalid or unparseable dates return false.
25
25
  */
26
- export function isDateWithinRange(dateInput: string | Date): boolean {
26
+ export function isDateWithinRange(dateInput: unknown): boolean {
27
+ if (typeof dateInput !== 'string' && !(dateInput instanceof Date)) {
28
+ return false;
29
+ }
27
30
  const d = typeof dateInput === 'string' ? new Date(dateInput) : dateInput;
28
31
  if (!isFinite(d.getTime())) {
29
32
  return false;