Skip to content

Commit

Permalink
fix: regexp duplicate ^ $
Browse files Browse the repository at this point in the history
  • Loading branch information
climba03003 committed Feb 2, 2024
1 parent 3f45933 commit 0709188
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/validator/lib/class/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function isDate (value: unknown): value is Date {
}

export function isISO8601Date (value: unknown): value is string {
const regexp = /^^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(([-+](\d{2}):(\d{2})|[-+](\d{4})|Z)?)$$/
const regexp = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(([-+](\d{2}):(\d{2})|[-+](\d{4})|Z)?)$/
return isString(value) && regexp.test(value)
}

Expand Down

0 comments on commit 0709188

Please sign in to comment.