UNPKG

@modern-kit/utils

Version:
19 lines (15 loc) 446 B
'use strict'; var fileGetBlobFromUrl = require('../getBlobFromUrl/index.cjs'); async function getMIMETypeFromUrl(url) { try { const blob = await fileGetBlobFromUrl.getBlobFromUrl(url); return blob?.type ?? ""; } catch (err) { console.error( `Failed to get the MIME type from the URL. message: ${err.message}` ); return ""; } } exports.getMIMETypeFromUrl = getMIMETypeFromUrl; //# sourceMappingURL=index.cjs.map