Skip to content

Commit

Permalink
Make regex a bit more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpmccormick committed Sep 18, 2024
1 parent 24c5a98 commit b87de1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prismic-model/lintPrismicData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function detectNonPromoImageStories(doc: any): string[] {
function detectIncorrectAudioVideoDuration(doc: any): string[] {
const guideStopSlices =
doc?.data?.slices?.filter(s => s.slice_type === 'guide_stop') || [];
const regex = /^\d{2}:\d{2}$/; // e.g. 03:30
const regex = /^(\d{2,}:)?[0-5][0-9]:[0-5][0-9]$/; // e.g. 03:30 (optionally 01:03:30)

const audioErrors = guideStopSlices
.filter(
Expand Down

0 comments on commit b87de1b

Please sign in to comment.