UNPKG

@modern-kit/utils

Version:
20 lines (17 loc) 453 B
'use strict'; async function getBlobFromUrl(url) { try { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to fetch resource. status: ${response.status}`); } return await response.blob(); } catch (err) { console.error( `Failed to get the Blob from the URL. message: ${err.message}` ); throw err; } } exports.getBlobFromUrl = getBlobFromUrl; //# sourceMappingURL=index.cjs.map