Rocky_Mountain_Vending/.pnpm-store/v10/files/d1/3cb823cbc8d94037ce5c6b92fe2d76dc76a32da20f75263432a2a4660db1ed675fc76fd8257ac79f95fa4230e3901429b7e3135fb3f73634b8a3c4452e286b
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

42 lines
1 KiB
Text

"use strict";
exports.isValid = isValid;
var _index = require("./isDate.cjs");
var _index2 = require("./toDate.cjs");
/**
* @name isValid
* @category Common Helpers
* @summary Is the given date valid?
*
* @description
* Returns false if argument is Invalid Date and true otherwise.
* Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
* Invalid Date is a Date, whose time value is NaN.
*
* Time value of Date: http://es5.github.io/#x15.9.1.1
*
* @param date - The date to check
*
* @returns The date is valid
*
* @example
* // For the valid date:
* const result = isValid(new Date(2014, 1, 31))
* //=> true
*
* @example
* // For the value, convertible into a date:
* const result = isValid(1393804800000)
* //=> true
*
* @example
* // For the invalid date:
* const result = isValid(new Date(''))
* //=> false
*/
function isValid(date) {
return !(
(!(0, _index.isDate)(date) && typeof date !== "number") ||
isNaN(+(0, _index2.toDate)(date))
);
}