Skip to content

Commit

Permalink
refactor: remove unused validation
Browse files Browse the repository at this point in the history
  • Loading branch information
1emu committed Dec 19, 2024
1 parent 3072cbd commit ab55f3d
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/utils/validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,23 +255,6 @@ export async function isValidImage(imageUrl: string) {
})
}

export async function valdidateImagesUrls(proposalSection: string) {
const imageUrls = extractImageUrls(proposalSection)

const errors: string[] = []
for (const imageUrl of imageUrls) {
const isValid = await isValidImage(imageUrl)
if (!isValid) {
errors.push(imageUrl)
}
}

return {
isValid: errors.length === 0,
errors,
}
}

export function extractImageUrls(markdown: string): string[] {
const imageRegex = /!\[.*?\]\((.*?)\)|\[.*?\]:\s*(.*?)(?:\s|$)/g
const urls: string[] = []
Expand Down

0 comments on commit ab55f3d

Please sign in to comment.