UNPKG

payload

Version:

Node, React, Headless CMS and Application Framework built on Next.js

9 lines (8 loc) 347 B
export const validateMimeType = (mimeType, allowedMimeTypes)=>{ if (allowedMimeTypes.length === 0) { return true; } const cleanedMimeTypes = allowedMimeTypes.map((v)=>v.replace('*', '')); return cleanedMimeTypes.some((cleanedMimeType)=>mimeType.startsWith(cleanedMimeType)); }; //# sourceMappingURL=validateMimeType.js.map