Cleanup
This commit is contained in:
13
node_modules/validator/lib/isAfter.js
generated
vendored
13
node_modules/validator/lib/isAfter.js
generated
vendored
@@ -5,17 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.default = isAfter;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
var _toDate = _interopRequireDefault(require("./toDate"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function isAfter(str) {
|
||||
var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String(new Date());
|
||||
(0, _assertString.default)(str);
|
||||
var comparison = (0, _toDate.default)(date);
|
||||
var original = (0, _toDate.default)(str);
|
||||
function isAfter(date, options) {
|
||||
// For backwards compatibility:
|
||||
// isAfter(str [, date]), i.e. `options` could be used as argument for the legacy `date`
|
||||
var comparisonDate = (options === null || options === void 0 ? void 0 : options.comparisonDate) || options || Date().toString();
|
||||
var comparison = (0, _toDate.default)(comparisonDate);
|
||||
var original = (0, _toDate.default)(date);
|
||||
return !!(original && comparison && original > comparison);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user