You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
735 B

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isBefore;
var _assertString = _interopRequireDefault(require("./util/assertString"));
var _toDate = _interopRequireDefault(require("./toDate"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isBefore(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);
return !!(original && comparison && original < comparison);
}
module.exports = exports.default;
module.exports.default = exports.default;