feat: migrate membership pdf media
This commit is contained in:
@@ -16,6 +16,7 @@ const mediaExtensions = new Set([
|
||||
'.jpg',
|
||||
'.mov',
|
||||
'.mp4',
|
||||
'.pdf',
|
||||
'.png',
|
||||
'.svg',
|
||||
'.webm',
|
||||
@@ -30,6 +31,7 @@ const mimeByExt: Record<string, string> = {
|
||||
'.jpg': 'image/jpeg',
|
||||
'.mov': 'video/quicktime',
|
||||
'.mp4': 'video/mp4',
|
||||
'.pdf': 'application/pdf',
|
||||
'.png': 'image/png',
|
||||
'.svg': 'image/svg+xml',
|
||||
'.webm': 'video/webm',
|
||||
@@ -61,7 +63,7 @@ function isMediaSource(value: string) {
|
||||
async function findSpaSources() {
|
||||
const files = (await walk(spaDir)).filter((file) => /\.(tsx?|jsx?)$/.test(file))
|
||||
const sources = new Set<string>()
|
||||
const quotedUrl = /["'`]((?:https?:\/\/images\.unsplash\.com\/[^"'`\s)]+)|(?:\/(?:images\/)?[^"'`\s)]+\.(?:avif|gif|jpe?g|mov|mp4|png|svg|webm|webp|zip)(?:\?[^"'`\s)]*)?))["'`]/gi
|
||||
const quotedUrl = /["'`]((?:https?:\/\/images\.unsplash\.com\/[^"'`\s)]+)|(?:\/(?:images\/)?[^"'`\s)]+\.(?:avif|gif|jpe?g|mov|mp4|pdf|png|svg|webm|webp|zip)(?:\?[^"'`\s)]*)?))["'`]/gi
|
||||
const cssUrl = /url\((['"]?)(.*?)\1\)/g
|
||||
|
||||
for (const file of files) {
|
||||
|
||||
Reference in New Issue
Block a user