@deliverr/serverless-offline-step-functions
Version:
Serverless Offline Plugin to Support Step Functions for Local Development
12 lines (11 loc) • 578 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateTimestamp = void 0;
const regex = /^(?<fullyear>\d{4})-(?<month>0[1-9]|1[0-2])-(?<mday>0[1-9]|[12][0-9]|3[01])T(?<hour>[01][0-9]|2[0-3]):(?<minute>[0-5][0-9]):(?<second>[0-5][0-9]|60)(?<secfrac>\.[0-9]+)?(Z|(\+|-)(?<offset_hour>[01][0-9]|2[0-3]):(?<offset_minute>[0-5][0-9]))$/i;
function validateTimestamp(timestamp) {
const isValidDate = timestamp.match(regex) !== null;
if (!isValidDate) {
throw new Error('');
}
}
exports.validateTimestamp = validateTimestamp;